This is the mail archive of the gdb-patches@sourceware.org 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: [patch] doc: Document macros defined from command-line


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


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