From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12524 invoked by alias); 3 Feb 2003 19:29:44 -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 12516 invoked from network); 3 Feb 2003 19:29:44 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 172.16.49.205 with SMTP; 3 Feb 2003 19:29:44 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h13JTf723573; Mon, 3 Feb 2003 11:29:41 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Michael Elizabeth Chastain Cc: gdb-patches@sources.redhat.com, Daniel Jacobowitz , eliz@gnu.org Subject: Re: [rfa/doc] correct info about best C++ compilers/debug formats From: David Carlton Date: Mon, 03 Feb 2003 19:29:00 -0000 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/msg00080.txt.bz2 On Mon, 3 Feb 2003 12:56:22 -0600, Michael Elizabeth Chastain said: > After fixing the doco, we can kill all the setup_xfail_format dwarf-1 > lines. We can either add a test for dwarf-1 to "skip_cplus_tests", > or we can just let the test suite do its job and report a lot of > FAILs on dwarf-1. I favor the latter. But I would like to discuss > this *after* fixing the docs. Fair enough. > Now the content: > @emph{Warning:} @value{GDBN} can only debug C@t{++} code if you use the > 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+}. DWARF 2 is preferred over > stabs; newer versions of @value{NGCC} use DWARF 2 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 debugg C@t{++} code. > The normal spelling is 'DWARF2' not 'DWARF 2'. I wondered about this. The standard doesn't give any guidance (it says "DWARF Version 2", to me DWARF 2 looks much better, and the GCC option is -gdwarf-2, not -gdwarf2. On the other hand, there are more web pages that refer to it as DWARF2 than web pages that refer to it as DWARF 2. > Also you usually want to say "stabs+", not "stabs". I guess that makes sense. > Also a typo on "debugg". Thanks. > The part about "newer versions of gcc use DWARF 2 as the default > whenever possible" is vague and not accurate enough for doco (I > think). Well, I wanted to include some sort of sentence that reassured users that they probably didn't have to specify the debug format explicitly. Also, if they use a recent version of GCC, they'll probably get the best working debug format by default: if GCC doesn't default to DWARF 2, there's probably a good reason for that. > Some more places need changing: > 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. > --> Change "-gstabs" to "-gstabs+" here. In particular "-gstabs" is > miserable with C++ (I have tested it). > 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 > @ref{Debugging Options,,Options for Debugging Your Program or @sc{gnu} > CC, gcc.info, Using @sc{gnu} CC}, for more information. > --> Rewrite to say 'DWARF2'. Thanks, I'll submit a revised patch including these. David Carlton carlton@math.stanford.edu