From 3a7ce3f5be9af510634ae018e27d3b1a2970063a Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 12 Apr 2016 11:43:13 +0200 Subject: [PATCH] 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 --- share/qtcreator/debugger/dumper.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index a4f25df85c9..cad3bed4340 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -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): """