michael@0: # mozilla/autoload.py: Autoload SpiderMonkey pretty-printers. michael@0: michael@0: print "Loading JavaScript value pretty-printers; see js/src/gdb/README." michael@0: print "If they cause trouble, type: disable pretty-printer .* SpiderMonkey" michael@0: michael@0: import gdb.printing michael@0: import mozilla.prettyprinters michael@0: michael@0: # Import the pretty-printer modules. As a side effect, loading these michael@0: # modules registers their printers with mozilla.prettyprinters. michael@0: import mozilla.jsid michael@0: import mozilla.JSObject michael@0: import mozilla.JSString michael@0: import mozilla.jsval michael@0: import mozilla.Root michael@0: michael@0: # The user may have personal pretty-printers. Get those, too, if they exist. michael@0: try: michael@0: import my_mozilla_printers michael@0: except ImportError: michael@0: pass michael@0: michael@0: # Register our pretty-printers with |objfile|. michael@0: def register(objfile): michael@0: lookup = mozilla.prettyprinters.lookup_for_objfile(objfile) michael@0: if lookup: michael@0: gdb.printing.register_pretty_printer(objfile, lookup, replace=True)