Re: MI & pretty-printing

Tom Tromey
2009-08-06T21:02:35Z

>>>>> "Volodya" == Vladimir Prus <vladimir@codesourcery.com> writes:

Volodya> On IRC, Tom and I talked about best way to support Python
Volodya> pretty-printing with MI. Here's my attempt at summarizing.

I finally finished the first draft of this. I pushed it to the
archer-tromey-python branch today. Please give it a try; if it is all
looking ok I will extract it and push it into CVS.

Volodya> -enable-pretty-printing [0|1]

I omitted the argument in my implementation.

I didn't see a benefit to letting MI clients disable pretty-printing
globally. They can do it per-varobj, or simply not send this command in
the first place. (If we did allow this, then we'd have to define what
it meant for existing varobjs with printers installed.)

Volodya> -var-list-children varobj [low] [hi]
Volodya> -var-set-update-range varobj low hi

I implemented these verbatim.

There is now an optional has_more attribute on varobj output; it is a
boolean which is "1" if there seem to be children past the last
requested child.

The "numchild" attribute is now a bit funny. It can't tell the actual
number of children, only the number you've requested. It may be smaller
than the range you requested. The user has to pay attention to this,
because it is the only way to notice that children were deleted (for
-var-update, this will show up in new_num_children).

When doing a -var-update, a dynamic varobj may report "new_children".
This is a list of any new children added during this update. New
children can only be added at the end of the update range (changes to
existing elements are reported as changed varobjs).

I haven't documented all these details yet. I'll do that soon.
(FWIW, -var-update seems under-documented in general.)

Tom