Commit de3bf34e authored by hjk's avatar hjk
Browse files

debugger: show len/ptr pair encoded strings for sources ending in .d

parent 01592d60
......@@ -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)
......
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