From cff7191064b9e496121ea23f76873d56bddca3d0 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 20 Aug 2010 14:58:55 +0200 Subject: debugger: and another fix for QObject property dumper --- share/qtcreator/gdbmacros/gdbmacros.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py index 1cba34f289..5f1a58d0ae 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.py +++ b/share/qtcreator/gdbmacros/gdbmacros.py @@ -483,7 +483,9 @@ def qdump__QLinkedList(d, item): def qdump__QLocale(d, item): d.putStringValue(call(item.value, "name()")) - d.putNumChild(8) + d.putNumChild(0) + return + # FIXME: Poke back for variants. if d.isExpanded(item): with Children(d, 1, lookupType(d.ns + "QChar"), 0): d.putCallItem("country", item, "country()") @@ -632,6 +634,9 @@ def qdump__QObject(d, item): d.putNumChild(propertyCount) if d.isExpandedIName(item.iname + ".properties"): with Children(d): + # FIXME: Make this global. Don't leak. + gdb.execute("set $d = (QVariant*)malloc(sizeof(QVariant))") + gdb.execute("set $d.d.is_shared = 0") for property in xrange(propertyCount): with SubItem(d): offset = propertyData + 3 * property @@ -646,6 +651,15 @@ def qdump__QObject(d, item): #exp = '"((\'%sQObject\'*)%s)"' % (d.ns, item.value.address,) #warn("EXPRESSION: %s" % exp) value = call(item.value, 'property("%s")' % propertyName) + value1 = value["d"] + #warn(" CODE: %s" % value1["type"]) + # Type 1 and 2 are bool and int. Try to save a few cycles in this case: + if int(value1["type"]) > 2: + # Poke back value + gdb.execute("set $d.d.data.ull = %s" % value1["data"]["ull"]) + gdb.execute("set $d.d.type = %s" % value1["type"]) + gdb.execute("set $d.d.is_null = %s" % value1["is_null"]) + value = parseAndEvaluate("$d").dereference() val, inner, innert = qdumpHelper__QVariant(d, value) if len(inner): # Build-in types. -- cgit v1.2.1