From: Jonathan Wakely <jwakely@redhat.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Pretty printers for versioned namespace
Date: Fri, 02 Dec 2016 00:42:00 -0000 [thread overview]
Message-ID: <20161202004150.GI3301@redhat.com> (raw)
In-Reply-To: <71a8120b-494a-c074-bb13-1ddfa560fdf2@gmail.com>
On 01/12/16 22:51 +0100, François Dumont wrote:
>On 29/11/2016 21:17, Jonathan Wakely wrote:
>>On 28/11/16 22:19 +0100, François Dumont wrote:
>>> I am not fully happy with the replication in printers.py of
>>>StdRbtreeIteratorPrinter and
>>>StdExpAnyPrinter(SingleObjContainerPrinter in respectively
>>>StdVersionedRbtreeIteratorPrinter and
>>>StdExpVerAnyPrinter(SingleObjContainerPrinter just to adapt 2
>>>lines where regex is not an option. We could surely keep only one
>>>and pass it '' or '__7'. But as I said I am not a python expert so
>>>any help would be appreciated.
>>
>>We definitely want to avoid that duplication. For
>>StdRbtreeIteratorPrinter you can just look at 'typename' and see
>>whether it starts with "std::__7" or not. If it does, you need to lookup
>>std::__7::_Rb_tree_node<...>, otherwise you need to lookup
>>std::_Rb_tree_node<...> instead.
>>
>>For StdExpAnyPrinter just do two replacements: first replace
>>std::string with the result of gdb.lookup_type('std::string') and then
>>replace std::__7::string with the result of looking that up. Are you
>>sure that's even needed though? Does std::__7::string actually appear
>>in the manager function's name? I would expect it to appear as
>>std::__7::basic_string<char, std::__7::char_traits<char>,
>>std::__7::allocator<char> > >
>>which doesn't need to be expanded anyway. So I think you can just
>>remove your StdExpVerAnyPrinter.
>
>We needed the StdExpVerAnyPrinter just because of the loopkup for
>'std::string' which has to be 'std::__7::string'. But I used similar
>technique exposed previously to get rid of it.
But I don't see any std::__7::string in the relevant symbols. Here's
the manager function for an std:experimental::__7::any storing a
std::__7::string:
std::experimental::fundamentals_v1::__7::any::_Manager_internal<std::__7::basic_string<char, std::__7::char_traits<char>, std::__7::allocator<char> > >::_S_manage(std::experimental::fundamentals_v1::__7::any::_Op, >std::experimental::fundamentals_v1::__7::any const*, >std::experimental::fundamentals_v1::__7::any::_Arg*)
Since this has no std::__7::string it doesn't need to be substituted.
Do any tests fail without the change to StdExpAnyPrinter? Which ones?
next prev parent reply other threads:[~2016-12-02 0:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-28 21:19 François Dumont
2016-11-29 20:17 ` Jonathan Wakely
2016-12-01 21:51 ` François Dumont
2016-12-02 0:42 ` Jonathan Wakely [this message]
2016-12-09 12:56 ` François Dumont
2016-12-09 15:18 ` Jonathan Wakely
2016-12-14 21:53 ` François Dumont
2016-12-15 11:15 ` Jonathan Wakely
2016-12-15 14:51 ` Jonathan Wakely
2016-12-15 15:52 ` Jonathan Wakely
2016-12-24 16:29 ` François Dumont
2017-01-04 12:52 ` Jonathan Wakely
2017-01-09 20:25 ` François Dumont
2017-01-10 12:39 ` Jonathan Wakely
2017-01-19 21:22 ` François Dumont
2017-01-19 21:42 ` Jonathan Wakely
[not found] ` <b26a2ed4-ac83-ede4-ed9c-f3b328d7bc4a@gmail.com>
[not found] ` <20170131144204.GX3093@redhat.com>
[not found] ` <2c905325-8839-bb5d-4885-0103801a6264@gmail.com>
[not found] ` <20170213223132.GV4602@redhat.com>
[not found] ` <a6f4717a-1d63-beb6-6a93-c111969ce4fa@gmail.com>
2017-02-16 12:26 ` 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=20161202004150.GI3301@redhat.com \
--to=jwakely@redhat.com \
--cc=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).