Bug 828078: JS GDB support: Add dummy type lookup to work around GDB bug (fixed in present GDB sources). r=sfink

This commit is contained in:
Jim Blandy 2013-02-09 09:14:13 -08:00
parent db7cb945c2
commit 55264eacf3

View File

@ -10,6 +10,11 @@ prettyprinters.clear_module_printers(__name__)
class JSObjectTypeCache(object):
def __init__(self, value, cache):
# In GDB 7.4.50, with some programs, this first dummy gdb.lookup_type
# call is required to make the second lookup_type call succeed. A GDB
# built from the public sources as of 2012-12-12 did not require the
# dummy lookup.
gdb.lookup_type('js::BaseShape')
baseshape_flags = gdb.lookup_type('js::BaseShape::Flag')
self.flag_DELEGATE = prettyprinters.enum_value(baseshape_flags, 'js::BaseShape::DELEGATE')
self.func_ptr_type = gdb.lookup_type('JSFunction').pointer()