From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14795 invoked by alias); 6 Mar 2009 20:46:45 -0000 Received: (qmail 14786 invoked by uid 22791); 6 Mar 2009 20:46:45 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_37,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Mar 2009 20:46:39 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n26KkZuv001415; Fri, 6 Mar 2009 15:46:35 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n26KkZ4J004033; Fri, 6 Mar 2009 15:46:35 -0500 Received: from host0.dyn.jankratochvil.net (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n26KkYGn006233; Fri, 6 Mar 2009 15:46:34 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n26KkWjt027621; Fri, 6 Mar 2009 21:46:32 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.2/Submit) id n26KkWnG027618; Fri, 6 Mar 2009 21:46:32 +0100 Date: Fri, 06 Mar 2009 20:46:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Joel Brobecker Subject: [patch] doc: Document macros defined from command-line Message-ID: <20090306204631.GA27092@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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 Mail-Followup-To: gdb-patches@sourceware.org X-SW-Source: 2009-03/txt/msg00088.txt.bz2 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