FYI: update libstdc++ pretty-printers

Tom Tromey tromey@redhat.com
Thu Jan 27 19:13:00 GMT 2011


Tom> Doug Evans recently added some features to gdb to make it possible for
Tom> the user to individually enable or disable pretty-printers.  In order
Tom> for this to work, the printers must conform to a certain extended
Tom> protocol.

Benjamin> By this do you mean type-specific enable/disable? Ie, enable
Benjamin> std::string prettyprinter, and have std::list disabled? 

Yeah.

Benjamin> If so, way cool, can you give example syntax that does it?

Sure.  You need to know the name of the printers; but with the new code,
each printer is just named after the class it prints.  You can see all
of them with "info pretty-printers".

Then you can do something like:

(gdb) disable pretty-printer .* .*:std::list
1 printer disabled
55 of 56 printers enabled

The syntax is a little funny, since you supply regular expressions to
match against the objfile (executable or shared library) name, the
printer's "category" (I'm not sure if there is an official name for
this, but in this case it is "libstdc++-v6"), and the printer itself.

Tom



More information about the Libstdc++ mailing list