Bug 845888: Have GDB load JavaScript value pretty-printers when debugging libxul.so, or anything that links against it. r=glandium

This commit is contained in:
Jim Blandy 2013-03-06 08:38:31 -08:00
parent ee424c2018
commit 3c82b32762
3 changed files with 22 additions and 0 deletions

View File

@ -1,5 +1,8 @@
# mozilla/autoload.py: Autoload SpiderMonkey pretty-printers.
print "Loading JavaScript value pretty-printers; see js/src/gdb/README."
print "If they cause trouble, type: disable pretty-printer .* SpiderMonkey"
import gdb.printing
import mozilla.prettyprinters

View File

@ -649,6 +649,17 @@ ifdef MOZ_GSTREAMER
EXTRA_DSO_LDOPTS += $(GSTREAMER_LIBS)
endif
# Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is
# too old to support Python pretty-printers; if this changes, we could make
# this 'ifdef GNU_CC'.
ifeq (Linux,$(OS_ARCH))
# Create a GDB Python auto-load file alongside the libxul shared library in
# the build directory.
PP_TARGETS += LIBXUL_AUTOLOAD
LIBXUL_AUTOLOAD = libxul.so-gdb.py.in
LIBXUL_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir))
endif
include $(topsrcdir)/config/rules.mk
export:: $(RDF_UTIL_SRC_CPPSRCS) $(INTL_UNICHARUTIL_UTIL_CPPSRCS)

View File

@ -0,0 +1,8 @@
""" GDB Python customization auto-loader for libxul """
#filter substitution
import os.path
sys.path[0:0] = [os.path.join('@topsrcdir@', 'js', 'src', 'gdb')]
import mozilla.autoload
mozilla.autoload.register(gdb.current_objfile())