Commit ee3d6eba authored by hjk's avatar hjk
Browse files

Debugger: Call putNumChild from putItemCount



Reduces user side code

Change-Id: I4e6186e4af2b62983e1d14796c88654649fcda21
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 26ac5adc
......@@ -34,7 +34,6 @@ def qdump__boost__bimaps__bimap(d, value):
#rightType = d.templateArgument(value.type, 1)
size = int(value["core"]["node_count"])
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
d.putPlainChildren(value)
......@@ -99,7 +98,6 @@ def qdump__boost__container__list(d, value):
r = value["members_"]["m_icont"]["data_"]["root_plus_size_"]
n = toInteger(r["size_"])
d.putItemCount(n)
d.putNumChild(n)
if d.isExpanded():
innerType = d.templateArgument(value.type, 0)
offset = 2 * d.ptrSize()
......
......@@ -646,6 +646,7 @@ class DumperBase:
self.putValue('<>%s items>' % maximum)
else:
self.putValue('<%s items>' % count)
self.putNumChild(count)
def putField(self, name, value):
self.put('%s="%s",' % (name, value))
......@@ -859,7 +860,6 @@ class DumperBase:
n = (10, 100, 1000, 10000)[format - Array10Format]
self.putType(typeName)
self.putItemCount(n)
self.putNumChild(n)
self.putArrayData(value, n, innerType)
return
......@@ -1149,7 +1149,6 @@ class DumperBase:
with SubItem(self, "[methods]"):
methodCount = self.staticQObjectMethodCount(smo)
self.putItemCount(methodCount)
self.putNumChild(methodCount)
if self.isExpanded():
methodNames = self.staticQObjectMethodNames(smo)
with Children(self):
......@@ -1161,7 +1160,6 @@ class DumperBase:
with SubItem(self, "[signals]"):
signalCount = self.staticQObjectSignalCount(smo)
self.putItemCount(signalCount)
self.putNumChild(signalCount)
if self.isExpanded():
signalNames = self.staticQObjectSignalNames(smo)
signalCount = len(signalNames)
......@@ -1184,7 +1182,6 @@ class DumperBase:
connections = d_ptr["connectionLists"]
if self.isNull(connections):
self.putItemCount(0)
self.putNumChild(0)
else:
connections = connections.dereference()
connections = connections.cast(self.directBaseClass(connections.type))
......@@ -1311,7 +1308,6 @@ class DumperBase:
self.put('iname="local.argv",name="argv",')
self.putItemCount(n, 100)
self.putType('char **')
self.putNumChild(n)
if self.currentIName in self.expandedINames:
p = value
with Children(self, n):
......
......@@ -532,7 +532,6 @@ def qdump__QFiniteStack(d, value):
size = int(value["_size"])
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000)
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
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.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
numBuckets = int(d_ptr.dereference()["numBuckets"])
innerType = e_ptr.dereference().type
......@@ -769,7 +767,6 @@ def qdump__QList(d, value):
innerType = d.templateArgument(value.type, 0)
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
innerSize = innerType.sizeof
stepSize = d.ptrSize()
......@@ -873,7 +870,6 @@ def qdump__QLinkedList(d, value):
d.check(0 <= n and n <= 100*1000*1000)
d.check(-1 <= ref and ref <= 1000)
d.putItemCount(n)
d.putNumChild(n)
if d.isExpanded():
innerType = d.templateArgument(value.type, 0)
with Children(d, n, maxNumChild=1000, childType=innerType):
......@@ -946,7 +942,6 @@ def qdumpHelper__Qt4_QMap(d, value):
d.checkRef(d_ptr["ref"])
d.putItemCount(n)
d.putNumChild(n)
if d.isExpanded():
if n > 10000:
n = 10000
......@@ -989,7 +984,6 @@ def qdumpHelper__Qt5_QMap(d, value):
d.checkRef(d_ptr["ref"])
d.putItemCount(n)
d.putNumChild(n)
if d.isExpanded():
if n > 10000:
n = 10000
......@@ -1257,7 +1251,6 @@ def _qdump__QObject(d, value):
d.putNoType()
d.putItemCount(dynamicPropertyCount)
d.putNumChild(dynamicPropertyCount)
if d.isExpanded() and d.isGdb:
import gdb
......@@ -1302,7 +1295,6 @@ def _qdump__QObject(d, value):
if not d.isNull(connections):
connectionListCount = connections["d"]["size"]
d.putItemCount(connectionListCount, 0)
d.putNumChild(connectionListCount)
if d.isExpanded():
pp = 0
with Children(d):
......@@ -1582,7 +1574,6 @@ def qdump__QRegion(d, value):
pp = d.extractPointer(p)
n = d.extractInt(pp)
d.putItemCount(n)
d.putNumChild(n)
if d.isExpanded():
with Children(d):
v = d.ptrSize()
......@@ -1647,7 +1638,6 @@ def qdump__QSet(d, value):
d.checkRef(d_ptr["ref"])
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
hashDataType = d_ptr.type
nodeTypePtr = d_ptr.dereference()["fakeNext"].type
......@@ -2169,7 +2159,6 @@ def qdump__QVector(d, value):
data, size, alloc = d.vectorDataHelper(d.extractPointer(value))
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000)
d.putItemCount(size)
d.putNumChild(size)
d.putPlotData(data, size, d.templateArgument(value.type, 0))
......
......@@ -35,7 +35,6 @@ def qform__std__array():
def qdump__std__array(d, value):
size = d.numericTemplateArgument(value.type, 1)
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
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.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
with Children(d, size, maxNumChild=2000, childType=innerType):
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.putItemCount(mysize)
d.putNumChild(mysize)
if d.isExpanded():
with Children(d, mysize, maxNumChild=2000, childType=innerType):
map = value['_Map']
......@@ -147,7 +144,6 @@ def qdump__std__list(d, value):
pp = d.extractPointer(pp)
d.putItemCount(size, 1000)
d.putNumChild(size)
if d.isExpanded():
p = node["_M_next"]
......@@ -163,7 +159,6 @@ def qdump__std__list__QNX(d, value):
size = value["_Mysize"]
d.putItemCount(size, 1000)
d.putNumChild(size)
if d.isExpanded():
p = node["_Next"]
......@@ -188,7 +183,6 @@ def qdump__std__map(d, value):
size = int(impl["_M_node_count"])
d.check(0 <= size and size <= 100*1000*1000)
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
pairType = d.templateArgument(d.templateArgument(value.type, 3), 0)
......@@ -215,7 +209,6 @@ def qdump__std__map__QNX(d, value):
size = value['_Mysize']
d.check(0 <= size and size <= 100*1000*1000)
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
keyType = d.templateArgument(value.type, 0)
......@@ -338,7 +331,6 @@ def qdump__std__set(d, value):
size = int(impl["_M_node_count"])
d.check(0 <= size and size <= 100*1000*1000)
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
valueType = d.templateArgument(value.type, 0)
node = impl["_M_header"]["_M_left"]
......@@ -361,7 +353,6 @@ def qdump__std__set__QNX(d, value):
size = value['_Mysize']
d.check(0 <= size and size <= 100*1000*1000)
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
valueType = d.templateArgument(value.type, 0)
head = value['_Myhead']
......@@ -588,7 +579,6 @@ def qdump__std__unordered_map(d, value):
d.putNumChild(0)
return
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
p = d.pointerValue(start)
if d.isMapCompact(keyType, valueType):
......@@ -627,7 +617,6 @@ def qdump__std__unordered_set(d, value):
start = value["_M_buckets"].dereference()
offset = d.ptrSize()
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
p = d.pointerValue(start)
valueType = d.templateArgument(value.type, 0)
......@@ -714,7 +703,6 @@ def qdump__std__vector(d, value):
d.checkPointer(alloc)
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
if isBool:
with Children(d, size, maxNumChild=10000, childType=type):
......@@ -749,7 +737,6 @@ def qdump__std__vector__QNX(d, value):
d.checkPointer(end)
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
if isBool:
with Children(d, size, maxNumChild=10000, childType=innerType):
......@@ -772,7 +759,6 @@ def qdump__std____1__vector(d, value):
size = (end - begin) / innerType.sizeof
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
d.putPlotData(begin, size, innerType)
......@@ -819,7 +805,6 @@ def qdump____gnu_cxx__hash_set(d, value):
size = int(ht["_M_num_elements"])
d.check(0 <= size and size <= 1000 * 1000 * 1000)
d.putItemCount(size)
d.putNumChild(size)
type = d.templateArgument(value.type, 0)
d.putType("__gnu__cxx::hash_set<%s>" % type)
if d.isExpanded():
......
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