r220270 - in /branches/google/gcc-4_9/gcc: comm...
ccoutant@gcc.gnu.org
ccoutant@gcc.gnu.org
Fri Jan 30 00:50:00 GMT 2015
Author: ccoutant
Date: Fri Jan 30 00:50:32 2015
New Revision: 220270
URL: https://gcc.gnu.org/viewcvs?rev=220270&root=gcc&view=rev
Log:
Add -ftwo-level-line-tables and -gline-tables-only options.
With -ftwo-level-line-tables, GCC will generate two-level line tables,
which adds inline call information to the line tables, obviating the
need to keep bulky debug info around for the purposes of generating
stack traces.
The -gline-tables-only option suppresses all other debug info except
the single DW_AT_compilation_unit DIE that points to the line table
for that compilation unit, and any .debug_ranges entries needed for
that DIE.
Two-level line tables are being proposed for the DWARF version 6
standard, and are described here:
http://dwarfstd.org/ShowIssue.php?issue=140906.1
http://wiki.dwarfstd.org/index.php?title=TwoLevelLineTables
In order to generate two-level line tables, GCC requires support
from the assembler, in the form of new .subprog and .lloc pseudo-ops.
This patch is for the google/gcc-4_9 branch. I plan to propose it
for trunk after we gain more experience with it.
2015-01-23 Cary Coutant <ccoutant@google.com>
gcc/
* common.opt (-ftwo-level-line-tables): New option.
(-gline-tables-only): New option.
* dwarf2out.c (struct dw_line_info_table_struct): Add subprog_num
and context fields.
(dwarf2out_abstract_function): Check for line tables only.
(dwarf2out_decl): Likewise.
(block_stack): New variable.
(dwarf2out_begin_block): For two-level line tables, keep a stack of
current blocks.
(dwarf2out_end_block): Likewise.
(dwarf2out_var_location): Check for line tables only.
(new_line_info_table): Initialize subprog_num and context fields.
(struct subprog_entry): New type.
(struct subprog_hasher): New type.
(subprog_hasher::hash): New function.
(subprog_hasher::equal): New function.
(subprog_table): New variable.
(last_subprog_num): New variable.
(add_subprog_entry): New function.
(struct block_entry): New type.
(struct block_hasher): New type.
(block_hasher::hash): New function.
(block_hasher::equal): New function.
(block_table): New variable.
(struct logical_entry): New type.
(struct logical_hasher): New type.
(logical_hasher::hash): New function.
(logical_hasher::equal): New function.
(logical_table): New variable.
(last_logical_num): New variable.
(scan_blocks_for_inlined_calls): New function.
(dwarf2out_begin_function): For two-level line tables, build map
of blocks to inlined call stacks.
(out_subprog_directive): New function.
(out_logical_entry): New function.
(dwarf2out_source_line): Add support for two-level line tables.
(dwarf2out_init): Create subprog_table, block_table, and logical_table.
(dwarf2out_finish): When -gline-tables-only is set, always output
the compilation_unit DIE; don't output aranges table.
* final.c (final_start_function): Move call to number blocks...
(rest_of_handle_final): ... to here.
* opts.c (common_handle_option): Add -gline-tables-only.
(set_debug_level): Clear debug_line_tables_only flag.
Modified:
branches/google/gcc-4_9/gcc/common.opt
branches/google/gcc-4_9/gcc/dwarf2out.c
branches/google/gcc-4_9/gcc/final.c
branches/google/gcc-4_9/gcc/opts.c
More information about the Gcc-cvs
mailing list