This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Inconsistency in pretty printer documentation
- From: Evan Driscoll <evaned at gmail dot com>
- To: gdb at sourceware dot org
- Date: Thu, 15 Oct 2015 16:44:02 -0500
- Subject: Inconsistency in pretty printer documentation
- Authentication-results: sourceware.org; auth=none
The documentation for the gdb.printing module [1] says the following:
PrettyPrinter (name, subprinters=None)
... Pretty-printers should generally inherit from this class.
However, in the "writing a pretty printer" section [2], there are
several examples of pretty printers (StdStringPrinter, fooPrinter,
barPrinter), none of which inherit from gdb.printing.PrettyPrinter.
Many of the third-party pages describing third-party printers around
the web (e.g. [3-5]) do not inherit from anything except object.
In the printers I've written, I've not been using PrettyPrinter and
things seem to mostly work, but I also haven't really messed around
with enable/disable pretty-printer etc.
Am I missing out on something by not using the PrettyPrinter class? If
I were to use it, do I just implement the same API? Is PrettyPrinter a
largely-defunct class that is no longer needed? Is it a newer class
and the other docs haven't been updated, and get new functionaliy from
it?
Evan
[1] https://sourceware.org/gdb/onlinedocs/gdb/gdb_002eprinting.html#gdb_002eprinting
[2] https://sourceware.org/gdb/onlinedocs/gdb/Writing-a-Pretty_002dPrinter.html#Writing-a-Pretty_002dPrinter
[3] https://www.rethinkdb.com/blog/make-debugging-easier-with-custom-pretty-printers/
[4] http://tromey.com/blog/?p=524
[5] http://tromey.com/blog/?p=546