aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Nuzhdin <dmtr.nuzhdin@gmail.com>2019-08-24 10:48:17 +0300
committerDmitry Nuzhdin <dmtr.nuzhdin@gmail.com>2019-08-26 16:11:23 +0000
commit309e345818063507ed5bcd8151d670ebd43b6b9c (patch)
tree6e1c4726bbd819367388447d7cf1d611bd56cf98
parent8751d0c7d983a97ec2f0c557dde13b0c7592ea13 (diff)
Debugger: Fix mapping std::set in Locals window via gdb
Currently QtCreator incorrectly shows content of a std::set. For example set {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} is shown as {0, 1, 2, 1, 2, 1, 2, 1, 2}. Change-Id: Idaff66451827657ef129aa3d27895c43938e6fdc Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--share/qtcreator/debugger/stdtypes.py2
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp11
2 files changed, 7 insertions, 6 deletions
diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py
index fb62135376..bdbaea14d5 100644
--- a/share/qtcreator/debugger/stdtypes.py
+++ b/share/qtcreator/debugger/stdtypes.py
@@ -442,7 +442,7 @@ def qdump__std__set(d, value):
d.putSubItem(i, val)
if node["_M_right"].pointer() == 0:
parent = node["_M_parent"]
- while node == parent["_M_right"]:
+ while node.pointer() == parent["_M_right"].pointer():
node = parent
parent = parent["_M_parent"]
if node["_M_right"] != parent:
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index b179882643..026846e7db 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -4692,10 +4692,7 @@ void tst_Dumpers::dumper_data()
"std::set<double> s0;\n"
"unused(&s0);\n\n"
- "std::set<int> s1;\n"
- "s1.insert(11);\n"
- "s1.insert(22);\n"
- "s1.insert(33);\n"
+ "std::set<int> s1{11, 22, 33, 44, 55, 66, 77, 88};\n"
"unused(&s1);\n\n"
"typedef std::set<int> Set;\n"
@@ -4716,9 +4713,13 @@ void tst_Dumpers::dumper_data()
"s3.insert(3);\n"
"s3.insert(3);\n")
+ + Cxx11Profile()
+ Check("s0", "<0 items>", "std::set<double>")
- + Check("s1", "<3 items>", "std::set<int>")
+ + Check("s1", "<8 items>", "std::set<int>")
+ + Check("s1.0", "[0]", "11", "int")
+ + Check("s1.1", "[1]", "22", "int")
+ + Check("s1.5", "[5]", "66", "int")
+ Check("s2", "<3 items>", TypeDef("std::set<int>", "Set"))
+ Check("it1.value", "11", "int")