This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: add typedef printers to libstdc++
- From: Magnus Fromreide <magfr at lysator dot liu dot se>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 22 Sep 2012 10:54:08 +0200
- Subject: Re: add typedef printers to libstdc++
- References: <87vcf7qegs.fsf@fleche.redhat.com>
On Fri, 2012-09-21 at 14:59 -0600, Tom Tromey wrote:
> This patch adds some typedef printers to libstdc++.
>
> This relies on a gdb patch that hasn't yet gone in (pending on the list).
> If the gdb patch changes, I'll change these printers as well.
>
> The basic idea is that you can now have gdb substitute a name of your
> choice when printing a type's name. This lets a library pretend that
> some typedefs are canonical.
>
> This includes a fairly comprehensive test case for the new type
> printers.
I have not tested it, but when looking at the test case and also on the
code I couldn't help but ask myself how it handles other derivations.
How does it display the types of the variables us, s and ss in the
following code:
---
#include <string>
typedef std::basic_string<unsigned char> ustring;
ustring us;
std::string s;
std::basic_string<signed char> ss;
---
I would expect it to say std::basic_string<unsigned char,...>,
std::string and std::basic_string<signed char,...>, but I thought a test
case here couldn't hurt?
/MF