Commit 44d87bf8 authored by Friedemann Kleint's avatar Friedemann Kleint

Debugger [gdb/win]: Use calloc instead of malloc for QObject-properties

Avoid symbol clash with QVector::malloc.
Display at least property count.

Reviewed-by: hjk
parent 36709fd2
......@@ -693,7 +693,8 @@ def makeValue(type, init):
type = stripClassTag(type)
if type.find(":") >= 0:
type = "'" + type + "'"
gdb.execute("set $d = (%s*)malloc(sizeof(%s))" % (type, type))
# Avoid malloc symbol clash with QVector
gdb.execute("set $d = (%s*)calloc(sizeof(%s), 1)" % (type, type))
gdb.execute("set *$d = {%s}" % init)
value = parseAndEvaluate("$d").dereference()
#warn(" TYPE: %s" % value.type)
......
......@@ -723,7 +723,8 @@ def qdump__QObject(d, item):
if d.isExpandedIName(item.iname + ".properties"):
# FIXME: Make this global. Don't leak.
variant = "'%sQVariant'" % d.ns
gdb.execute("set $d = (%s*)malloc(sizeof(%s))" % (variant, variant))
# Avoid malloc symbol clash with QVector
gdb.execute("set $d = (%s*)calloc(sizeof(%s), 1)" % (variant, variant))
gdb.execute("set $d.d.is_shared = 0")
with Children(d, [propertyCount, 500]):
......
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