forked from qt-creator/qt-creator
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: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -963,20 +963,6 @@ class DumperBase:
|
|||||||
|
|
||||||
return False
|
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):
|
def putSimpleCharArray(self, base, size = None):
|
||||||
if size is None:
|
if size is None:
|
||||||
elided, shown, data = self.readToFirstZero(base, 1, self.displayStringLimit)
|
elided, shown, data = self.readToFirstZero(base, 1, self.displayStringLimit)
|
||||||
@@ -1480,17 +1466,24 @@ class DumperBase:
|
|||||||
displayFormat = self.typeformats.get(needle, AutomaticFormat)
|
displayFormat = self.typeformats.get(needle, AutomaticFormat)
|
||||||
return displayFormat
|
return displayFormat
|
||||||
|
|
||||||
def putArrayData(self, base, n, innerType = None,
|
def putArrayData(self, base, n, innerType,
|
||||||
childNumChild = None, maxNumChild = 10000):
|
childNumChild = None, maxNumChild = 10000):
|
||||||
if innerType is None:
|
addrBase = toInteger(base)
|
||||||
innerType = base.dereference().type
|
innerSize = innerType.sizeof
|
||||||
if not self.tryPutArrayContents(base, n, innerType):
|
enc = self.simpleEncoding(innerType)
|
||||||
base = self.createPointerValue(base, 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,
|
with Children(self, n, innerType, childNumChild, maxNumChild,
|
||||||
base, innerType.sizeof):
|
addrBase=addrBase, addrStep=innerSize):
|
||||||
for i in self.childRange():
|
for i in self.childRange():
|
||||||
i = toInteger(i)
|
self.putSubItem(i, self.createValue(addrBase + i * innerSize, innerType))
|
||||||
self.putSubItem(i, (base + i).dereference())
|
|
||||||
|
|
||||||
def putArrayItem(self, name, addr, n, typeName):
|
def putArrayItem(self, name, addr, n, typeName):
|
||||||
with SubItem(self, name):
|
with SubItem(self, name):
|
||||||
|
Reference in New Issue
Block a user