[gcc r9-9169] libstdc++: Fix pretty printers script and tests

Jonathan Wakely redi@gcc.gnu.org
Mon Jan 11 15:05:26 GMT 2021


https://gcc.gnu.org/g:af0dd3ec61165bbff7843d34d3ec8bdf7cabbfbe

commit r9-9169-gaf0dd3ec61165bbff7843d34d3ec8bdf7cabbfbe
Author: François Dumont <fdumont@gcc.gnu.org>
Date:   Fri Dec 20 12:42:50 2019 +0000

    libstdc++: Fix pretty printers script and tests
    
            * python/libstdcxx/v6/printers.py (lookup_node_type): Remove redundant
            call to lookup_node_type.
            * testsuite/libstdc++-prettyprinters/80276.cc: Define
            _GLIBCXX_USE_CXX11_ABI to 0.
            * testsuite/libstdc++-prettyprinters/91997.cc: Use regexp-test to check
            'a' content.
    
    (cherry picked from commit e278e62f91d955ce808fcf4d05826c7b2779888f)

Diff:
---
 libstdc++-v3/python/libstdcxx/v6/printers.py             | 1 -
 libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc | 3 +++
 libstdc++-v3/testsuite/libstdc++-prettyprinters/91997.cc | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index e648f0e9dda..800a6ebbcaa 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -146,7 +146,6 @@ def lookup_node_type(nodename, containertype):
             if is_member_of_namespace(containertype, 'std::__cxx1998',
                                       'std::__debug', '__gnu_debug'):
                 nodename = nodename.replace('::', '::__cxx1998::', 1)
-                return lookup_templ_spec(nodename, valtype)
                 try:
                     return lookup_templ_spec(nodename, valtype)
                 except gdb.error:
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
index fde652e1635..76f099d5596 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
@@ -19,6 +19,9 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// Type printers only recognize the old std::string for now.
+#define _GLIBCXX_USE_CXX11_ABI 0
+
 #include <iostream>
 #include <list>
 #include <memory>
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/91997.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/91997.cc
index 393c5680e2e..059ac9aa97f 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/91997.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/91997.cc
@@ -41,7 +41,7 @@ int main()
   // { dg-final { note-test mit {{first = 1, second = 2}} } }
 
   std::any a = m;
-  // { dg-final { note-test a {std::any containing std::map with 1 element = {[1] = 2}} } }
+  // { dg-final { regexp-test a {std::any containing std::(__debug::)?map with 1 element = {\[1\] = 2}} } }
 
   std::set<int> s{1, 2};
   auto sit = s.begin();


More information about the Libstdc++-cvs mailing list