gdb python pretty printer question

Tom Tromey tromey@redhat.com
Wed Oct 5 19:09:00 GMT 2011


>>>>> ">" == S Boucher <stbya@yahoo.com> writes:

>> I'm trying to use the python pretty printer functionality to to print
>> what are basically sub classes implemented in C.
[...]

>>         return v.__str__()

>> Problem with that is that when v.__str__() is called to print 'b' from
>> S1, it notices that b is a S1, and we have a recursion...

>> Any way to prevent the recursion?

Nothing built-in.
I suggest just having S1Printer.to_string delegate to some other function.

Tom



More information about the Gdb mailing list