public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: David Blaikie <dblaikie@gmail.com>
Cc: Fangrui Song <maskray@google.com>,
	gcc Mailing List <gcc@gcc.gnu.org>,
	 Lubos Lunak <l.lunak@centrum.cz>,
	Eric Botcazou <botcazou@adacore.com>
Subject: Re: Future debug options: -f* or -g*?
Date: Wed, 02 Sep 2020 13:12:54 +0200	[thread overview]
Message-ID: <020d26d5051df35808045d8a1e70e1c413fe1df8.camel@klomp.org> (raw)
In-Reply-To: <CAENS6Et9DUC=asMMGqnGJ4brkGDBsf5J7eifCJ2EzjKD=rmM5Q@mail.gmail.com>

Hi David,

On Mon, 2020-08-31 at 20:10 -0700, David Blaikie wrote:
> Hey Mark - saw a little of/bits about your presentation at LPC 2020 GNU
> Tools Track (& your thread on on the gdb list about debug_names). Wondering
> if you (or anyone else you know who's contributing to debug info in GCC)
> have some thoughts on this flag naming issue. It'd be great to get some
> alignment between GCC and Clang here, so as we both add new flags going
> forward, at least they're at least categorically consistent for users, even
> if we aren't necessarily implementing the exact same flags/flag names
> (though in the -gsplit-dwarf case, it'd be good for any new semantics/name
> to match exactly).

To be honest I don't have any deep insights here. Sadly it is just a
bit of a mess. Not helped by the fact that some debugging formats, like
DWARF have a number in their name (dwarf2) that might not reflect
actually reflext the version of that format (except for it being not-
dwarf1). That is why I was suggesting to use -fdwarf(32|64) instead of
-gdwarf(32|64) to use for 32 bits vs 64 bits offsets in dwarf(2|3|4|5),
because there are already too many -gdwarf[number] options.

The idea of having any of the -f<debug-option>s not imply -g and having
any of the -g<debug-option>s imply -g seems a good one.

But in general I think these suboptions are all a bit nonsense though.
They are great for tinkering and playing with corner cases of the
debugging format. But I don't think we are helping real developers with
them. To make any of them useful they should be in one of the standard
options that people actually use. Nobody has time (or the specialized
knowledge) to really care about all these suboptions. Once people feel
they need to use any of these suboptions we already lost or the user
has such specialized knowledge that they will know about specific
changes in these options or between compilers.

So just like we have -Wall or -Wextra has groups of warning options
people are likely to use and we have -O1, -O2 and -O3 (I personally
believe -flto should just be in -O3 instead of being a separate
option), we should simply focus on making -g1, -g2 and -g3 have good
defaults. Where -g1 is the minimum needed to do some
profiling/tracing/debugging without needing to map all addresses back
to source completely but can leave out full type trees for example, -g2
is the default for being able to do a useful interactive debugging
session and -g3 adds some (expensive) extras like .debug_macros and
maybe .debug_names, etc.

With respect to -gsplit-dwarf I think it was (in hindsight) a mistake
to put things in a separate (.dwo) file. It is a bit confusing to users
and complicates build systems immensely. I am hoping to implement
-gsplit-dwarf=single using SHF_EXCLUDED for gcc and then make that the
default.

Cheers,

Mark

  reply	other threads:[~2020-09-02 11:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09 19:03 Fangrui Song
2020-07-09 19:28 ` Fangrui Song
2020-07-09 19:29   ` David Blaikie
2020-07-10 19:09   ` Nathan Sidwell
2020-07-29 16:46     ` David Blaikie
2020-09-01  3:10       ` David Blaikie
2020-09-02 11:12         ` Mark Wielaard [this message]
2020-09-02 22:32           ` David Blaikie

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=020d26d5051df35808045d8a1e70e1c413fe1df8.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=botcazou@adacore.com \
    --cc=dblaikie@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=l.lunak@centrum.cz \
    --cc=maskray@google.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).