Commit bffeae9b authored by hjk's avatar hjk
Browse files

debugger: better handling of dynamic arrays

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