variable objects and registers
Nick Roberts
nickrob@snap.net.nz
Fri Dec 22 04:47:00 GMT 2006
> Sadly, neither Jason nor I will get a chance to do anything other
> that our already scheduled tasks till we're done with Leopard -
> sometime middle of next year or thereabouts. We have a lot on our
> plates till then, and don't have any time available for this. I
> can't really say what our plans will be after that.
OK, well thanks for the pointers anyway.
> >> Another kind of useful addition along the same lines, we extended the
> >> "FRAME" argument to -var-create so you can say:
> >>
> >> -var-create - +main.c:6 bar
> >>
> >> to create the variable object for bar in the scope surrounding line
> >> 6. This is necessary if you want to do variable values in tooltips
> >> using variable objects.
> >
> > Yes, I see Insight uses variable objects for tooltips too. What
> > advantage do
> > they have over just using "print"?
>
> The Xcode tooltips allow structure expansion & formatting the same
> way the locals display does. Using varobj's for this makes the code
> uniform, and simpler.
Insight just prints the type as a tooltip for structures. You seem to be
saying that in Xcode you can do this and choose to expand it. Using "print"
in Emacs, everything is automatically expanded which I must admit is messy
with a large array or structure. Perhaps -data-evaluate-expression could
be modified to print "--simple-values" or "--all-values" as -stack-list-locals
does.
Actually I see Insight gets it wrong, when one variable masks another with
the same name, just printing the current value. I guess variable objects
allow such values to be correctly accessed, but they generally they seem
to be designed for tracking values rather than getting instantaneous ones
as with tooltips.
--
Nick http://www.inet.net.nz/~nickrob
More information about the Gdb-patches
mailing list