Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Vladimir Prus <ghost@cs.msu.su>
Cc: Eli Zaretskii <eliz@gnu.org>, gdb@sources.redhat.com
Subject: Re: -var-list --locals proposal
Date: Sat, 06 Jan 2007 21:51:00 -0000	[thread overview]
Message-ID: <17824.6599.480753.426058@kahikatea.snap.net.nz> (raw)
In-Reply-To: <200701061527.37603.ghost@cs.msu.su>

 > > > will create varobjs for locals. On the contrary,
 > > > 
 > > > 	-var-list --frame
 > > > 
 > > > would be somewhat inconsistent -- it does not create varobjs for frames.
 > > 
 > > Then perhaps we shouldn't reuse -var-list for this, but instead create
 > > a new command entirely.
 > 
 > Or use:
 > 
 > 	-var-list --all-locals-in-frame
 > 
 > ? I don't want to introduce too many commands similar commands.

Perhaps we could use Apple's "-stack-list-locals --create-varobjs" which would
minimise divergence, and "-var-list-registers" which is analogous to
"-var-list-children".  Also maybe "-var-list --locals" would share more code
with the existing -stack-list-locals than with the proposed
"-var-list --registers".

 > > > > > 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.

I've not seen XCode but Insight only shows the variables that are in scope
are displayed initially and others appear as they come into scope.  Then
as variables go out of scope they are greyed out.

 > > We shouldn't punish all front-ends because of what one of them does.
 > 
 > At this point, it's not clear if:
 > 
 > 	1. Any frontend would need any other behaviour.
 > 	2. What the performance overhead would be.


All GDB has to do is:

a) Report whether the variable is in scope when the variable object is
   created.

b) Report when it comes into/goes out of scope (as already done).

And the frontend developer can choose the behaviour.

 > > We could cater to XCode by providing a switch to do what it wants.

Apple have their own version of GDB so there is no need for a switch.

 > I don't think we should introduce switches until a need for such switch
 > is demonstrated by a frontend that uses the current gdb version
 > and has some issue with that.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


  reply	other threads:[~2007-01-06 21:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-05 20:04 Vladimir Prus
2007-01-06 10:39 ` Eli Zaretskii
2007-01-06 11:14   ` Vladimir Prus
2007-01-06 11:24     ` Eli Zaretskii
2007-01-06 12:28       ` Vladimir Prus
2007-01-06 21:51         ` Nick Roberts [this message]
2007-01-16  6:57           ` Vladimir Prus
2007-01-10  3:38 ` Daniel Jacobowitz
2007-01-16  7:01   ` Vladimir Prus
2007-01-16  7:18     ` Daniel Jacobowitz
2007-01-16 16:20       ` Vladimir Prus
2007-01-16 22:52         ` Nick Roberts
2007-01-16 23:12           ` Vladimir Prus
2007-01-17  7:54             ` Nick Roberts
2007-01-17 21:34               ` Vladimir Prus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17824.6599.480753.426058@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=eliz@gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=ghost@cs.msu.su \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox