aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-03-20 15:16:56 +0100
committerhjk <hjk121@nokiamail.com>2014-04-02 11:03:43 +0200
commit18b91ae4ecf494d109c05d35dd0df84e6a23325f (patch)
tree749c5988d7fc2c9a554b603daee0a852ac85febd
parent50459e5713ccfe08af83b56e42c4662a62de87b9 (diff)
Debugger: Move putPlainChildren() to Dumper base
It's reusable... Change-Id: I1a0f40b9b3bbecf99024d3a2fd5148baf604109b Reviewed-by: Christian Stenger <christian.stenger@digia.com>
-rw-r--r--share/qtcreator/debugger/dumper.py7
-rw-r--r--share/qtcreator/debugger/gdbbridge.py8
-rw-r--r--share/qtcreator/debugger/misctypes.py9
-rw-r--r--share/qtcreator/debugger/qttypes.py13
4 files changed, 11 insertions, 26 deletions
diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py
index 5b61cbe22f..c4f061f813 100644
--- a/share/qtcreator/debugger/dumper.py
+++ b/share/qtcreator/debugger/dumper.py
@@ -550,6 +550,13 @@ class DumperBase:
self.putSubItem("first", key)
self.putSubItem("second", value)
+ def putPlainChildren(self, value, dumpBase = True):
+ self.putEmptyValue(-99)
+ self.putNumChild(1)
+ if self.isExpanded():
+ with Children(self):
+ self.putFields(value, dumpBase)
+
def isMapCompact(self, keyType, valueType):
format = self.currentItemFormat()
if format == 2:
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py
index 7f786e149d..3593f8c75b 100644
--- a/share/qtcreator/debugger/gdbbridge.py
+++ b/share/qtcreator/debugger/gdbbridge.py
@@ -1293,14 +1293,6 @@ class Dumper(DumperBase):
if staticMetaObject:
self.putQObjectGuts(value, staticMetaObject)
-
- def putPlainChildren(self, value):
- self.putEmptyValue(-99)
- self.putNumChild(1)
- if self.currentIName in self.expandedINames:
- with Children(self):
- self.putFields(value)
-
def toBlob(self, value):
size = toInteger(value.type.sizeof)
if value.address:
diff --git a/share/qtcreator/debugger/misctypes.py b/share/qtcreator/debugger/misctypes.py
index d818534ae9..f29487184f 100644
--- a/share/qtcreator/debugger/misctypes.py
+++ b/share/qtcreator/debugger/misctypes.py
@@ -363,14 +363,9 @@ if False:
def qdump__KDSoapValue1(d, value):
inner = value["d"]["d"].dereference()
d.putStringValue(inner["m_name"])
- if d.isExpanded():
- with Children(d):
- d.putFields(inner)
+ d.putPlainChildren(inner)
def qdump__KDSoapValue(d, value):
p = (value.cast(lookupType("char*")) + 4).dereference().cast(lookupType("QString"))
d.putStringValue(p)
- if d.isExpanded():
- with Children(d):
- data = value["d"]["d"].dereference()
- d.putFields(data)
+ d.putPlainChildren(value["d"]["d"].dereference())
diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py
index bcf231e4a5..760dded9df 100644
--- a/share/qtcreator/debugger/qttypes.py
+++ b/share/qtcreator/debugger/qttypes.py
@@ -156,7 +156,6 @@ def qdump__QModelIndex(d, value):
rowCount = int(d.parseAndEvaluate("%s.rowCount(%s)" % (mm_, mi_)))
columnCount = int(d.parseAndEvaluate("%s.columnCount(%s)" % (mm_, mi_)))
except:
- d.putEmptyValue()
d.putPlainChildren(value)
return
@@ -1211,11 +1210,7 @@ def _qdump__QObject(d, value):
with SubItem(d, "data"):
d.putEmptyValue()
d.putNoType()
- d.putNumChild(1)
- if d.isExpanded():
- with Children(d):
- d.putFields(d_ptr, False)
-
+ d.putPlainChildren(d_ptr, False)
d.putFields(value)
# Parent and children.
@@ -2273,11 +2268,7 @@ def qdump__QV4__Value(d, value):
pass
# Fall back for cases that we do not handle specifically.
- d.putEmptyValue()
- d.putNumChild(1)
- if d.isExpanded():
- with Children(d):
- d.putFields(value)
+ d.putPlainChildren(value)
#######################################################################