This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [build, driver] RFC: Support compressed debug sections
- From: Eric Christopher <echristo at gmail dot com>
- To: Rainer Orth <ro at cebitec dot uni-bielefeld dot de>
- Cc: Mike Stump <mikestump at comcast dot net>, "Joseph S. Myers" <joseph at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Paolo Bonzini <bonzini at gnu dot org>, DJ Delorie <dj at delorie dot com>, Nathanael Nerode <neroden at gcc dot gnu dot org>, Alexandre Oliva <aoliva at redhat dot com>, Gerald Pfeifer <gerald at pfeifer dot com>
- Date: Wed, 4 Jun 2014 11:09:44 -0700
- Subject: Re: [build, driver] RFC: Support compressed debug sections
- Authentication-results: sourceware.org; auth=none
- References: <yddvc7tmhx9 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <Pine dot LNX dot 4 dot 64 dot 1304261553200 dot 27966 at digraph dot polyomino dot org dot uk> <yddd2tcazm5 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <Pine dot LNX dot 4 dot 64 dot 1305032000020 dot 30366 at digraph dot polyomino dot org dot uk> <yddfvy2l9xa dot fsf at CeBiTec dot Uni-Bielefeld dot DE> <Pine dot LNX dot 4 dot 64 dot 1305051411440 dot 16386 at digraph dot polyomino dot org dot uk> <yddtx8if35c dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <Pine dot LNX dot 4 dot 64 dot 1405221547120 dot 11868 at digraph dot polyomino dot org dot uk> <yddiooxzszw dot fsf at CeBiTec dot Uni-Bielefeld dot DE> <Pine dot LNX dot 4 dot 64 dot 1405221632580 dot 11868 at digraph dot polyomino dot org dot uk> <yddr43fabf4 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <ydd1tv68eei dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <C1D9C32F-AA2C-4FA1-B3C0-F07CA35EF5E3 at comcast dot net> <ydd4n016on2 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE>
>> If it is just to reach compatibility with the debugger, then Iâd rather
>> either just mandate a certain debugger or autoconf for what the current
>> debugger supports. As of late people seem to just break the debugging
>> experience with non-updated gdbs and assume that a newer gdb is used.
>
> You cannot do that: unlike the assembler and linker used, which are
> often hardcoded into gcc, the debugger can easily be changed below the
> compiler's feet, so to speak. Besides, on several platforms, you have
> more than one debugger available (like gdb and dbx, or others), so this
> isn't an option. Apart from that, the debugging experience when
> e.g. emitting very recent DWARF extensions and trying to use them with a
> gdb that doesn't understand them usually leads to some debug info
> missing. In this case, emitting compressed debug with a debugger that
> cannot read it leads to the debugger claiming (correctly, from its
> point of view) that there's no debugging info present. I don't want to
> tell users who come complaining `I compiled with -g, but my debugger
> tells me there's no debug info present': `look, your debugger lies, it
> is present, but it cannot read it'. That's a lot worse than the
> DWARF extensions scenario above.
>
Agreed :)
FWIW it's already a gas/assembler option, I'm curious about wanting to
expose it via the compiler?
> On top of all that, compressed debug is a tradeoff: in some cases it may
> be worth it to save space on debug info if disk space is at a premium
> for some reason (e.g. for release builds), but in others you want to
> compile as fast as possible, but assembling and linking compressed debug
> takes more CPU time. Otherwise we could just as well default to -Os,
> telling our users it's better for them since it generates faster and
> smaller code, not minding the compile time cost and worse debugging
> experience.
>
FWIW I've found in some limited timing that compression is nearly
always worth it here at Google - even for compile time given the cost
of writing files versus cpu time. Might be worth making it a default
at some point in the future and making sure the option is invertible.
-eric