Re: Patch: implement new dynamic varobj spec

Tom Tromey
2009-09-14T20:12:33Z

>>>>> "Nick" == Nick Roberts <nickrob@snap.net.nz> writes:

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

Tom> Oh, odd. But not a bug, really, as the order is not specified.

Nick> It might not be a bug but it's desirable to list them in order as
Nick> that makes it easier to insert them into the existing list.

Ok, I will look into this.

Nick> In fact it would also make things easier if the "exp" field of
Nick> -var-list-children was just a number and this would make it
Nick> consistent with ordinary arrays.

The children might not actually represent an array. For example, they
may conceptually be fields of a struct.

Nick> + /* Strip square brackets from string. */
Nick> + len = strlen (py_name);
Nick> + name = strndup (py_name + 1, len - 2);

There is nothing guaranteeing square brackets about the name. The name
is determined wholly by the Python pretty-printer, which can return
anything at all.

I would prefer not to change this. I think front ends simply have to
treat the child name as an arbitrary string. They can use the display
hint to decide how and if to display the name.

Tom