Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ GDB Python Pretty Printing Tutorial?

Tags:

c++

python

gdb

I am looking for a solid tutorial on creating a custom printer.

There are a few sparse pages on the GDB page however they are far from complete and leave much to the imagination!

For instance, I'd love to be able to create a PrettyPrinter for our custom shared pointer class.

like image 871
Setheron Avatar asked Sep 24 '12 23:09

Setheron


2 Answers

Check out Tom Tromey's pretty printing tutorials part 1 and part 2. There is also the libstdc++-v6 pretty printer implementation to look at, which is what I used myself as a template when I started out. A somewhat simpler example (as of this writing) is the Boost pretty printer by Rüdiger Sonderfeld.

like image 94
David Holm Avatar answered Oct 06 '22 05:10

David Holm


This one looks interesting for starters: Python Pretty-Printers from redhat

From this simple tutorial, you can proceed to more advanced ones. Here is a good example:Pretty-printers for libstc++

like image 23
prabhuvishnumurthy Avatar answered Oct 06 '22 03:10

prabhuvishnumurthy