Debugger: Add Core::Id python dumper for cdb

Change-Id: Id89f730e90586659ce76e685c014655178957222
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2017-01-31 15:30:35 +01:00
parent 2a0f70fd75
commit fcdcc4c7f8
2 changed files with 12 additions and 8 deletions

View File

@@ -461,5 +461,9 @@ class Dumper(DumperBase):
def callHelper(self, rettype, value, function, args): def callHelper(self, rettype, value, function, args):
raise Exception("cdb does not support calling functions") raise Exception("cdb does not support calling functions")
def nameForCoreId(self, id):
idName = cdbext.call('Cored4!Core::nameForId(%d)' % id)
return self.fromNativeValue(idName)
def putCallItem(self, name, rettype, value, func, *args): def putCallItem(self, name, rettype, value, func, *args):
return return

View File

@@ -89,15 +89,15 @@ def dumpLiteral(d, value):
d.putValue(d.hexencode(readLiteral(d, value)), "latin1") d.putValue(d.hexencode(readLiteral(d, value)), "latin1")
def qdump__Core__Id(d, value): def qdump__Core__Id(d, value):
if d.isMsvcTarget(): val = value.extractPointer()
d.putValue(value.extractPointer()) if True:
if d.isMsvcTarget():
name = d.nameForCoreId(val).address()
else:
name = d.parseAndEvaluate("Core::nameForId(0x%x)" % val).pointer()
d.putSimpleCharArray(name)
else: else:
val = value.extractPointer() d.putValue(val)
try:
name = d.parseAndEvaluate("Core::nameForId(0x%x)" % val)
d.putSimpleCharArray(name.pointer())
except:
d.putValue(val)
d.putPlainChildren(value) d.putPlainChildren(value)
def qdump__Debugger__Internal__GdbMi(d, value): def qdump__Debugger__Internal__GdbMi(d, value):