Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3489)

Issue 4440072: [patch] Add new -gmlt option for min. debug info with line tables

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 12 months ago by Cary
Modified:
10 years, 8 months ago
Reviewers:
jason, pinskia, Diego Novillo, mrich30, wilson, joseph
CC:
gcc-patches_gcc.gnu.org
Visibility:
Public.

Description

This patch adds a new option, -gmlt, that produces level 1 debug info plus line number tables and inlined subroutine information. (The option is short for "minimum line tables," taken from a similar feature of HP's compilers.) We've been using this option at Google for about a year now, and have found it useful for collecting stack traces with file names and line numbers without having to pay the much larger overhead for full debug info. It's also useful for sample-based profiling, as discriminator information is also available in the line number tables. For optimized code, we've measured binaries built with -g0, -gmlt, and -g2, and found that the total size of a binary compiled with -gmlt is about 2.5x larger than one compiled without debug, while a binary compiled with -g2 is about 6.7x larger. M gcc/common.opt M gcc/doc/invoke.texi M gcc/dwarf2out.c M gcc/opts.c A gcc/testsuite/gcc.dg/debug/dwarf2/mlt1.c A gcc/testsuite/gcc.dg/debug/dwarf2/mlt2.c M gcc/tree-ssa-live.c Tested: bootstrapped on x86_64. Added two new test cases. gcc/ChangeLog: * common.opt (generate_debug_line_table): New global var. (gmlt): New option * dwarf2out.c (GENERATE_MINIMUM_LINE_TABLE): New macro. (add_pubname_string): Test for -gmlt. (add_pubname): Likewise. (add_src_coords_attributes): Likewise. (decls_for_scope): Likewise. (dwarf2out_source_line): Likewise. (dwarf2out_finish): Likewise. * opts.c (finish_options): Force debug info to at least level 1 if -gmlt specified. (common_handle_option): Add OPT_gmlt. (set_debug_level): Set generate_debug_line_table flag. * tree-ssa-live.c (remove_unused_scope_block_p): Test for -gmlt. * doc/invoke.texi (-gmlt): New options gcc/testsuite/ChangeLog: * gcc.dg/debug/dwarf2/mlt1.c: New test. * gcc.dg/debug/dwarf2/mlt2.c: New test.

Patch Set 1 #

Patch Set 2 : [patch] Add new -gmlt option for min. debug info with line tables #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -20 lines) Patch
M gcc/common.opt View 2 chunks +9 lines, -0 lines 0 comments Download
gcc/doc/invoke.texi View 2 chunks +6 lines, -1 line 0 comments Download
M gcc/dwarf2out.c View 8 chunks +28 lines, -17 lines 0 comments Download
M gcc/opts.c View 1 3 chunks +18 lines, -0 lines 0 comments Download
A gcc/testsuite/gcc.dg/debug/dwarf2/mlt1.c View 1 chunk +32 lines, -0 lines 0 comments Download
A gcc/testsuite/gcc.dg/debug/dwarf2/mlt2.c View 1 chunk +31 lines, -0 lines 0 comments Download
M gcc/tree-ssa-live.c View 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 14
Cary
This patch adds a new option, -gmlt, that produces level 1 debug info plus line ...
12 years, 12 months ago (2011-04-26 22:44:33 UTC) #1
pinskia_gmail.com
On Tue, Apr 26, 2011 at 3:44 PM, Cary Coutant <ccoutant@google.com> wrote: > This patch ...
12 years, 12 months ago (2011-04-26 22:47:09 UTC) #2
Cary
>> This patch adds a new option, -gmlt, that produces level 1 debug info >> ...
12 years, 12 months ago (2011-04-26 22:57:37 UTC) #3
pinskia_gmail.com
On Tue, Apr 26, 2011 at 3:57 PM, Cary Coutant <ccoutant@google.com> wrote: > If we ...
12 years, 12 months ago (2011-04-26 23:00:39 UTC) #4
Cary
> Well I think -g1 -g should act like how -O2 -O works. That is ...
12 years, 12 months ago (2011-04-26 23:14:37 UTC) #5
joseph_codesourcery.com
On Tue, 26 Apr 2011, Cary Coutant wrote: > @@ -1856,6 +1871,8 @@ set_debug_level (enum ...
12 years, 12 months ago (2011-04-27 10:07:18 UTC) #6
Cary
>> + generate_debug_line_table = debug_info_level >= DINFO_LEVEL_NORMAL; > > set_debug_level should not use global state; ...
12 years, 12 months ago (2011-04-27 17:45:12 UTC) #7
Cary
>> set_debug_level should not use global state; this needs to check >> opts->x_debug_info_level (not the ...
12 years, 12 months ago (2011-04-27 20:24:23 UTC) #8
Diego Novillo
On Wed, Apr 27, 2011 at 16:24, Cary Coutant <ccoutant@google.com> wrote: >>> set_debug_level should not ...
12 years, 11 months ago (2011-04-29 20:41:08 UTC) #9
jason_redhat.com
On 04/26/2011 06:57 PM, Cary Coutant wrote: > I considered just changing -g1 to do ...
12 years, 11 months ago (2011-05-03 20:24:42 UTC) #10
Cary
Ping. http://gcc.gnu.org/ml/gcc-patches/2011-04/msg02075.html http://gcc.gnu.org/ml/gcc-patches/2011-04/msg02155.html Should I prepare a patch that does this at -g1, and makes ...
12 years, 11 months ago (2011-05-06 17:43:41 UTC) #11
wilson_tuliptree.org
On Tue, 2011-05-03 at 16:24 -0400, Jason Merrill wrote: > That makes sense to me; ...
12 years, 11 months ago (2011-05-09 20:48:17 UTC) #12
mrich30
> I'm not aware of any significant use of -g1. It is very rare for ...
10 years, 8 months ago (2013-07-28 16:14:24 UTC) #13
Cary
10 years, 8 months ago (2013-07-29 23:53:49 UTC) #14
> Is anyone still working on this?
>
> It would be very useful to include this option in gcc trunk, and have
> either -g1 or -gmlt emit line number information. This saves
> considerable space and time during compilation for large builds where
> full debug info is not needed, but line numbers in stack traces are
> still helpful (e.g. regression testing opt builds)
>
> If I can help somehow, please let me know how.

I sent a revised patch a few months ago:

   http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00260.html

But got no response at all. I had intended to ping it after Stage 1
reopened, but I didn't get around to it (it's been a low priority).
I'll ping it to get approval for the parts that are outside dwarf2out
proper, and try to get it committed soon. Sorry for the delay.

-cary
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b