This is the mail archive of the
mailing list for the GDB project.
Re: Variables created with -var-create going out of scope unexpectedly?
Srinath Avadhanula wrote:
> I am trying to play around with GDB/MI recently, in particular with
> the -var-create command. I see that a variable created with
> -var-create goes out of scope too quickly. In particular, if I later
> do -var-update, I see that in_scope="false"... The following is the
> test program and the GDB session which illustrates my question.
> Basically, I put a breakpoint in the function foo below. This function
> gets called 4 times with 2 different stacks. If I use "display a" the
> first time I hit the breakpoint, the variable a gets displayed on all
> subsequent hits. However, if I do instead "-var-create - * a" the
> first time the breakpoint is hit and then do "-var-update 1 *" each
> subsequent time the break-point is hit, I only see 'in_scope="true"'
> the two times when foo() is reached with exactly the same stack. Is
> this expected? Is there an equivalent of gdb's "display" command for
GDB/MI documentation in CVS HEAD describes this.