Debugger: Restrict array dumping to 1 mio elements by default

Individual dumpers can override. User accessible gui to be done...

Change-Id: Idf81dab11f810b43fc6721cbb37d12a1365a8634
Task-number: QTCREATORBUG-16021
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-04-12 11:43:13 +02:00
parent c9b9be7e19
commit 3a7ce3f5be

View File

@@ -1558,6 +1558,9 @@ class DumperBase:
self.put('addrbase="0x%x",' % addrBase)
self.put('addrstep="0x%x",' % innerSize)
self.put('arrayencoding="%s",' % enc)
if n > maxNumChild:
self.put('childrenelided="%s",' % n) # FIXME: Act on that in frontend
n = maxNumChild
self.put('arraydata="')
self.put(self.readMemory(addrBase, n * innerSize))
self.put('",')
@@ -1574,7 +1577,10 @@ class DumperBase:
self.putArrayData(addr, n, self.lookupType(typeName))
self.putAddress(addr)
def putPlotDataHelper(self, base, n, innerType):
def putPlotDataHelper(self, base, n, innerType, maxNumChild = 1000*1000):
if n > maxNumChild:
self.put('plotelided="%s",' % n) # FIXME: Act on that in frontend
n = maxNumChild
if self.currentItemFormat() == ArrayPlotFormat and self.isSimpleType(innerType):
enc = self.simpleEncoding(innerType)
if enc:
@@ -1582,10 +1588,10 @@ class DumperBase:
self.putField("editvalue", self.readMemory(base, n * innerType.sizeof))
self.putField("editformat", DisplayPlotData)
def putPlotData(self, base, n, innerType):
self.putPlotDataHelper(base, n, innerType)
def putPlotData(self, base, n, innerType, maxNumChild = 1000*1000):
self.putPlotDataHelper(base, n, innerType, maxNumChild=maxNumChild)
if self.isExpanded():
self.putArrayData(base, n, innerType)
self.putArrayData(base, n, innerType, maxNumChild=maxNumChild)
def putSpecialArgv(self, value):
"""