Commit f03138aa authored by hjk's avatar hjk
Browse files

debugger: work around gdb 7.2 bug

python print gdb.parse_and_eval("ob.d_ptr.d.children\").type.template_argument(0)
creates consistent "RuntimeError: No type named myns::QObject." with stock 7.2
parent 7c0b1b63
......@@ -144,6 +144,11 @@ def lookupType(typestring):
#if not type is None:
# warn(" FIELDS: '%s'" % type.fields())
typeCache[typestring] = type
if type is None and typestring.endswith('*'):
type = lookupType(typestring[0:-1])
if not type is None:
type = type.pointer()
typeCache[typestring] = type
if type is None:
# could be gdb.lookup_type("char[3]") generating
# "RuntimeError: No type named char[3]"
......
......@@ -436,7 +436,15 @@ def qdump__QList(d, item):
checkRef(d_ptr["ref"])
# Additional checks on pointer arrays.
innerType = item.value.type.template_argument(0)
try:
# This fails on stock 7.2 with
# "RuntimeError: No type named myns::QObject.\n"
innerType = item.value.type.template_argument(0)
except:
# That's something like "myns::QList<...>"
innerString = str(item.value.type.strip_typedefs())
innerType = lookupType(innerString[len(d.ns) + 6 : -1])
innerTypeIsPointer = innerType.code == gdb.TYPE_CODE_PTR \
and str(innerType.target().unqualified()) != "char"
if innerTypeIsPointer:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment