Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Rob Quill" <rob.quill@gmail.com>
To: jimb@red-bean.com, gdb-patches@sourceware.org
Subject: Re: New scope checking patch
Date: Wed, 30 Jan 2008 13:11:00 -0000	[thread overview]
Message-ID: <baf6008d0801300405i47646b05pdb799d32ab71e005@mail.gmail.com> (raw)
In-Reply-To: <m34pda7ira.fsf@codesourcery.com>

On 19/01/2008, Jim Blandy <jimb@codesourcery.com> wrote:
>
> "Rob Quill" <rob.quill at gmail.com> writes:
> > 2008-01-18   Rob Quill <rob.quill@gmail.com>
> >
> >          Add $in_scope as a type of expression.
> >          * c-exp.y (IN_SCOPE): New token.
> >          (exp): IN_SCOPE (name): evaluates to 1 if name is in scope, 0
> > otherwise.
> >          (yylex): Match "$in_scope" as IN_SCOPE token
>
> This looks good.
>
> I see you've got your copyright paperwork filed with the FSF.
>
> If you haven't already (and only if you haven't already), you'll need
> to visit:
>
> http://sourceware.org/cgi-bin/pdw/ps_form.cgi
>
> to get added to the gdb project; list me as your approver.
>
> Since this is a user-visible feature, it needs documentation.  Write
> up a patch to doc/gdb.texinfo, make sure it looks okay in .info and
> PDF form, and post the patch to the .texinfo file here.  I think this
> also needs an entry in gdb/NEWS.

Hi,

I have attached the docs patch below. I wasn't sure how much to put in
the docs, so I just put a small paragraph in the place which seemed
most appropriate. Any feedback is much appreciated.

Rob

2008-01-18   Rob Quill <rob.quill@gmail.com>

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

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.
+
 * New native configurations

 NetBSD/hppa			hppa*-*netbsd*
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.463
diff -u -p -r1.463 gdb.texinfo
--- gdb/doc/gdb.texinfo	30 Jan 2008 04:27:11 -0000	1.463
+++ gdb/doc/gdb.texinfo	30 Jan 2008 11:56:35 -0000
@@ -5676,6 +5676,13 @@ scope resolution operator in @value{GDBN
 @c FIXME: Um, so what happens in one of those rare cases where it's in
 @c conflict??  --mew

+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
+as it means that the script will ot stop executing if a variable is
not in scope,
+provided that you check if it is in scope before you test it's value.
The operator
+only works on variables and will not work on structure members or
array elements
+for instance.
+
 @cindex wrong values
 @cindex variable values, wrong
 @cindex function entry/exit, wrong values of variables


  reply	other threads:[~2008-01-30 12:06 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12 16:29 Rob Quill
2007-11-12 23:26 ` Michael Snyder
2008-01-10  1:00 ` Jim Blandy
2008-01-11  0:52   ` Rob Quill
2008-01-11 22:51     ` Jim Blandy
2008-01-14 23:07       ` Michael Snyder
2008-01-15 17:06         ` Jim Blandy
2008-01-17 19:32       ` Rob Quill
2008-01-17 20:15         ` Jim Blandy
2008-01-17 21:11           ` Rob Quill
2008-01-17 21:58             ` Jim Blandy
2008-01-17 23:40               ` Doug Evans
2008-01-18  1:31               ` Daniel Jacobowitz
2008-01-18  3:35               ` Rob Quill
2008-01-18 18:48                 ` Jim Blandy
2008-01-18 22:43                   ` Rob Quill
2008-01-19  0:38                     ` Jim Blandy
2008-01-30 13:11                       ` Rob Quill [this message]
2008-01-30 18:14                         ` Jim Blandy
2008-01-30 18:31                         ` Eli Zaretskii
2008-01-31  4:11                           ` Jim Blandy
2008-01-31  7:26                             ` Eli Zaretskii
2008-07-27 23:45                               ` Rob Quill
2008-07-28  3:18                                 ` Eli Zaretskii
2008-07-28 10:31                                   ` Rob Quill
2008-07-28 18:27                                     ` Eli Zaretskii
2008-07-29 20:31                                 ` Tom Tromey
2008-07-29 21:04                                   ` Rob Quill
2008-07-29 21:45                                     ` Tom Tromey
2008-07-29 22:53                                       ` Rob Quill
2008-07-30  3:34                                     ` Tom Tromey
2008-10-23 13:42                                       ` Convenience functions (was: Re: New scope checking patch) Daniel Jacobowitz
2008-10-23 15:17                                         ` Convenience functions Tom Tromey
2008-10-23 15:22                                           ` Daniel Jacobowitz
2008-10-23 15:26                                             ` Tom Tromey
2008-10-23 19:14                                             ` Tom Tromey
2008-10-24 12:53                                               ` Eli Zaretskii
2008-11-04 21:37                                         ` Convenience functions (was: Re: New scope checking patch) Thiago Jung Bauermann
2008-11-04 22:23                                           ` Daniel Jacobowitz
2008-11-04 22:43                                             ` Convenience functions Tom Tromey
2008-01-31  7:52                             ` New scope checking patch Michael Snyder
2008-01-19  1:35                     ` 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=baf6008d0801300405i47646b05pdb799d32ab71e005@mail.gmail.com \
    --to=rob.quill@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jimb@red-bean.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