pretty printing with python

Tom Tromey tromey@redhat.com
Mon May 2 14:32:00 GMT 2011


>>>>> "Klaus" == Klaus Rudolph <lts-rudolph@gmx.de> writes:

Klaus> I want to start with writing a pretty printer for gdb, but can't
Klaus> find a startup for my own printer.

Klaus> First: All example contains a line
Klaus> import gdb.printing
Klaus> But this results in 
Klaus> Traceback (most recent call last):
Klaus>   File "/home/krud/projekte/myppc8000/ppc_8000_938/test.py", line 3, in <module>
Klaus>     import gdb.printing
Klaus> ImportError: No module named printing

This means your GDB is too old.  `gdb.printing' is not in any release
yet; it will make its debut in 7.3.

You can write printers so that they work with both the new- and
old-styles here.  The libstdc++ printers do this.

Tom



More information about the Gdb mailing list