Commit f7d794dc authored by hjk's avatar hjk
Browse files

Debugger: Next attempt at robust array dumping



In the fallback case now really go back to explicit object-at-address
construction. LLDB on Linux doesn't seem to like implicit pointer
arithmetics.

Change-Id: I3be6b0b21b35b9b9141440d4a11e9e889bb2f4bb
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent c9cce0b5
......@@ -963,20 +963,6 @@ class DumperBase:
return False
def tryPutArrayContents(self, base, n, innerType):
enc = self.simpleEncoding(innerType)
if not enc:
return False
size = n * innerType.sizeof;
self.put('childtype="%s",' % innerType)
self.put('addrbase="0x%x",' % toInteger(base))
self.put('addrstep="0x%x",' % toInteger(innerType.sizeof))
self.put('arrayencoding="%s",' % enc)
self.put('arraydata="')
self.put(self.readMemory(base, size))
self.put('",')
return True
def putSimpleCharArray(self, base, size = None):
if size is None:
elided, shown, data = self.readToFirstZero(base, 1, self.displayStringLimit)
......@@ -1480,17 +1466,24 @@ class DumperBase:
displayFormat = self.typeformats.get(needle, AutomaticFormat)
return displayFormat
def putArrayData(self, base, n, innerType = None,
def putArrayData(self, base, n, innerType,
childNumChild = None, maxNumChild = 10000):
if innerType is None:
innerType = base.dereference().type
if not self.tryPutArrayContents(base, n, innerType):
base = self.createPointerValue(base, innerType)
addrBase = toInteger(base)
innerSize = innerType.sizeof
enc = self.simpleEncoding(innerType)
if enc:
self.put('childtype="%s",' % innerType)
self.put('addrbase="0x%x",' % addrBase)
self.put('addrstep="0x%x",' % innerSize)
self.put('arrayencoding="%s",' % enc)
self.put('arraydata="')
self.put(self.readMemory(addrBase, n * innerSize))
self.put('",')
else:
with Children(self, n, innerType, childNumChild, maxNumChild,
base, innerType.sizeof):
addrBase=addrBase, addrStep=innerSize):
for i in self.childRange():
i = toInteger(i)
self.putSubItem(i, (base + i).dereference())
self.putSubItem(i, self.createValue(addrBase + i * innerSize, innerType))
def putArrayItem(self, name, addr, n, typeName):
with SubItem(self, name):
......
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