From: Paul Hilfinger <Hilfinger@adacore.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Have block_innermost_frame start from selected frame
Date: Sat, 31 Dec 2011 21:40:00 -0000 [thread overview]
Message-ID: <20111231201111.3640592BF6@kwai.gnat.com> (raw)
In-Reply-To: <8339c1td3u.fsf@gnu.org> (message from Eli Zaretskii on Sat, 31 Dec 2011 09:27:33 +0200)
> > @@ -7304,12 +7304,13 @@ examine the variable @code{b} while your program is executing inside
> > the block where @code{b} is declared.
> >
> > @cindex variable name conflict
> > -There is an exception: you can refer to a variable or function whose
> > +You can refer to a variable or function whose
> > scope is a single source file even if the current execution point is not
> > in this file. But it is possible to have more than one such variable or
> > function with the same name (in different source files). If that
> > happens, referring to that name has unpredictable effects. If you wish,
> > -you can specify a static variable in a particular function or file,
> > +you can specify a static variable in a particular function or file by
> > +qualifying its name
> > using the colon-colon (@code{::}) notation:
> >
> > @cindex colon-colon, context for variables/functions
>
> This hunk seems to be limited to changes in style, rather than
> content. Can you tell why you thought these style changes are needed,
> in particular the first one?
>
> Also, I have reservations about using the term "qualifying" for this
> notation. Since we already use "scope resolution" for them in the C++
> context, why not use "scope resolution" for C and other languages as
> well?
>
I'm not wed to these changes. The first one is accidental: I had wanted to
modify the section so that first it talked about unqualified uses and then
turned to qualified uses, not as an "exception" but rather as a separate case.
Apparently, I neglected to modify the preceding portion to specifically say it
concerned unqualified variables.
The second change was to introduce the term "qualified". However, it also
corrects a slight problem---that comma after "file," is out of place, I think.
However, if you don't like "qualifying", I am happy to remove both changes.
> > +unqualified name of the variable. However, you may also use this notation
> > +to refer to local variables in frames enclosing the selected frame:
>
> I'm not sure "enclosing frame" is clear enough. I think we tend to
> use "outer frame" elsewhere in the manual. Alternatively, you could
> use "enclosing scope".
>
Yeah, but I really need to say something like "frames that are at or outside
the selected frame". Would that be understandable terminology, do you think?
I don't like "enclosing scope". We are dealing with statically scoped
languages, where "enclosing scope" usually means "lexically enclosing
scope", and that is not what we are talking about here.
> > +@smallexample
> > +(@value{GDBP}) p a
> > +(@value{GDBP}) p bar::a
> > +(@value{GDBP}) up 2
> > +(@value{GDBP}) p a
> > +(@value{GDBP}) p bar::a
> > +
> > +@end smallexample
>
> Please remove the empty line before "@end smallexample".
Right.
> Anyway, this begs the question: is the scope resolution available only
> for print commands, or also in other commands, like `watch'? If the
> latter can also use this, then I think we should mention that, here
> and where watchpoints are described. If the `watch' command cannot
> use this, then it sounds like we are inconsistent here.
>
Well, since I don't see any circular arguments here, I wouldn't say
that any questions are being begged [sorry: obligatory pedantry
there], but you are certainly right that it does raise the question of
general applicability. The section is about "Program variables" but
all examples use 'print'. Furthermore, you are correct that watch
behaves incorrectly at the moment: it picks up the correct variable
value when 'watch' is issued, but then reverts to the old behavior
when deciding which variable to watch, giving nonsensical results. I
will have to revise the patch. Thanks for catching this.
--
Paul N. Hilfinger
(Hilfinger@adacore.com)
next prev parent reply other threads:[~2011-12-31 20:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-30 21:54 Paul Hilfinger
2011-12-31 8:58 ` Eli Zaretskii
2011-12-31 21:40 ` Paul Hilfinger [this message]
2012-01-09 7:17 ` Paul Hilfinger
2012-01-09 17:14 ` Eli Zaretskii
2012-01-09 19:59 ` Paul Hilfinger
2012-01-10 5:21 ` Joel Brobecker
2012-01-10 10:28 ` Eli Zaretskii
2012-01-10 10:40 ` Joel Brobecker
2012-01-11 10:59 ` [PATCH 1/3] Have block_innermost_frame start from selected frame and document Hilfinger
2012-01-11 15:54 ` [PATCH 2/3] Add testcase for locals identified with FUNCTION::VAR syntax Hilfinger
2012-01-11 10:59 ` [PATCH 3/3] Add test for use of "<block>::<variable>" syntax for locals in watch Hilfinger
-- strict thread matches above, loose matches on Subject: below --
2011-12-27 19:59 [RFA] Have block_innermost_frame start from selected frame Paul Hilfinger
2011-12-28 13:10 ` Jan Kratochvil
2011-12-28 15:41 ` Joel Brobecker
2011-12-28 16:00 ` Jan Kratochvil
2011-12-28 17:23 ` Joel Brobecker
2011-12-29 20:30 ` Paul Hilfinger
2011-12-29 23:13 ` Jan Kratochvil
2011-12-28 15:16 ` Jan Kratochvil
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=20111231201111.3640592BF6@kwai.gnat.com \
--to=hilfinger@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/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