DescriptionThis 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 #
MessagesTotal messages: 14
|