Commit e6292d36 authored by hjk's avatar hjk
Browse files

Debugger: Better connection count display



Not a full fix yet. Disconnect does not reduce the count
since the Connection object remains in the structure,
only the receiver gets set to 0.

The connections are now listed as subitem of [signals]

Change-Id: I3dd795b3731b30e2af6f4d0e5da71dbde8996649
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 41582b19
...@@ -1156,8 +1156,11 @@ class DumperBase: ...@@ -1156,8 +1156,11 @@ class DumperBase:
k = signalNames[i] k = signalNames[i]
with SubItem(self, k): with SubItem(self, k):
self.putEmptyValue() self.putEmptyValue()
self.putQObjectConnections(qobject)
def putQObjectConnections(self, qobject):
with SubItem(self, "[connections]"): with SubItem(self, "[connections]"):
ptrSize = self.ptrSize()
self.putNoType() self.putNoType()
ns = self.qtNamespace() ns = self.qtNamespace()
privateTypeName = ns + "QObjectPrivate" privateTypeName = ns + "QObjectPrivate"
...@@ -1165,31 +1168,32 @@ class DumperBase: ...@@ -1165,31 +1168,32 @@ class DumperBase:
dd = qobject["d_ptr"]["d"] dd = qobject["d_ptr"]["d"]
d_ptr = dd.cast(privateType.pointer()).dereference() d_ptr = dd.cast(privateType.pointer()).dereference()
connections = d_ptr["connectionLists"] connections = d_ptr["connectionLists"]
connectionListCount = 0 if self.isNull(connections):
if not self.isNull(connections): self.putItemCount(0)
connectionListCount = connections["d"]["size"] self.putNumChild(0)
self.putItemCount(connectionListCount, 0) else:
self.putNumChild(connectionListCount) connections = connections.dereference()
connections = connections.cast(self.directBaseClass(connections.type))
self.putValue('<>0 items>')
self.putNumChild(1)
if self.isExpanded(): if self.isExpanded():
pp = 0 pp = 0
with Children(self): with Children(self):
vectorType = self.fieldAt(connections.type.target(), 0).type innerType = self.templateArgument(connections.type, 0)
innerType = self.templateArgument(vectorType, 0)
# Should check: innerType == ns::QObjectPrivate::ConnectionList # Should check: innerType == ns::QObjectPrivate::ConnectionList
base = self.extractPointer(connections.dereference()) base = self.extractPointer(connections)
data, size, alloc = self.vectorDataHelper(base) data, size, alloc = self.vectorDataHelper(base)
connectionType = self.lookupType(ns + "QObjectPrivate::Connection") connectionType = self.lookupType(ns + "QObjectPrivate::Connection")
for i in xrange(size): for i in xrange(size):
first = self.extractPointer(data + i * 2 * ptrSize) first = self.extractPointer(data + i * 2 * ptrSize)
while not self.isNull(first): while first:
self.putSubItem("%s" % pp, self.createPointerValue(first, connectionType)) self.putSubItem("%s" % pp,
self.createPointerValue(first, connectionType))
first = self.extractPointer(first + 3 * ptrSize) first = self.extractPointer(first + 3 * ptrSize)
# We need to enforce some upper limit. # We need to enforce some upper limit.
pp += 1 pp += 1
if pp > 1000: if pp > 1000:
break break
if pp < 1000:
self.putItemCount(pp)
def isKnownMovableType(self, type): def isKnownMovableType(self, type):
if type in ( if type in (
......
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