This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: -var-list --locals proposal
- From: Vladimir Prus <ghost at cs dot msu dot su>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb at sources dot redhat dot com
- Date: Sat, 6 Jan 2007 14:12:54 +0300
- Subject: Re: -var-list --locals proposal
- References: <200701052303.59465.ghost@cs.msu.su> <uvejkzbf4.fsf@gnu.org>
On Saturday 06 January 2007 13:39, Eli Zaretskii wrote:
> > From: Vladimir Prus <ghost@cs.msu.su>
> > Date: Fri, 5 Jan 2007 23:03:59 +0300
> >
> > I propose to introduce a new command:
> >
> > -var-list --locals <frame>
>
> As you explain further, this will actually list all variables that are
> visible in the current scope. So a better name for this command would
> be something like "-var-list --scope FRAME" or "-var-list --frame FRAME".
At the moment, the "KIND" option to -var-list is document as the kind of
objects for which varobjs are creates. Say
-var-list --registers ...
creates varobjs for registers and
-var-list --locals
will create varobjs for locals. On the contrary,
-var-list --frame
would be somewhat inconsistent -- it does not create varobjs for frames.
> > I think that to avoid creating and destroying variable
> > objects as we step though inner blocks, -var-list should construct
> > varobjs for all variables in all blocks of a function.
>
> Won't lazy creation (on as needed basis) be a better strategy?
It might be more efficient. However, different frontend have different ideas
how to show local vars. I believe that XCode, for example, shows all
locals as soon as you enter the function. Lazy creation would prevent such
usage.
- Volodya