From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3339 invoked by alias); 7 Mar 2009 09:16:19 -0000 Received: (qmail 3330 invoked by uid 22791); 7 Mar 2009 09:16:17 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout7.012.net.il (HELO mtaout7.012.net.il) (84.95.2.19) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 07 Mar 2009 09:16:11 +0000 Received: from conversion-daemon.i-mtaout7.012.net.il by i-mtaout7.012.net.il (HyperSendmail v2007.08) id <0KG400I00PF8TC00@i-mtaout7.012.net.il> for gdb-patches@sourceware.org; Sat, 07 Mar 2009 11:16:15 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.192.247]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KG400DMWPR3GC90@i-mtaout7.012.net.il>; Sat, 07 Mar 2009 11:16:15 +0200 (IST) Date: Sat, 07 Mar 2009 09:16:00 -0000 From: Eli Zaretskii Subject: Re: [patch] doc: Document macros defined from command-line In-reply-to: <20090306204631.GA27092@host0.dyn.jankratochvil.net> To: Jan Kratochvil Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: References: <20090306204631.GA27092@host0.dyn.jankratochvil.net> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-03/txt/msg00091.txt.bz2 > Date: Fri, 6 Mar 2009 21:46:31 +0100 > From: Jan Kratochvil > Cc: Joel Brobecker > > +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.