Output filepath strings in .debug_line_str for DWARF5
authorMark Wielaard <mark@klomp.org>
Fri, 18 Sep 2020 15:07:03 +0000 (17:07 +0200)
committerMark Wielaard <mark@klomp.org>
Wed, 7 Oct 2020 10:22:43 +0000 (12:22 +0200)
commitd22eecf8754cc22c7a19bfab9834f6d918c7838d
tree550d74f20bf21343b41ea79e745f62a9e60c6c41
parent6923255e35a3d54f2083ad0f67edebb3f1b86506
Output filepath strings in .debug_line_str for DWARF5

DWARF5 has a new string table specially for file paths. .debug_line
file and dir tables reference strings in .debug_line_str.  If a
.debug_line_str section is emitted then also place CU DIE file
names and comp dirs there.

gcc/ChangeLog:

* dwarf2out.c (add_filepath_AT_string): New function.
(asm_outputs_debug_line_str): Likewise.
(add_filename_attribute): Likewise.
(add_comp_dir_attribute): Call add_filepath_AT_string.
(gen_compile_unit_die): Call add_filename_attribute for name.
(init_sections_and_labels): Init debug_line_str_section when
asm_outputs_debug_line_str return true.
(dwarf2out_early_finish): Remove DW_AT_name and DW_AT_comp_dir
hack and call add_filename_attribute for the remap_debug_filename.
gcc/dwarf2out.c