Re: MI: type prefixes for values

Daniel Jacobowitz
2006-04-06T14:01:31Z

On Thu, Apr 06, 2006 at 05:45:16PM +0400, Vladimir Prus wrote:
> > Either b's stack frame is at the same address - in which case the
> > varobj is still valid - or else it isn't, in which case the frame id
> > has changed.
>
> I did not know that GDB exposes frame ID in any way, and Jim has mentioned
> that it's XCode that does the magic, not gdb. Is there some command to print
> frame id that I've missed?

There shouldn't be, but GDB will notice if the varobj has gone invalid.

> -exec-finish
> ^running
> (gdb)
> *stopped,reason="function-finished",frame={addr="0x080483bd",func="main",
> (gdb)
> -var-evaluate-expression TMP
> ^done,value="10"
> (gdb)
>
> There's no indication that 'TMP' varobj belongs to the stack frame we've
> already left. This is with vanilla 6.4.

Interesting, the check isn't on this path. I wonder if we really need
both different ways to get at the value of a variable. varobj_update
uses value_of_root, but -var-evaluate-expression uses
value_of_variable. I bet we have some redundant code here. Maybe not,
value_of_variable is only used for strings, the others work on struct
value.

Anyway:

-var-update *
^done,changelist=[{name="TMP",in_scope="false"}]

There's your out of scope marker.

--
Daniel Jacobowitz
CodeSourcery