diff --git a/share/qtcreator/gdbmacros/dumper.py b/share/qtcreator/gdbmacros/dumper.py index 4d7ef4553a8..b60b5df341b 100644 --- a/share/qtcreator/gdbmacros/dumper.py +++ b/share/qtcreator/gdbmacros/dumper.py @@ -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) diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py index b3b284e4bdd..e3574f5325a 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.py +++ b/share/qtcreator/gdbmacros/gdbmacros.py @@ -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]):