debugger: better handling of dynamic arrays

This commit is contained in:
hjk
2010-11-18 20:44:36 +01:00
parent c9c5fe1542
commit bffeae9b42

View File

@@ -1476,6 +1476,30 @@ class Dumper:
value = item.value
type = value.type
if type.code == gdb.TYPE_CODE_STRUCT and self.alienSource:
try:
# Check whether it's an array.
arraylen = value["length"]
arrayptr = value["ptr"]
self.putType(type)
self.putAddress(value.address)
if str(type) == "struct char[]":
self.putValue(encodeCharArray(arrayptr, 100, arraylen),
Hex2EncodedLatin1)
self.putNumChild(0)
else:
self.putNumChild(arraylen)
self.putItemCount(arraylen)
if self.isExpanded(item):
with Children(self):
for i in range(arraylen):
v = arrayptr.dereference()
self.putSubItem(Item(v, item.iname))
arrayptr += 1
return
except:
pass
if type.code == gdb.TYPE_CODE_INT:
if self.alienSource and str(type) == "unsigned long long":
strlen = value % (1L<<32)