RFA: info macro [-at LOCATION,]
Commit Message
Eli Zaretskii <eliz@gnu.org> wrote:
> > From: David Taylor <dtaylor@emc.com>
> > Date: Mon, 10 Nov 2014 16:41:33 -0500
> >
> > A few releases ago it was possible to set a location that would be used
> > by 'info location' by typing something like:
> >
> > list file.c:42
> >
> > and then do:
> >
> > info macro MACRONAME
> >
> > . Sometime between release 7.1 and 7.8 that stopped working.
> >
> > The following patch adds the option [-at LOCATION,] to 'info macro' to
> > enable the use of a user selected location as a documented feature.
> >
> > Three files, three change log entries:
>
> Thanks. I think this warrants a NEWS entry as well.
Thanks. How are diffs for NEWS handled? For the text, how about:
* New options
The info macro command now takes an optional location ([-at LOCATION,])
for determining which definition, if any, of the macro is in scope. If
left unspecified it, as before, uses the source and line associated with
the current program counter.
> > gdb/doc/ChangeLog:
> >
> > 2014-11-10 David Taylor <dtaylor@emc.com>
> >
> > * gdb.texinfo: Document new -at LOCATION option of the 'info
> > macro' command.
>
> Please state the node in which the change was made (as if it were a
> function, i.e. in parentheses).
Okay, how about:
2014-11-10 David Taylor <dtaylor@emc.com>
* gdb.texinfo (Macros): Document new -at LOCATION option of
the 'info macro' command.
> > -@item info macro [-a|-all] [--] @var{macro}
> > +@item info macro [-a|-all] [-at LOCATION,] [--] @var{macro}
> > Show the current definition or all definitions of the named @var{macro},
> > and describe the source location or compiler command-line where that
> > definition was established. The optional double dash is to signify the end of
> > argument processing and the beginning of @var{macro} for non C-like macros where
> > -the macro may begin with a hyphen.
> > +the macro may begin with a hyphen. If the optional LOCATION is specified,
> > +it is used instead of the current location.
>
> First, "LOCATION" should be "@var{location}", as it is a parameter,
> not a literal string.
Easy enough. Done.
> And second, "it is used instead of the current location" leaves too
> much unsaid. The reader will wonder why does location matter for this
> purpose. I suggest to make that explicit in the text.
I'm not sure how to word it nor exactly what you are looking for.
How about the following for the gdb/doc/gdb.texinfo piece:
Thanks for reviewing the doc changes so quickly.
Comments
> cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
> Date: Tue, 11 Nov 2014 09:01:15 -0500
> From: David Taylor <dtaylor@usendtaylorx2l.lss.emc.com>
>
> > Thanks. I think this warrants a NEWS entry as well.
>
> Thanks. How are diffs for NEWS handled?
Like any other file you modify.
> For the text, how about:
>
> * New options
>
> The info macro command now takes an optional location ([-at LOCATION,])
> for determining which definition, if any, of the macro is in scope. If
> left unspecified it, as before, uses the source and line associated with
> the current program counter.
Fine with me, thanks.
> > > * gdb.texinfo: Document new -at LOCATION option of the 'info
> > > macro' command.
> >
> > Please state the node in which the change was made (as if it were a
> > function, i.e. in parentheses).
>
> Okay, how about:
>
> 2014-11-10 David Taylor <dtaylor@emc.com>
>
> * gdb.texinfo (Macros): Document new -at LOCATION option of
> the 'info macro' command.
OK.
> > And second, "it is used instead of the current location" leaves too
> > much unsaid. The reader will wonder why does location matter for this
> > purpose. I suggest to make that explicit in the text.
>
> I'm not sure how to word it nor exactly what you are looking for.
> How about the following for the gdb/doc/gdb.texinfo piece:
Sounds good to me.
> Thanks for reviewing the doc changes so quickly.
Thanks for working on this in the first place.
===================================================================
RCS file: /home/cvsroot/GDB/gdb/doc/gdb.texinfo,v
retrieving revision 1.3
@@ -11412,12 +11412,15 @@
@cindex macro definition, showing
@cindex definition of a macro, showing
@cindex macros, from debug info
-@item info macro [-a|-all] [--] @var{macro}
+@item info macro [-a|-all] [-at LOCATION,] [--] @var{macro}
Show the current definition or all definitions of the named @var{macro},
and describe the source location or compiler command-line where that
-definition was established. The optional double dash is to signify the end of
-argument processing and the beginning of @var{macro} for non C-like macros where
-the macro may begin with a hyphen.
+definition was established. The optional double dash is to signify the
+end of argument processing and the beginning of @var{macro} for non
+C-like macros where the macro may begin with a hyphen. If the optional
+@var{location} is specified, it is used to determine which definition,
+if any, of the macro is in scope; otherwise, as before, it uses the
+source and line asociated with the current program counter.
@kindex info macros
@item info macros @var{linespec}