Debugger: Call putNumChild from putItemCount

Reduces user side code

Change-Id: I4e6186e4af2b62983e1d14796c88654649fcda21
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hjk
2014-05-06 15:20:36 +02:00
parent 26ac5adc1d
commit ee3d6eba05
4 changed files with 1 additions and 33 deletions

View File

@@ -34,7 +34,6 @@ def qdump__boost__bimaps__bimap(d, value):
#rightType = d.templateArgument(value.type, 1) #rightType = d.templateArgument(value.type, 1)
size = int(value["core"]["node_count"]) size = int(value["core"]["node_count"])
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
d.putPlainChildren(value) d.putPlainChildren(value)
@@ -99,7 +98,6 @@ def qdump__boost__container__list(d, value):
r = value["members_"]["m_icont"]["data_"]["root_plus_size_"] r = value["members_"]["m_icont"]["data_"]["root_plus_size_"]
n = toInteger(r["size_"]) n = toInteger(r["size_"])
d.putItemCount(n) d.putItemCount(n)
d.putNumChild(n)
if d.isExpanded(): if d.isExpanded():
innerType = d.templateArgument(value.type, 0) innerType = d.templateArgument(value.type, 0)
offset = 2 * d.ptrSize() offset = 2 * d.ptrSize()

View File

@@ -646,6 +646,7 @@ class DumperBase:
self.putValue('<>%s items>' % maximum) self.putValue('<>%s items>' % maximum)
else: else:
self.putValue('<%s items>' % count) self.putValue('<%s items>' % count)
self.putNumChild(count)
def putField(self, name, value): def putField(self, name, value):
self.put('%s="%s",' % (name, value)) self.put('%s="%s",' % (name, value))
@@ -859,7 +860,6 @@ class DumperBase:
n = (10, 100, 1000, 10000)[format - Array10Format] n = (10, 100, 1000, 10000)[format - Array10Format]
self.putType(typeName) self.putType(typeName)
self.putItemCount(n) self.putItemCount(n)
self.putNumChild(n)
self.putArrayData(value, n, innerType) self.putArrayData(value, n, innerType)
return return
@@ -1149,7 +1149,6 @@ class DumperBase:
with SubItem(self, "[methods]"): with SubItem(self, "[methods]"):
methodCount = self.staticQObjectMethodCount(smo) methodCount = self.staticQObjectMethodCount(smo)
self.putItemCount(methodCount) self.putItemCount(methodCount)
self.putNumChild(methodCount)
if self.isExpanded(): if self.isExpanded():
methodNames = self.staticQObjectMethodNames(smo) methodNames = self.staticQObjectMethodNames(smo)
with Children(self): with Children(self):
@@ -1161,7 +1160,6 @@ class DumperBase:
with SubItem(self, "[signals]"): with SubItem(self, "[signals]"):
signalCount = self.staticQObjectSignalCount(smo) signalCount = self.staticQObjectSignalCount(smo)
self.putItemCount(signalCount) self.putItemCount(signalCount)
self.putNumChild(signalCount)
if self.isExpanded(): if self.isExpanded():
signalNames = self.staticQObjectSignalNames(smo) signalNames = self.staticQObjectSignalNames(smo)
signalCount = len(signalNames) signalCount = len(signalNames)
@@ -1184,7 +1182,6 @@ class DumperBase:
connections = d_ptr["connectionLists"] connections = d_ptr["connectionLists"]
if self.isNull(connections): if self.isNull(connections):
self.putItemCount(0) self.putItemCount(0)
self.putNumChild(0)
else: else:
connections = connections.dereference() connections = connections.dereference()
connections = connections.cast(self.directBaseClass(connections.type)) connections = connections.cast(self.directBaseClass(connections.type))
@@ -1311,7 +1308,6 @@ class DumperBase:
self.put('iname="local.argv",name="argv",') self.put('iname="local.argv",name="argv",')
self.putItemCount(n, 100) self.putItemCount(n, 100)
self.putType('char **') self.putType('char **')
self.putNumChild(n)
if self.currentIName in self.expandedINames: if self.currentIName in self.expandedINames:
p = value p = value
with Children(self, n): with Children(self, n):

View File

