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_DEBUG][_GLIBCXX_INLINE_VERSION] Add missing printers
Date: Thu, 22 Sep 2022 19:06:16 +0200	[thread overview]
Message-ID: <0227a2ef-9efa-6bb2-6529-cb38d081f8be@gmail.com> (raw)

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

Hi

     This patch fix failures when _GLIBCXX_INLINE_VERSION mode and running:

make check-debug RUNTESTFLAGS=prettyprinters.exp

     libstdc++: [_GLIBCXX_INLINE_VERSION] Add gdb pretty print for 
_GLIBCXX_DEBUG

     In _GLIBCXX_DEBUG mode containers are in std::__debug namespace but 
not template
     parameters. In _GLIBCXX_INLINE_VERSION mode most types are in 
std::__8 namespace but
     not std::__debug containers. We need to register specific type 
printers for this
     combination.

     libstdc++-v3/ChangeLog:

             * python/libstdcxx/v6/printers.py 
(add_one_template_type_printer): Register
             printer for types in std::__debug namespace with template 
parameters in std::__8
             namespace.

Ok to commit ?

François

[-- Attachment #2: printers.py.patch --]
[-- Type: text/x-patch, Size: 755 bytes --]

diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 24a6462e496..1e9d0627e9f 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -2036,6 +2036,10 @@ def add_one_template_type_printer(obj, name, defargs):
         printer = TemplateTypePrinter(ns+name, defargs)
         gdb.types.register_type_printer(obj, printer)
 
+        # Add type printer for same type in debug namespace:
+        printer = TemplateTypePrinter('std::__debug::'+name, defargs)
+        gdb.types.register_type_printer(obj, printer)
+
 class FilteringTypePrinter(object):
     r"""
     A type printer that uses typedef names for common template specializations.

             reply	other threads:[~2022-09-22 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 17:06 François Dumont [this message]
2022-09-28 23:29 ` 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=0227a2ef-9efa-6bb2-6529-cb38d081f8be@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).