[patch] Add libstdc++ type printers for class templates

Jonathan Wakely jwakely@redhat.com
Mon Jul 14 23:41:00 GMT 2014


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.



More information about the Libstdc++ mailing list