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]

[patch] doc: Document macros defined from command-line


Hi,

http://sourceware.org/ml/gdb-patches/2009-03/msg00026.html
On Tue, 03 Mar 2009 01:54:30 +0100, Joel Brobecker wrote:
> Regarding whether or not we should print line "0" or "command-line",
> in the absence of further comments from other contributors, I suggest
> we follow your approach of keeping this as is - but with some extra
> documentation just to make it clear what the zero means.  The
> documentation patch can be proposed separately from this patch, since
> it would document the existing behavior.

Here it is.


Thanks,
Jan


gdb/doc/
	* gdb.texinfo (Macros): A new part on coomand-line defined macros.

--- gdb/doc/gdb.texinfo	5 Mar 2009 23:11:11 -0000	1.561
+++ gdb/doc/gdb.texinfo	6 Mar 2009 20:41:17 -0000
@@ -8506,6 +8506,19 @@ $2 = 0
 (@value{GDBP})
 @end smallexample
 
+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:
+
+@smallexample
+(@value{GDBP}) info macro __STDC__
+(gdb) info macro __STDC__
+Defined at /home/jimb/gdb/macros/play/sample.c:0
+#define __STDC__ 1
+(@value{GDBP})
+@end smallexample
+
 
 @node Tracepoints
 @chapter Tracepoints


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