Bug 841998: JS GDB support: Make prettyprinters.lookup_for_objfile cope with non-SpiderMonkey objfiles correctly. r=sfink

This commit is contained in:
Jim Blandy 2013-02-27 09:30:02 -08:00
parent 7b7070ac12
commit 5bd2646110

View File

@ -220,7 +220,9 @@ def implemented_types(t):
template_regexp = re.compile("([\w_:]+)<") 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): def lookup_for_objfile(objfile):
# Create a type cache for this objfile. # Create a type cache for this objfile.
try: try:
@ -229,6 +231,7 @@ def lookup_for_objfile(objfile):
if gdb.parameter("verbose"): if gdb.parameter("verbose"):
gdb.write("objfile '%s' has no SpiderMonkey code; not registering pretty-printers\n" gdb.write("objfile '%s' has no SpiderMonkey code; not registering pretty-printers\n"
% (objfile.filename,)) % (objfile.filename,))
return None
# Return a pretty-printer for |value|, if we have one. This is the lookup # 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 # function object we place in each gdb.Objfile's pretty-printers list, so it