Commit a45bfdc4 authored by hjk's avatar hjk
Browse files

debugger: improve QVariant(QString) dumper

(partially cherry picked from commit dd714e9c)
parent 69c84c9c
...@@ -838,7 +838,7 @@ class FrameCommand(gdb.Command): ...@@ -838,7 +838,7 @@ class FrameCommand(gdb.Command):
d.typeformats = typeformats d.typeformats = typeformats
d.formats = formats d.formats = formats
d.useFancy = useFancy d.useFancy = useFancy
d.passExceptions = "passexceptions" in options d.passExceptions = "pe" in options
d.autoDerefPointers = "autoderef" in options d.autoDerefPointers = "autoderef" in options
d.ns = qtNamespace() d.ns = qtNamespace()
d.expandedINames = expandedINames d.expandedINames = expandedINames
......
...@@ -1453,9 +1453,9 @@ def qdump__QUrl(d, item): ...@@ -1453,9 +1453,9 @@ def qdump__QUrl(d, item):
def qdumpHelper__QVariant(d, value): def qdumpHelper__QVariant(d, value):
#warn("VARIANT TYPE: %s : " % variantType)
data = value["d"]["data"] data = value["d"]["data"]
variantType = int(value["d"]["type"]) variantType = int(value["d"]["type"])
#warn("VARIANT TYPE: %s : " % variantType)
val = None val = None
inner = "" inner = ""
innert = "" innert = ""
...@@ -1597,15 +1597,18 @@ def qdumpHelper__QVariant(d, value): ...@@ -1597,15 +1597,18 @@ def qdumpHelper__QVariant(d, value):
def qdump__QVariant(d, item): def qdump__QVariant(d, item):
val, inner, innert = qdumpHelper__QVariant(d, item.value) val, inner, innert = qdumpHelper__QVariant(d, item.value)
#warn("VARIANT DATA: '%s' '%s' '%s': " % (val, inner, innert))
if len(inner): if len(inner):
# Build-in types. innerType = gdb.lookup_type(inner)
#d.putValue("(%s)" % innert) # FIXME: Why "shared"?
d.putType("%sQVariant (%s)" % (d.ns, innert)) if innerType.sizeof > item.value["d"]["data"].type.sizeof:
d.putNumChild(1) v = item.value["d"]["data"]["shared"]["ptr"] \
if d.isExpanded(item): .cast(innerType.pointer()).dereference()
with Children(d): else:
d.putItem(Item(val, item.iname, "data", "data")) v = item.value["d"]["data"].cast(innerType)
d.putItemHelper(Item(v, item.iname))
d.putType("%sQVariant (%s)" % (d.ns, innert), d.currentTypePriority + 1)
else: else:
# User types. # User types.
d_member = item.value["d"] d_member = item.value["d"]
......
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