Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David Carlton <carlton@math.stanford.edu>
To: Michael Elizabeth Chastain <mec@shout.net>
Cc: gdb-patches@sources.redhat.com,
	Daniel Jacobowitz <drow@mvista.com>,
	eliz@gnu.org
Subject: Re: [rfa/doc] correct info about best C++ compilers/debug formats
Date: Mon, 03 Feb 2003 19:29:00 -0000	[thread overview]
Message-ID: <ro13cn59n8b.fsf@jackfruit.Stanford.EDU> (raw)

On Mon, 3 Feb 2003 12:56:22 -0600, Michael Elizabeth Chastain <mec@shout.net> 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


             reply	other threads:[~2003-02-03 19:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-03 19:29 David Carlton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-02-04 14:41 Michael Elizabeth Chastain
2003-02-04  6:24 Michael Elizabeth Chastain
2003-02-04  8:08 ` Eli Zaretskii
2003-02-03 21:21 Michael Elizabeth Chastain
2003-02-04  6:16 ` Eli Zaretskii
     [not found] <200302032008.h13K8M230404@duracef.shout.net>
2003-02-03 20:14 ` David Carlton
2003-02-04  6:08   ` Eli Zaretskii
2003-02-04  7:04     ` Andrew Cagney
2003-02-04 21:17     ` David Carlton
2003-02-05  5:54       ` Eli Zaretskii
2003-02-03 18:27 David Carlton
2003-02-03 18:37 ` Daniel Jacobowitz
2003-02-03 19:23 ` Eli Zaretskii
2003-02-03 20:09   ` David Carlton
2003-02-03 20:49     ` Andrew Cagney
2003-02-04  6:14       ` Eli Zaretskii
2003-02-04  5:59     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ro13cn59n8b.fsf@jackfruit.Stanford.EDU \
    --to=carlton@math.stanford.edu \
    --cc=drow@mvista.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec@shout.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox