Patch: implement new dynamic varobj spec

Nick Roberts
2009-09-11T05:41:35Z

Tom Tromey writes:
> This is the long-awaited dynamic varobj patch.
> It implements the spec as described by Vladimir:
>
> http://sourceware.org/ml/gdb/2009-07/msg00088.html

It's a big patch. Dynamic variable objects seem to behave differently
to the current ones:

1) Children are reported (and presumably created) in var-update even though
only a root variable object may have been created, i.e., not
-var-list-children has been invoked.

2) -var-update seems to list changes to children of dynamic objects in reverse
numerical order.

Does -var-set-update-range only work for dynamic variable objects - the
documentation doesn't say but I couldn't get it to work with current ones.
With dynamic variable objects I could restrict the range but it didn't seem
to match up (from seem to be ignored).

The new FROM TO arguments for -var-list-children work with current variable
objects but it seems that GDB just restricts what it prints but stores the
whole vector which doesn't seem to save memory. Would it not be better to
create children in the range specified since the array might be large and the
front end only needs the values it displays.

Likewise with -var-set-update-range: does GDB track all changes and just
report a restricted set, or restrict what it tracks?

I have a few thoughts about the documentation:

The field `in_scope' is already described with three possible values. It's
described again with just two.

The field `displayhint' seems very useful with -var-create but does it serve
any purpose when output with -var-update?

The field `has_more' seems to be overloaded depending on whether its output
from -var-create, -var-list-children or -var-update.

Existing documentation uses @var for field names, while new uses @samp.

I find varobj.c hard to read and some of what I say might be wrong but
hopefully there's more signal than noise.

--
Nick http://www.inet.net.nz/~nickrob