@@ -532,7 +532,6 @@ def qdump__QFiniteStack(d, value):
size = int(value["_size"]) size = int(value["_size"])
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000) d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
d.putPlotData(value["_array"], size, d.templateArgument(value.type, 0)) d.putPlotData(value["_array"], size, d.templateArgument(value.type, 0))
@@ -613,7 +612,6 @@ def qdump__QHash(d, value):
d.checkRef(d_ptr["ref"]) d.checkRef(d_ptr["ref"])
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
numBuckets = int(d_ptr.dereference()["numBuckets"]) numBuckets = int(d_ptr.dereference()["numBuckets"])
innerType = e_ptr.dereference().type innerType = e_ptr.dereference().type
@@ -769,7 +767,6 @@ def qdump__QList(d, value):
innerType = d.templateArgument(value.type, 0) innerType = d.templateArgument(value.type, 0)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
innerSize = innerType.sizeof innerSize = innerType.sizeof
stepSize = d.ptrSize() stepSize = d.ptrSize()
@@ -873,7 +870,6 @@ def qdump__QLinkedList(d, value):
d.check(0 <= n and n <= 100*1000*1000) d.check(0 <= n and n <= 100*1000*1000)
d.check(-1 <= ref and ref <= 1000) d.check(-1 <= ref and ref <= 1000)
d.putItemCount(n) d.putItemCount(n)
d.putNumChild(n)
if d.isExpanded(): if d.isExpanded():
innerType = d.templateArgument(value.type, 0) innerType = d.templateArgument(value.type, 0)
with Children(d, n, maxNumChild=1000, childType=innerType): with Children(d, n, maxNumChild=1000, childType=innerType):
@@ -946,7 +942,6 @@ def qdumpHelper__Qt4_QMap(d, value):
d.checkRef(d_ptr["ref"]) d.checkRef(d_ptr["ref"])
d.putItemCount(n) d.putItemCount(n)
d.putNumChild(n)
if d.isExpanded(): if d.isExpanded():
if n > 10000: if n > 10000:
n = 10000 n = 10000
@@ -989,7 +984,6 @@ def qdumpHelper__Qt5_QMap(d, value):
d.checkRef(d_ptr["ref"]) d.checkRef(d_ptr["ref"])
d.putItemCount(n) d.putItemCount(n)
d.putNumChild(n)
if d.isExpanded(): if d.isExpanded():
if n > 10000: if n > 10000:
n = 10000 n = 10000
@@ -1257,7 +1251,6 @@ def _qdump__QObject(d, value):
d.putNoType() d.putNoType()
d.putItemCount(dynamicPropertyCount) d.putItemCount(dynamicPropertyCount)
d.putNumChild(dynamicPropertyCount)
if d.isExpanded() and d.isGdb: if d.isExpanded() and d.isGdb:
import gdb import gdb
@@ -1302,7 +1295,6 @@ def _qdump__QObject(d, value):
if not d.isNull(connections): if not d.isNull(connections):
connectionListCount = connections["d"]["size"] connectionListCount = connections["d"]["size"]
d.putItemCount(connectionListCount, 0) d.putItemCount(connectionListCount, 0)
d.putNumChild(connectionListCount)
if d.isExpanded(): if d.isExpanded():
pp = 0 pp = 0
with Children(d): with Children(d):
@@ -1582,7 +1574,6 @@ def qdump__QRegion(d, value):
pp = d.extractPointer(p) pp = d.extractPointer(p)
n = d.extractInt(pp) n = d.extractInt(pp)
d.putItemCount(n) d.putItemCount(n)
d.putNumChild(n)
if d.isExpanded(): if d.isExpanded():
with Children(d): with Children(d):
v = d.ptrSize() v = d.ptrSize()
@@ -1647,7 +1638,6 @@ def qdump__QSet(d, value):
d.checkRef(d_ptr["ref"]) d.checkRef(d_ptr["ref"])
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
hashDataType = d_ptr.type hashDataType = d_ptr.type
nodeTypePtr = d_ptr.dereference()["fakeNext"].type nodeTypePtr = d_ptr.dereference()["fakeNext"].type
@@ -2169,7 +2159,6 @@ def qdump__QVector(d, value):
data, size, alloc = d.vectorDataHelper(d.extractPointer(value)) data, size, alloc = d.vectorDataHelper(d.extractPointer(value))
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000) d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
d.putPlotData(data, size, d.templateArgument(value.type, 0)) d.putPlotData(data, size, d.templateArgument(value.type, 0))

View File

