Commit 4cd90ff0 authored by hjk's avatar hjk
Browse files

debugger: fix qvariant dumper for custom types

parent 6bf46c19
......@@ -1603,14 +1603,9 @@ def qdump__QVariant(d, item):
inner = d.ns + "QVector4D"
elif variantType == 86: # QVariant::Quadernion
inner = d.ns + "QQuadernion"
else:
# FIXME: handle User types
d.putValue("(unknown type %d)" % variantType)
# typeName = QMetaType::typeName(typ)
# exp = "'qVariantValue<%s >'(*('"NS"QVariant'*)%p)"
d.putNumChild(0)
if len(inner):
# Build-in types.
if len(innert) == 0:
innert = inner
d.putValue("(%s)" % innert)
......@@ -1625,6 +1620,21 @@ def qdump__QVariant(d, item):
d.putItemHelper(Item(val, item.iname, "data", "data"))
d.endHash()
d.endChildren()
else:
# User types.
func = "typeToName(('%sQVariant::Type')%d)" % (d.ns, variantType)
type = str(call(item.value, func))
type = type[type.find('"') + 1 : type.rfind('"')]
type = type.replace("Q", d.ns + "Q") # HACK!
data = call(item.value, "constData()")
tdata = data.cast(gdb.lookup_type(type).pointer()).dereference()
d.putValue("(%s)" % tdata.type)
d.putType(tdata.type)
d.putNumChild(1)
if d.isExpanded(item):
d.beginChildren()
d.putItem(Item(tdata, item.iname, "data", "data"))
d.endChildren()
def qdump__QVector(d, item):
......
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