From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Michael Snyder <msnyder@vmware.com>,
"gdb\@sourceware.org" <gdb@sourceware.org>
Subject: Re: same-name vars from different scopes
Date: Fri, 19 Mar 2010 17:54:00 -0000 [thread overview]
Message-ID: <m3r5ngxkn1.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20100319052814.GG2858@adacore.com> (Joel Brobecker's message of "Thu, 18 Mar 2010 22:28:14 -0700")
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
>> There's no syntax for printing a local variable which is hidden by a
>> more inner definition.
Joel> In that case, I think you have to switch frames (there might be
Joel> a known bug with Ada on that subject).
Actually, I meant nested lexical scopes:
void f () {
int x = something;
{
int x = something_else;
}
}
If you in the inner scope, you can't refer directly to the outer 'x'.
You can see it with "info locals", but you can't use it in an expression.
Tom
next prev parent reply other threads:[~2010-03-19 17:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-18 23:15 Michael Snyder
2010-03-19 1:54 ` Tom Tromey
2010-03-19 5:28 ` Joel Brobecker
2010-03-19 17:54 ` Tom Tromey [this message]
2010-03-19 17:41 ` Michael Snyder
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=m3r5ngxkn1.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb@sourceware.org \
--cc=msnyder@vmware.com \
/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