Commit e3886aaf authored by hjk's avatar hjk
Browse files

debugger: display array base address as default value

parent 38537d86
......@@ -1578,6 +1578,22 @@ class Dumper:
self.putNumChild(0)
return
if value.type.code == gdb.TYPE_CODE_ARRAY:
self.putType(realtype)
self.putNumChild(1)
baseptr = value.cast(realtype.pointer())
self.putValue("%s" % baseptr)
if self.isExpanded(item):
charptr = lookupType("unsigned char").pointer()
addr1 = (baseptr+1).cast(charptr)
addr0 = baseptr.cast(charptr)
self.put('addrbase="%s",' % cleanAddress(addr0))
self.put('addrstep="%s",' % (addr1 - addr0))
with Children(self, 1, realtype.target()):
child = Item(value, item.iname, None, item.name)
self.putFields(child)
return
typedefStrippedType = stripTypedefs(type)
if isSimpleType(typedefStrippedType):
......@@ -1747,15 +1763,8 @@ class Dumper:
numfields = len(fields)
self.putNumChild(numfields)
if self.isExpanded(item):
if value.type.code == gdb.TYPE_CODE_ARRAY:
baseptr = value.cast(value.type.target().pointer())
charptr = lookupType("unsigned char").pointer()
addr1 = (baseptr+1).cast(charptr)
addr0 = baseptr.cast(charptr)
self.put('addrbase="%s",' % cleanAddress(addr0))
self.put('addrstep="%s",' % (addr1 - addr0))
if self.isExpanded(item):
innerType = None
if len(fields) == 1 and fields[0].name is None:
innerType = value.type.target()
......
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