Commit f58ab8d7 authored by hjk's avatar hjk

Debugger: Fix std::set<...>::iterator dumper for GCC 5.x and C++11

Change-Id: Icaca7da1f5ae6f958ae0fdaf217bde611d049916
Reviewed-by: default avatarNiels Weber <niels.weber@theqtcompany.com>
parent 34196f51
......@@ -292,7 +292,12 @@ def stdTreeIteratorHelper(d, value):
nodeTypeName = str(value.type).replace("_Rb_tree_iterator", "_Rb_tree_node", 1)
nodeTypeName = nodeTypeName.replace("_Rb_tree_const_iterator", "_Rb_tree_node", 1)
nodeType = d.lookupType(nodeTypeName + '*')
data = node.cast(nodeType).dereference()["_M_value_field"]
nnode = node.cast(nodeType).dereference()
try:
data = nnode["_M_value_field"]
except: # GCC 5.x, C++11.
data = nnode["_M_storage"] # __gnu_cxx::__aligned_membuf<T>
data = data.cast(d.templateArgument(data.type, 0))
first = d.childWithName(data, "first")
if first:
d.putSubItem("first", first)
......
......@@ -4113,6 +4113,7 @@ void tst_Dumpers::dumper_data()
<< Data("#include <set>\n",
"std::set<double> s0;\n"
"unused(&s0);\n\n"
"std::set<int> s1;\n"
"s1.insert(11);\n"
......
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