@@ -35,7 +35,6 @@ def qform__std__array():
def qdump__std__array(d, value): def qdump__std__array(d, value):
size = d.numericTemplateArgument(value.type, 1) size = d.numericTemplateArgument(value.type, 1)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
d.putPlotData(d.addressOf(value), size, d.templateArgument(value.type, 0)) d.putPlotData(d.addressOf(value), size, d.templateArgument(value.type, 0))
@@ -79,7 +78,6 @@ def qdump__std__deque(d, value):
d.check(0 <= size and size <= 1000 * 1000 * 1000) d.check(0 <= size and size <= 1000 * 1000 * 1000)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
with Children(d, size, maxNumChild=2000, childType=innerType): with Children(d, size, maxNumChild=2000, childType=innerType):
pcur = start["_M_cur"] pcur = start["_M_cur"]
@@ -116,7 +114,6 @@ def qdump__std__deque__QNX(d, value):
d.check(0 <= mapsize and mapsize <= 1000 * 1000 * 1000) d.check(0 <= mapsize and mapsize <= 1000 * 1000 * 1000)
d.putItemCount(mysize) d.putItemCount(mysize)
d.putNumChild(mysize)
if d.isExpanded(): if d.isExpanded():
with Children(d, mysize, maxNumChild=2000, childType=innerType): with Children(d, mysize, maxNumChild=2000, childType=innerType):
map = value['_Map'] map = value['_Map']
@@ -147,7 +144,6 @@ def qdump__std__list(d, value):
pp = d.extractPointer(pp) pp = d.extractPointer(pp)
d.putItemCount(size, 1000) d.putItemCount(size, 1000)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
p = node["_M_next"] p = node["_M_next"]
@@ -163,7 +159,6 @@ def qdump__std__list__QNX(d, value):
size = value["_Mysize"] size = value["_Mysize"]
d.putItemCount(size, 1000) d.putItemCount(size, 1000)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
p = node["_Next"] p = node["_Next"]
@@ -188,7 +183,6 @@ def qdump__std__map(d, value):
size = int(impl["_M_node_count"]) size = int(impl["_M_node_count"])
d.check(0 <= size and size <= 100*1000*1000) d.check(0 <= size and size <= 100*1000*1000)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
pairType = d.templateArgument(d.templateArgument(value.type, 3), 0) pairType = d.templateArgument(d.templateArgument(value.type, 3), 0)
@@ -215,7 +209,6 @@ def qdump__std__map__QNX(d, value):
size = value['_Mysize'] size = value['_Mysize']
d.check(0 <= size and size <= 100*1000*1000) d.check(0 <= size and size <= 100*1000*1000)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
keyType = d.templateArgument(value.type, 0) keyType = d.templateArgument(value.type, 0)
@@ -338,7 +331,6 @@ def qdump__std__set(d, value):
size = int(impl["_M_node_count"]) size = int(impl["_M_node_count"])
d.check(0 <= size and size <= 100*1000*1000) d.check(0 <= size and size <= 100*1000*1000)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
valueType = d.templateArgument(value.type, 0) valueType = d.templateArgument(value.type, 0)
node = impl["_M_header"]["_M_left"] node = impl["_M_header"]["_M_left"]
@@ -361,7 +353,6 @@ def qdump__std__set__QNX(d, value):
size = value['_Mysize'] size = value['_Mysize']
d.check(0 <= size and size <= 100*1000*1000) d.check(0 <= size and size <= 100*1000*1000)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
valueType = d.templateArgument(value.type, 0) valueType = d.templateArgument(value.type, 0)
head = value['_Myhead'] head = value['_Myhead']
@@ -588,7 +579,6 @@ def qdump__std__unordered_map(d, value):
d.putNumChild(0) d.putNumChild(0)
return return
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
p = d.pointerValue(start) p = d.pointerValue(start)
if d.isMapCompact(keyType, valueType): if d.isMapCompact(keyType, valueType):
@@ -627,7 +617,6 @@ def qdump__std__unordered_set(d, value):
start = value["_M_buckets"].dereference() start = value["_M_buckets"].dereference()
offset = d.ptrSize() offset = d.ptrSize()
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
p = d.pointerValue(start) p = d.pointerValue(start)
valueType = d.templateArgument(value.type, 0) valueType = d.templateArgument(value.type, 0)
@@ -714,7 +703,6 @@ def qdump__std__vector(d, value):
d.checkPointer(alloc) d.checkPointer(alloc)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
if isBool: if isBool:
with Children(d, size, maxNumChild=10000, childType=type): with Children(d, size, maxNumChild=10000, childType=type):
@@ -749,7 +737,6 @@ def qdump__std__vector__QNX(d, value):
d.checkPointer(end) d.checkPointer(end)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
if isBool: if isBool:
with Children(d, size, maxNumChild=10000, childType=innerType): with Children(d, size, maxNumChild=10000, childType=innerType):
@@ -772,7 +759,6 @@ def qdump__std____1__vector(d, value):
size = (end - begin) / innerType.sizeof size = (end - begin) / innerType.sizeof
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded(): if d.isExpanded():
d.putPlotData(begin, size, innerType) d.putPlotData(begin, size, innerType)
@@ -819,7 +805,6 @@ def qdump____gnu_cxx__hash_set(d, value):
size = int(ht["_M_num_elements"]) size = int(ht["_M_num_elements"])
d.check(0 <= size and size <= 1000 * 1000 * 1000) d.check(0 <= size and size <= 1000 * 1000 * 1000)
d.putItemCount(size) d.putItemCount(size)
d.putNumChild(size)
type = d.templateArgument(value.type, 0) type = d.templateArgument(value.type, 0)
d.putType("__gnu__cxx::hash_set<%s>" % type) d.putType("__gnu__cxx::hash_set<%s>" % type)
if d.isExpanded(): if d.isExpanded():