This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Problem redefining python pretty printers
Doug Evans <dje@google.com> writes:
> On Sat, May 21, 2011 at 6:41 PM, Robert Lupton the Good
> <rhl@astro.princeton.edu> wrote:
>> The routine register is:
>>> def register():
>>> Â Â printer = gdb.printing.RegexpCollectionPrettyPrinter("afw")
>>> Â Â gdb.printing.register_pretty_printer(gdb, printer)
>>
>> Any advice on what I'm doing wrong? ÂI suppose I could come up with a new name each time, but that seems a little clumsy.
>
> You're not doing anything wrong, per se.
> I think we need to handle this use-case though.
> gdb could either provide a way to replace an existing pretty-printer
> or delete it so that it can be re-added.
I guess you could delete it from the (gdb) list directly by using the
Python list functions. But that is hacky. I agree on the specific
API. I can't remember seeing a bug for this. Is there one?
Cheers,
Phil