OSDN Git Service

* dwarf2out.c (lookup_filename): Emit .file if the assembler
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 17 Mar 2001 18:18:12 +0000 (18:18 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 17 Mar 2001 18:18:12 +0000 (18:18 +0000)
        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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40578 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/configure
gcc/configure.in
gcc/dwarf2out.c

index 6505108..fadf0f2 100644 (file)
@@ -1,3 +1,11 @@
+2001-03-17  Richard Henderson  <rth@redhat.com>
+
+       * 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.
+
 Sat Mar 17 11:52:34 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * combine.c (undobuf): Remove field previous_undos; all refs deleted.
index 28b6041..87562fa 100755 (executable)
@@ -6752,8 +6752,8 @@ then
     gcc_cv_as_dwarf2_debug_line="yes"
   fi
 elif test x$gcc_cv_as != x -a x"$insn" != x ; then
-       echo '  .file 0 "conftest.s"' > conftest.s
-       echo '  .loc 0 3 0' >> conftest.s
+       echo '  .file 1 "conftest.s"' > conftest.s
+       echo '  .loc 1 3 0' >> conftest.s
        echo "  $insn" >> conftest.s
        # ??? This fails with non-gnu grep.
        if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
index 586ecf1..a53bd4d 100644 (file)
@@ -1491,8 +1491,8 @@ then
     gcc_cv_as_dwarf2_debug_line="yes"
   fi
 elif test x$gcc_cv_as != x -a x"$insn" != x ; then
-       echo '  .file 0 "conftest.s"' > conftest.s
-       echo '  .loc 0 3 0' >> conftest.s
+       echo '  .file 1 "conftest.s"' > conftest.s
+       echo '  .loc 1 3 0' >> conftest.s
        echo "  $insn" >> conftest.s
        # ??? This fails with non-gnu grep.
        if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
index b192aab..72b1d4b 100644 (file)
@@ -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