diff --git a/share/qtcreator/gdbmacros/dumper.py b/share/qtcreator/gdbmacros/dumper.py index 32566ee2df8..49b09ec96cc 100644 --- a/share/qtcreator/gdbmacros/dumper.py +++ b/share/qtcreator/gdbmacros/dumper.py @@ -866,6 +866,7 @@ class Item: qqFormats = {} qqDumpers = {} qqNs = "" +qqQObjectCache = {} class SetupCommand(gdb.Command): @@ -1134,6 +1135,24 @@ class Dumper: #print('data=[' + locals + sep + watchers + '],bkpts=[' + breakpoints + ']\n') + def checkForQObjectBase(self, type): + if type.code != gdb.TYPE_CODE_STRUCT: + return False + name = str(type) + if name in qqQObjectCache: + return qqQObjectCache[name] + if name == self.ns + "QObject": + qqQObjectCache[name] = True + return True + fields = type.strip_typedefs().fields() + if len(fields) == 0: + qqQObjectCache[name] = False + return False + base = fields[0].type.strip_typedefs() + result = self.checkForQObjectBase(base) + qqQObjectCache[name] = result + return result + def handleWatch(self, exp, iname): exp = str(exp) diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py index 0d8f4a7da0d..9c274ed4426 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.py +++ b/share/qtcreator/gdbmacros/gdbmacros.py @@ -704,8 +704,6 @@ def qdump__QObject(d, item): # Static properties. propertyData = metaData[7] for i in xrange(staticPropertyCount): - - for property in xrange(propertyCount): with SubItem(d): offset = propertyData + 3 * i propertyName = extractCString(metaStringData, metaData[offset])