This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Add libstdc++ type printers for class templates
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, pmuldoon at redhat dot com
- Date: Tue, 15 Jul 2014 00:40:53 +0100
- Subject: Re: [patch] Add libstdc++ type printers for class templates
- Authentication-results: sourceware.org; auth=none
- References: <20140714142159 dot GF4871 at redhat dot com> <8738e33dqh dot fsf at fleche dot redhat dot com>
On 14/07/14 14:08 -0600, Tom Tromey wrote:
Jonathan> This passes the python testsuite but I'll wait for comments before
Jonathan> committing, in case my use of the GDB API or Python can be improved by
Jonathan> anyone.
It looked fine to me.
Thanks for checking it. One thing I should have mentioned is the
inconsistency between regex subgroups and string replacement fields:
add_one_template_type_printer(obj, 'unique_ptr<T>',
'unique_ptr<(.*), std::default_delete<\\1 ?> >',
'unique_ptr<{1}>')
It might seem odd that the last argument uses {1} not \\1 but the
reason is that what gets substituted there is not actually \\1 but
rather the result of applying type printers to \\1, and I implemented
the substitution via string.format(), rather than reimplementing most
of re.sub() by hand.