Re: Robustifying pretty-printers

Vladimir Prus
2009-07-10T16:40:44Z

On Friday 10 July 2009 Tom Tromey wrote:

> >>>>> "Vladimir" == Vladimir Prus <vladimir@codesourcery.com> writes:
>
> Vladimir> The primary reason is that if frontend wants to fetch more data, it's
> Vladimir> natural to issue:
> Vladimir> -var-list-children 10 20
> Vladimir> than
> Vladimir> -var-set-child-range 0 20
> Vladimir> -var-list-children
> Vladimir> and then filter out the first 10 elements FE already has.
>
> I don't understand. The FE would do this:
>
> -var-set-child-range 10 20
> -var-list-children

And what children with -var-update reevaluate? From 10 to 20? Or
from 0 to 20? If the former, it's not very useful. If the latter,
then it appears that low boundary is only used for -var-list-children.
Maybe, it's most useful to decouple setting the range for -var-update
and getting specific children. So, if frontend wants more children
now, it will do:

-var-list-children 10 20

and if it wishes for 20 children to be fetched from now on, it will
explicitly do:

-var-set-child-limit 20

Note that there's only upper limit here, since it looks like no other command
but -var-list-children even need lower limit.

> I suppose with the list-children approach we can have resetting be
> done like:
>
> -var-list-children foo -1 -1
>
> Another question is whether changing the visualizer ought to reset the
> selected child range. I'm not sure it matters; I assume a FE will do
> this itself.

Probably so.

- Volodya