aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-03-12 20:33:57 +0100
committerhjk <hjk121@nokiamail.com>2014-03-14 16:17:29 +0100
commit1910fe9175a990a1df497927cb9485782ebe3aad (patch)
tree6d70eb1a12144dde97097422056e75c41d243f04
parent0962c0b03f31bbd42d74ea9a91c578d5b22df25e (diff)
Debugger: Add dumper for boost::container::list
Change-Id: I251a859ca63bf932cb0d22ef11b5492b75ebcadd Reviewed-by: Christian Stenger <christian.stenger@digia.com>
-rw-r--r--share/qtcreator/debugger/boosttypes.py15
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp12
2 files changed, 27 insertions, 0 deletions
diff --git a/share/qtcreator/debugger/boosttypes.py b/share/qtcreator/debugger/boosttypes.py
index fb725c4f22..d69164b874 100644
--- a/share/qtcreator/debugger/boosttypes.py
+++ b/share/qtcreator/debugger/boosttypes.py
@@ -95,6 +95,21 @@ def qdump__boost__shared_ptr(d, value):
d.putIntItem("usecount", usecount)
+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()
+ with Children(d, n):
+ p = r["root_"]["next_"]
+ for i in xrange(n):
+ d.putSubItem("%s" % i, d.createValue(d.pointerValue(p) + offset, innerType))
+ p = p["next_"]
+
+
def qdump__boost__gregorian__date(d, value):
d.putValue(int(value["days_"]), JulianDate)
d.putNumChild(0)
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index d50879b287..9039eabef8 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -4887,6 +4887,18 @@ GdbEngine
+ Check("p3", "Thu Jan 1 00:00:00 1970", "boost::posix_time::ptime");
+ QTest::newRow("BoostList")
+ << Data("#include <boost/container/list.hpp>\n",
+ "typedef std::pair<int, double> p;\n"
+ "boost::container::list<p> l;\n"
+ "l.push_back(p(13, 61));\n"
+ "l.push_back(p(14, 64));\n"
+ "l.push_back(p(15, 65));\n"
+ "l.push_back(p(16, 66));\n")
+ + BoostProfile()
+ + Check("l", "<4 items>", "boost::container::list<std::pair<int,double>>")
+ + Check("l.2.second", "65", "double");
+
// // This tests qdump__KRBase in share/qtcreator/debugger/qttypes.py which uses
// // a static typeflag to dispatch to subclasses");