aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-03-17 10:18:12 -0800
committerRichard Henderson <rth@gcc.gnu.org>2001-03-17 10:18:12 -0800
commitacc187f5075f71862f71fea9bcb6efa0d4ce8751 (patch)
tree8521ea8c7791dc00e81d7eec6428546cf5ef129f /gcc/dwarf2out.c
parentf1c6ba8bd13aa28aabbabbf75c8e1611bc462bd8 (diff)
downloadgcc-acc187f5075f71862f71fea9bcb6efa0d4ce8751.zip
gcc-acc187f5075f71862f71fea9bcb6efa0d4ce8751.tar.gz
gcc-acc187f5075f71862f71fea9bcb6efa0d4ce8751.tar.bz2
dwarf2out.c (lookup_filename): Emit .file if the assembler is generating .debug_line.
* dwarf2out.c (lookup_filename): Emit .file if the assembler is generating .debug_line. (dwarf2out_init): Add main_input_filename to the file table first. * configure.in (as_dwarf2_debug_line): Test with file number 1 instead of file number 0. From-SVN: r40578
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index b192aab..72b1d4b 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -10723,6 +10723,9 @@ lookup_filename (file_name)
file_table.in_use = i + 1;
file_table.last_lookup_index = i;
+ if (DWARF2_ASM_LINE_DEBUG_INFO)
+ fprintf (asm_out_file, "\t.file %u \"%s\"\n", i, file_name);
+
return i;
}
@@ -10885,10 +10888,15 @@ dwarf2out_init (asm_out_file, main_input_filename)
register FILE *asm_out_file;
register const char *main_input_filename;
{
+ init_file_table ();
+
/* Remember the name of the primary input file. */
primary_filename = main_input_filename;
- init_file_table ();
+ /* Add it to the file table first, under the assumption that we'll
+ be emitting line number data for it first, which avoids having
+ to add an initial DW_LNS_set_file. */
+ lookup_filename (main_input_filename);
/* Allocate the initial hunk of the decl_die_table. */
decl_die_table