Understanding GDB frames

Maxim Grigoriev maxim@tensilica.com
Tue May 22 21:12:00 GMT 2007


>> -var-create - @ myvar

I tried it with my test case, and it did introduce an improvement 
working as described in b).

It works in the latest GNU GDB, but it does not seem to 
present/implemented in, say, GNU GDB 6.3 and 6.5.
We have to merge it from the top of the tree as soon as possible.

Thanks for pointing to this feature.

-- Maxim


Nick Roberts wrote:
>  > It seems at the MI interface one wants a choice of whether a varobj
>  > is associated with:
>  >   (a) a specific frame (goes away when function returns)
>  >   (b) a function
>  >   (c) a function at the same depth (which some implement)
>
> GDB already does something like (b) if you use:
>
> -var-create - @ myvar
>
> although it's not documented.  I think this can specifically be used in the
> case of recursion
>
>  > How the distinction is made at the GUI level is a separate question.
>  > And what to do in the event of recursion when one selected a
>  > function-level varobj (b) is also an interesting question -- perhaps
>  > it always refers to the topmost instance (or to theseparately selected
>  > instance if the currently selected stack depth is to that function).
>  > 
>  > That way, (b) and (c) have less performance impact, and one of them
>  > could be the default.  And (a) being optional, could be fully supported
>  > like watchpoints by setting a breakpoint at the return PC, even though
>  > it has a performance hit (especially in the presence of recursion).
>  > 
>  > And perhaps MI docs could even document this  ;-)
>
> If you want this functionality in GDB then I think you will have to contribute
> it.
>
>   



More information about the Gdb mailing list