From de3bf34e8515300fa165e1bb5f4ba599ea80f298 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 18 Nov 2010 19:15:39 +0100 Subject: [PATCH] debugger: show len/ptr pair encoded strings for sources ending in .d --- share/qtcreator/gdbmacros/dumper.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/gdbmacros/dumper.py b/share/qtcreator/gdbmacros/dumper.py index 3c1227db575..2f5aeb2222b 100644 --- a/share/qtcreator/gdbmacros/dumper.py +++ b/share/qtcreator/gdbmacros/dumper.py @@ -1091,6 +1091,10 @@ class Dumper: self.partialUpdate = "partial" in options #self.ns = qqNs self.ns = qtNamespace() + try: + self.alienSource = catchCliOutput("info source")[0][-3:-1]==".d" + except: + self.alienSource = False #warn("NAMESPACE: '%s'" % self.ns) #warn("VARIABLES: %s" % varList) @@ -1472,7 +1476,21 @@ class Dumper: value = item.value type = value.type - if type.code == gdb.TYPE_CODE_INT or type.code == gdb.TYPE_CODE_CHAR: + if type.code == gdb.TYPE_CODE_INT: + if self.alienSource and str(type) == "unsigned long long": + strlen = value % (1L<<32) + strptr = value / (1L<<32) + self.putType("string") + self.putAddress(value.address) + self.putValue(encodeCharArray(strptr, 100, strlen), Hex2EncodedLatin1) + self.putNumChild(0) + return + self.putType(realtype) + self.putValue(int(value)) + self.putNumChild(0) + return + + if type.code == gdb.TYPE_CODE_CHAR: self.putType(realtype) self.putValue(int(value)) self.putNumChild(0)