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

This commit is contained in:
hjk
2010-11-18 19:15:39 +01:00
parent 01592d60d6
commit de3bf34e85

View File

@@ -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)