This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] doc: Document macros defined from command-line
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 07 Mar 2009 11:16:10 +0200
- Subject: Re: [patch] doc: Document macros defined from command-line
- References: <20090306204631.GA27092@host0.dyn.jankratochvil.net>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 6 Mar 2009 21:46:31 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: Joel Brobecker <brobecker@adacore.com>
>
> +Printed definition line number will be zero for macros defined from the
> +compiler command-line. Unix compilers use the option @samp{-Dname=value} for
> +such definitions. @value{GDBN} displays in this case a name of the main source
> +file being compiled when the macro has been defined:
I suggest to reword like this:
In addition to source files, macros can be defined on the
compilation command line using the @option{-D@var{name}=@var{value}}
syntax. For macros defined in such a way, @value{GDBN} displays the
location of their definition as line zero of the source file
submitted to the compiler.
The changes I made are:
. Tell about the way of defining macros before describing what GDB
does in that case.
. Don't qualify the -Dfoo=bar feature by "Unix", since on non-Unix
platforms GDB supports only GCC-produced debug info.
. Use @var for meta-syntactic variables that stand for something
else.
> +@smallexample
> +(@value{GDBP}) info macro __STDC__
> +(gdb) info macro __STDC__
I think this second line is redundant. At least in my testing, GDB
does not display it.
> +Defined at /home/jimb/gdb/macros/play/sample.c:0
> +#define __STDC__ 1
Should we perhaps show "-D__STDC__=1" here?
Also, perhaps add a short notice of this feature at the beginning of
the section, where "info macro" is described.
Other than that, the patch is fine.
Thanks.