Inconsistency between results of pretty-printing children

Oliver Buchtala oliver.buchtala@googlemail.com
Fri Jul 20 10:05:00 GMT 2012


Hi,

I am facing a problem with the python API for implemenation of 
Printer.children().

In working examples the metod of a pretty printer looks like that:

    def children():
       return [("key", 1)]

Usually one returns an iterable here.

The point is, that it returns tuples with key and value.
This works fine with existing IDEs using the MI interface (kdevelop, 
eclipse cdt, nemiver).

In the API documentation it is described, that this method should return 
alternating keys and values.
And that is exactly what is expected by gdb's print command when 
printing pretty.
To work with gdb's print method, I would adapt my printer to flatten the 
whole list so that keys and values are iterated in an alternating manner.

This way it happens, that my pretty printer can not be used in IDEs and 
with gdb's print simultanously.
Am I doing something wrong?

Regards,
Oliver



More information about the Gdb mailing list