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: Re: [PATCH] Fix gdb FilteringTypePrinter (again)
Date: Mon, 14 Nov 2022 18:57:47 +0100 [thread overview]
Message-ID: <6015c470-fa6e-1cbe-db7b-27c2a1663d68@gmail.com> (raw)
In-Reply-To: <4d1dc3d4-e945-d283-964a-4dab3b3cb33e@gmail.com>
Any chance to review this one ?
On 06/10/22 19:38, François Dumont wrote:
> Hi
>
> Looks like the previous patch was not enough. When using it in the
> context of a build without dual abi and versioned namespace I started
> having failures again. I guess I hadn't rebuild everything properly.
>
> This time I think the problem was in those lines:
>
> if self.type_obj == type_obj:
> return strip_inline_namespaces(self.name)
>
> I've added a call to gdb.types.get_basic_type so that we do not
> compare a type with its typedef.
>
> Thanks for the pointer to the doc !
>
> Doing so I eventually use your code Jonathan to make
> FilteringTypeFilter more specific to a given instantiation.
>
> libstdc++: Fix gdb FilteringTypePrinter
>
> Once we found a matching FilteringTypePrinter instance we look for
> the associated
> typedef and check that the returned Python Type is equal to the
> Type to recognize.
> But gdb Python Type includes properties to distinguish a typedef
> from the actual
> type. So use gdb.types.get_basic_type to check if we are indeed on
> the same type.
>
> Additionnaly enhance FilteringTypePrinter matching mecanism by
> introducing targ1 that,
> if not None, will be used as the 1st template parameter.
>
> libstdc++-v3/ChangeLog:
>
> * python/libstdcxx/v6/printers.py (FilteringTypePrinter):
> Rename 'match' field
> 'template'. Add self.targ1 to specify the first template
> parameter of the instantiation
> to match.
> (add_one_type_printer): Add targ1 optional parameter,
> default to None.
> Use gdb.types.get_basic_type to compare the type to
> recognize and the type
> returned from the typedef lookup.
> (register_type_printers): Adapt calls to
> add_one_type_printers.
>
> Tested under Linux x86_64 normal, version namespace with or without
> dual abi.
>
> François
>
next prev parent reply other threads:[~2022-11-14 17:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-06 17:38 François Dumont
2022-11-14 17:57 ` François Dumont [this message]
2022-11-15 16:17 ` Jonathan Wakely
2022-11-16 6:04 ` François Dumont
2022-11-16 11:35 ` Jonathan Wakely
2022-11-16 11:54 ` Jonathan Wakely
2022-11-16 12:29 ` Jonathan Wakely
2022-11-17 5:28 ` François Dumont
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=6015c470-fa6e-1cbe-db7b-27c2a1663d68@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).