summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-07-03 13:07:21 +0200
committerhjk <hjk121@nokiamail.com>2014-07-08 10:06:59 +0200
commitbed82747f40fc6ef0ebc1fde322a1056784aa181 (patch)
tree8154f1f86c4feb6e1651fa3a0651183fff5fc5cf
parent059cfde67737fb1d0d1a4c46ee62a387a07ca0b4 (diff)
downloadqt-creator-bed82747f40fc6ef0ebc1fde322a1056784aa181.tar.gz
Debugger: Fix compact display of individual hash nodes
This was not accessible if the hash itself was a typedef. Also, make sure that unusual key contents don't do any harm in the protocol by hexencoding it unconditionally. Change-Id: I83d43768ec72f797a72b2d9c44ca91b1feaf61a7 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
-rw-r--r--share/qtcreator/debugger/dumper.py6
-rw-r--r--share/qtcreator/debugger/qttypes.py20
2 files changed, 18 insertions, 8 deletions
diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py
index 9b9c4308b9..1912044226 100644
--- a/share/qtcreator/debugger/dumper.py
+++ b/share/qtcreator/debugger/dumper.py
@@ -600,9 +600,11 @@ class DumperBase:
else:
val = str(value.GetValue()) if self.isLldb else str(value)
if index == -1:
- self.put('name="%s",' % val)
+ key = 'key="%s",' % val
else:
- self.put('key="[%d] %s",' % (index, val))
+ key = 'key="[%d] %s",' % (index, val)
+ self.put('key="%s",' % self.hexencode(key))
+ self.put('keyencoded="%s",' % Hex2EncodedLatin1)
def putPair(self, pair, index = -1):
if self.pairData.useKeyAndValue:
diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py
index b950db9417..b110e50cfb 100644
--- a/share/qtcreator/debugger/qttypes.py
+++ b/share/qtcreator/debugger/qttypes.py
@@ -638,6 +638,9 @@ def qdump__QHash(d, value):
d.putItem(it)
+def qform__QHashNode():
+ return mapForms()
+
def qdump__QHashNode(d, value):
key = value["key"]
if not key:
@@ -645,12 +648,17 @@ def qdump__QHashNode(d, value):
# for Qt4 optimized int keytype
key = value[1]["key"]
val = value["value"]
- d.putEmptyValue()
- d.putNumChild(2)
- if d.isExpanded():
- with Children(d):
- d.putSubItem("key", key)
- d.putSubItem("value", val)
+ if d.isMapCompact(key.type, val.type):
+ d.putMapName(key)
+ d.putItem(val)
+ d.putType(value.type)
+ else:
+ d.putEmptyValue()
+ d.putNumChild(2)
+ if d.isExpanded():
+ with Children(d):
+ d.putSubItem("key", key)
+ d.putSubItem("value", val)
def qHashIteratorHelper(d, value):