This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Which MI behavior is correct ?


Maxim Grigoriev <maxim@tensilica.com> writes:
> This seems to be an answer to my question. The behavior has changed
> probably since somewhere around 6.3. Now, variable objects are associated
> with the frame, not with the function. As you can see in gdb 6.3 case
> ( NATIVE.log ), variables "var1" and "var2" were successfully reused,
> when new frame was allocated after hitting the breakpoint second time.
> In 6.5+ (XTENSA.log), we have to recreate variable objects every time
> we have a new frame because the old variables are out of scope.

Just to connect this old thread with newer conversation:

To avoid recreating variable objects, you probably want to pass '@' as
your frame to -var-create.  This makes the varobj re-parse and
re-evaluate the expression using the currently selected frame at each
update.

Old-style varobjs that use '*' or an address as their frame should
never come back into scope once their frame is popped.  If they do,
it's a fluke.

The '@' syntax is undocumented; I posted a manual patch based on some
experimentation and reading the code:

http://sourceware.org/ml/gdb-patches/2007-05/msg00397.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]