Commit 46d825c5 by Doug Evans Committed by Doug Evans

re PR libstdc++/67440 (pretty-printing of a const set<foo> fails)

	PR libstdc++/67440
	* python/libstdcxx/v6/printers.py (find_type): Handle "const" in
	type name.
	* testsuite/libstdc++-prettyprinters/debug.cc: Add test for
	const set<int>.
	* testsuite/libstdc++-prettyprinters/simple.cc: Ditto.
	* testsuite/libstdc++-prettyprinters/simple11.cc: Ditto.

From-SVN: r230437
parent 83b4db6d
2015-11-16 Doug Evans <dje@google.com>
PR libstdc++/67440
* python/libstdcxx/v6/printers.py (find_type): Handle "const" in
type name.
* testsuite/libstdc++-prettyprinters/debug.cc: Add test for
const set<int>.
* testsuite/libstdc++-prettyprinters/simple.cc: Ditto.
* testsuite/libstdc++-prettyprinters/simple11.cc: Ditto.
2015-11-15 Jonathan Wakely <jwakely@redhat.com> 2015-11-15 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/68353 PR libstdc++/68353
......
...@@ -85,7 +85,9 @@ except ImportError: ...@@ -85,7 +85,9 @@ except ImportError:
def find_type(orig, name): def find_type(orig, name):
typ = orig.strip_typedefs() typ = orig.strip_typedefs()
while True: while True:
search = str(typ) + '::' + name # Use typ.name here instead of str(typ) to discard any const,etc.
# qualifiers. PR 67440.
search = typ.name + '::' + name
try: try:
return gdb.lookup_type(search) return gdb.lookup_type(search)
except RuntimeError: except RuntimeError:
......
...@@ -70,6 +70,10 @@ main() ...@@ -70,6 +70,10 @@ main()
std::map<std::string, int>::iterator mpiter = mp.begin(); std::map<std::string, int>::iterator mpiter = mp.begin();
// { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } } // { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
// PR 67440
const std::set<int> const_intset = {2, 3};
// { dg-final { note-test const_intset {std::__debug::set with 2 elements = {[0] = 2, [1] = 3}} } }
std::set<std::string> sp; std::set<std::string> sp;
sp.insert("clownfish"); sp.insert("clownfish");
sp.insert("barrel"); sp.insert("barrel");
......
...@@ -73,6 +73,10 @@ main() ...@@ -73,6 +73,10 @@ main()
std::map<std::string, int>::iterator mpiter = mp.begin(); std::map<std::string, int>::iterator mpiter = mp.begin();
// { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } } // { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
// PR 67440
const std::set<int> const_intset = {2, 3};
// { dg-final { note-test const_intset {std::set with 2 elements = {[0] = 2, [1] = 3}} } }
std::set<std::string> sp; std::set<std::string> sp;
sp.insert("clownfish"); sp.insert("clownfish");
sp.insert("barrel"); sp.insert("barrel");
......
...@@ -73,6 +73,10 @@ main() ...@@ -73,6 +73,10 @@ main()
std::map<std::string, int>::iterator mpiter = mp.begin(); std::map<std::string, int>::iterator mpiter = mp.begin();
// { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } } // { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
// PR 67440
const std::set<int> const_intset = {2, 3};
// { dg-final { note-test const_intset {std::set with 2 elements = {[0] = 2, [1] = 3}} } }
std::set<std::string> sp; std::set<std::string> sp;
sp.insert("clownfish"); sp.insert("clownfish");
sp.insert("barrel"); sp.insert("barrel");
......
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