summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2010-08-20 14:58:55 +0200
committerhjk <qtc-committer@nokia.com>2010-08-20 15:18:40 +0200
commitcff7191064b9e496121ea23f76873d56bddca3d0 (patch)
tree67c80406bb20933e267e4f1d7844b5b110de052c
parent925d9edaa162f562464c9b433d0bc66a1f525991 (diff)
downloadqt-creator-cff7191064b9e496121ea23f76873d56bddca3d0.tar.gz
debugger: and another fix for QObject property dumper
-rw-r--r--share/qtcreator/gdbmacros/gdbmacros.py16
1 files changed, 15 insertions, 1 deletions
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.