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
#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]"
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: