public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH][_GLIBCXX_INLINE_VERSION] Fix std::span pretty printer
Date: Wed, 25 May 2022 22:26:40 +0200	[thread overview]
Message-ID: <c471c1e2-fc87-d313-4d01-85b10b9f75d7@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

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

[-- Attachment #2: span_printers.patch --]
[-- Type: text/x-patch, Size: 991 bytes --]

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	other threads:[~2022-05-25 20:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 20:26 François Dumont [this message]
2022-05-25 23:34 ` Jonathan Wakely
2022-05-25 23:38   ` Jonathan Wakely
2022-05-26  9:21     ` Jonathan Wakely
2022-05-26  9:40       ` François Dumont
2022-05-26 14:49         ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c471c1e2-fc87-d313-4d01-85b10b9f75d7@gmail.com \
    --to=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).