This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Have block_innermost_frame start from selected frame

> From: Paul Hilfinger <>
> Date: Fri, 30 Dec 2011 16:52:22 -0500 (EST)
> @@ -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

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

> +@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".

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]