Re: New scope checking patch

Eli Zaretskii
2008-01-30T18:21:57Z

> Date: Wed, 30 Jan 2008 12:05:35 +0000
> From: "Rob Quill" <rob.quill@gmail.com>
>
> I have attached the docs patch below.

Thanks.

> I wasn't sure how much to put in the docs

Imagine yourself reading the manual and put there as much stuff as you
would like to find if you were reading about this feature for the
first time.

> Any feedback is much appreciated.

I have some comments below.

> * gdb.texinfo (Program Variables): Add a small paragraph about
> the $in_scope operator.

The name in parentheses should be the name of the node, not the
chapter/section.

I actually think that this feature should be described in the node
"Convenience Vars", not in "Variables". The latter describes how to
refer to variables in the program being debugged; while $in_scope is
related (and should perhaps be cross-referenced from "Variables"),
that is not the right place for describing GDB built-ins.

> Index: gdb/NEWS
> ===================================================================
> RCS file: /cvs/src/src/gdb/NEWS,v
> retrieving revision 1.254
> diff -u -p -r1.254 NEWS
> --- gdb/NEWS 30 Jan 2008 00:51:49 -0000 1.254
> +++ gdb/NEWS 30 Jan 2008 11:56:12 -0000
> @@ -3,6 +3,12 @@
>
> *** Changes since GDB 6.7
>
> +* New expression type
> +
> +$in_scope(...)
> + The value of this expression is 1 if the variable within the
> + parentheses is within the current scope, 0 otherwise.

This is okay.

> +The @code{$in_scope} operator can be used to check if a variable is in scope,
> +returning 1 if it is and 0 if it is not. This is most useful when scripting GDB

Two spaces after a period that ends a sentence, please.

Also, please use @value{GDBN} instead of a literal "GDB", as we do
elsewhere in the manual.

Finally, please add index entries for this feature. I suggest these:

@vindex $in_scope
@cindex variable in scope, testing