Hi

    Here is a patch to fix std::span pretty printer in versioned namespace mode.

    Note that there is still a problem with std::atomic after this patch.

got: $13 = std::atomic<std::__8::shared_ptr<int>> (empty) = {get() = 0x0}
FAIL: libstdc++-prettyprinters/cxx20.cc print spe

    libstdc++: [_GLIBCXX_INLINE_VERSION] Fix std::span pretty printer

    libstdc++-v3/ChangeLog:

            * python/libstdcxx/v6/printers.py (StdSpanPrinter.__init__):
            Strip typename from version namespace.

Tested under Linux x86_64 _GLIBCXX_INLINE_VERSION mode.

Ok to commit ?

François
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 0bd793c0897..fafdff3e5c0 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -1687,7 +1687,7 @@ class StdSpanPrinter:
             return '[%d]' % count, (self.begin + count).dereference()
 
     def __init__(self, typename, val):
-        self.typename = typename
+        self.typename = strip_versioned_namespace(typename)
         self.val = val
         if val.type.template_argument(1) == gdb.parse_and_eval('static_cast<std::size_t>(-1)'):
             self.size = val['_M_extent']['_M_extent_value']
@@ -1994,7 +1994,7 @@ class FilteringTypePrinter(object):
         self.enabled = True
 
     class _recognizer(object):
-        "The recognizer class for TemplateTypePrinter."
+        "The recognizer class for FilteringTypePrinter."
 
         def __init__(self, match, name):
             self.match = match

Reply via email to