From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19910 invoked by alias); 3 Feb 2003 20:09:19 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19624 invoked from network); 3 Feb 2003 20:09:16 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 172.16.49.205 with SMTP; 3 Feb 2003 20:09:16 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h13K9AT23650; Mon, 3 Feb 2003 12:09:10 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Eli Zaretskii Cc: gdb-patches@sources.redhat.com, drow@mvista.com, mec@shout.net Subject: Re: [rfa/doc] correct info about best C++ compilers/debug formats References: <1659-Mon03Feb2003211953+0200-eliz@is.elta.co.il> From: David Carlton Date: Mon, 03 Feb 2003 20:09:00 -0000 In-Reply-To: <1659-Mon03Feb2003211953+0200-eliz@is.elta.co.il> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-02/txt/msg00081.txt.bz2 Here's a new version of the patch. It fixes the 'debugg' typo, replaces DWARF 2 with DWARF2, includes the index entries that Eli suggested, and it updates the other two sections that Michael mentioned. I didn't remove the vague sentence that Michael disliked, but I'll remove it if anybody else also dislikes it. OK to commit? David Carlton carlton@math.stanford.edu 2003-02-03 David Carlton * gdb.texinfo (C@t{++}): Recommend DWARF2, then stabs+. (Variables): Recommend stabs+ and DWARF2. (C plus plus expressions): Correct info about compiler versions, debug formats. PR symtab/874. Index: gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.145 diff -u -p -r1.145 gdb.texinfo --- gdb.texinfo 1 Feb 2003 20:51:06 -0000 1.145 +++ gdb.texinfo 3 Feb 2003 20:05:52 -0000 @@ -4711,13 +4711,13 @@ No symbol "foo" in current context. To solve such problems, either recompile without optimizations, or use a different debug info format, if the compiler supports several such -formats. For example, @value{NGCC}, the @sc{gnu} C/C@t{++} compiler usually -supports the @samp{-gstabs} option. @samp{-gstabs} produces debug info -in a format that is superior to formats such as COFF. You may be able -to use DWARF2 (@samp{-gdwarf-2}), which is also an effective form for -debug info. See @ref{Debugging Options,,Options for Debugging Your -Program or @sc{gnu} CC, gcc.info, Using @sc{gnu} CC}, for more -information. +formats. For example, @value{NGCC}, the @sc{gnu} C/C@t{++} compiler +usually supports the @option{-gstabs+} option. @option{-gstabs+} +produces debug info in a format that is superior to formats such as +COFF. You may be able to use DWARF2 (@samp{-gdwarf-2}), which is also +an effective form for debug info. See @ref{Debugging Options,,Options +for Debugging Your Program or @sc{gnu} CC, gcc.info, Using @sc{gnu} CC}, +for more information. @node Arrays @@ -7812,9 +7812,10 @@ effectively, you must compile your C@t{+ C@t{++} compiler, such as @sc{gnu} @code{g++}, or the HP ANSI C@t{++} compiler (@code{aCC}). -For best results when using @sc{gnu} C@t{++}, use the stabs debugging -format. You can select that format explicitly with the @code{g++} -command-line options @samp{-gstabs} or @samp{-gstabs+}. See +For best results when using @sc{gnu} C@t{++}, use the DWARF2 debugging +format; if it doesn't work on your system, try the stabs@t{+} debugging +format. You can select those formats explicitly with the @code{g++} +command-line options @samp{-gdwarf-2} and @samp{-gstabs+}. See @ref{Debugging Options,,Options for Debugging Your Program or @sc{gnu} CC, gcc.info, Using @sc{gnu} CC}, for more information. @@ -8062,28 +8063,19 @@ and @samp{@{&"hi", &"there", &"fred"@}} @cindex expressions in C@t{++} @value{GDBN} expression handling can interpret most C@t{++} expressions. -@cindex C@t{++} support, not in @sc{coff} -@cindex @sc{coff} versus C@t{++} -@cindex C@t{++} and object formats -@cindex object formats and C@t{++} -@cindex a.out and C@t{++} -@cindex @sc{ecoff} and C@t{++} -@cindex @sc{xcoff} and C@t{++} -@cindex @sc{elf}/stabs and C@t{++} -@cindex @sc{elf}/@sc{dwarf} and C@t{++} -@c FIXME!! GDB may eventually be able to debug C++ using DWARF; check -@c periodically whether this has happened... +@cindex debugging C@t{++} programs +@cindex C@t{++} compilers +@cindex debug formats and C@t{++} +@cindex @value{NGCC} and C@t{++} @quotation @emph{Warning:} @value{GDBN} can only debug C@t{++} code if you use the -proper compiler. Typically, C@t{++} debugging depends on the use of -additional debugging information in the symbol table, and thus requires -special support. In particular, if your compiler generates a.out, MIPS -@sc{ecoff}, RS/6000 @sc{xcoff}, or @sc{elf} with stabs extensions to the -symbol table, these facilities are all available. (With @sc{gnu} CC, -you can use the @samp{-gstabs} option to request stabs debugging -extensions explicitly.) Where the object code format is standard -@sc{coff} or @sc{dwarf} in @sc{elf}, on the other hand, most of the C@t{++} -support in @value{GDBN} does @emph{not} work. +proper compiler and the proper debug format. Currently, @value{GDBN} +works best when debugging C@t{++} code that is compiled with +@value{NGCC} 2.95.3 or with @value{NGCC} 3.1 or newer, using the options +@option{-gdwarf-2} or @option{-gstabs+}. DWARF2 is preferred over +stabs@t{+}; newer versions of @value{NGCC} use DWARF2 as the default +whenever possible. Other compilers and/or debug formats are likely to +work badly or not at all when using @value{GDBN} to debug C@t{++} code. @end quotation @enumerate