Bug 841998: JS GDB support: Make prettyprinters.lookup_for_objfile cope with non-SpiderMonkey objfiles correctly. r=sfink
authorJim Blandy <jimb@mozilla.com>
Wed, 27 Feb 2013 09:30:02 -0800
changeset 123188 c24a33c1330128f2061622c5c5b3af167fea42ee
parent 123187 0be161a453bed1520af5749a4e158e9331c68893
child 123189 7addb08b2e931ce2dcec8137678eaca7681ec41a
push id24373
push userryanvm@gmail.com
push dateThu, 28 Feb 2013 01:36:21 +0000
treeherdermozilla-central@8cb9d6981978 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs841998
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 841998: JS GDB support: Make prettyprinters.lookup_for_objfile cope with non-SpiderMonkey objfiles correctly. r=sfink
js/src/gdb/mozilla/prettyprinters.py
--- a/js/src/gdb/mozilla/prettyprinters.py
+++ b/js/src/gdb/mozilla/prettyprinters.py
@@ -215,25 +215,28 @@ def implemented_types(t):
             for b in base_classes:
                 for t2 in followers(b): yield t2
 
     yield t
     for t2 in followers(t): yield t2
 
 template_regexp = re.compile("([\w_:]+)<")
 
-# Make a lookup function for objfile.
+# Construct and return a pretty-printer lookup function for objfile, or
+# return None if the objfile doesn't contain SpiderMonkey code
+# (specifically, definitions for SpiderMonkey types).
 def lookup_for_objfile(objfile):
     # Create a type cache for this objfile.
     try:
         cache = TypeCache(objfile)
     except NotSpiderMonkeyObjfileError:
         if gdb.parameter("verbose"):
             gdb.write("objfile '%s' has no SpiderMonkey code; not registering pretty-printers\n"
                       % (objfile.filename,))
+        return None
 
     # Return a pretty-printer for |value|, if we have one. This is the lookup
     # function object we place in each gdb.Objfile's pretty-printers list, so it
     # carries |name|, |enabled|, and |subprinters| attributes.
     def lookup(value):
         # If |table| has a pretty-printer for |tag|, apply it to |value|.
         def check_table(table, tag):
             if tag in table: