OSDN Git Service

* dbxout.c (dbxout_really_begin_function): Rename to
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jul 2001 19:47:58 +0000 (19:47 +0000)
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jul 2001 19:47:58 +0000 (19:47 +0000)
dbxout_begin_function.
(dbx_debug_hooks, xcoff_debug_hooks): Update.
(dbxout_begin_function): Remove.
(dbxout_function): Update.
(dbxout_source_line): Update prototype.
* dbxout.h (dbxout_begin_function): Remove.
* debug.c (do_nothing_debug_hooks): Update.
(debug_nothing_tree): Update.
(debug_nothing_charstar_rtx): Remove.
* debug.h (union tree_node): Declare.
(struct rtx_def): Remove.
(gcc_debug_hooks): New hooks begin_prologue, end_prologue,
begin_function.  Change source_line prototype.
(debug_nothing_tree): New.
(debug_nothing_charstar_rtx): Delete.
(dwarf2out_begin_prologue): Moved from ...
* tree.h: ... here.
* dwarf2out.c (dwarf2_debug_hooks): Update.
(dwarf2out_begin_prologue): Update prototype.  If genuine dwarf2
debug info, call dwarf2out_source_line.
(dwarf2out_souce_line): Update prototype.
* dwarfout.c (dwarfout_begin_function): Rename dwarfout_end_prologue.
Change prototype, make static.
(dwarfout_source_line): Update prototype.
(dwarf_debug_hooks): Update.
* dwarfout.h (dwarfout_begin_function): Remove.
* final.c (final_start_function, final_scan_insn): Use appropriate
debug hooks, update to use notice_source_line.
(output_source_line): Rename notice_source_line.  Don't call the
source_line debug hook.
* sdbout.c (sdbout_begin_function): Rename sdbout_begin_prologue,
make static, update prototype.
(sdbout_mark_begin_function): Rename sdbout_begin_function, update
prototype.
(sdbout_end_prologue): New.
(sdbout_source_line): Update prototype.
(sdbout_debug_hooks): Update.
(sdbout_symbol): Remove unused var.
* sdbout.h (sdbout_begin_function, sdbout_mark_begin_function):
Delete.
* varasm.c: Include debug.h.
(assemble_start_function): Use begin_function debug_hook.
* xcoffout.c (xcoffout_begin_prologue): Rename xcoffout_begin_function,
update with prototype.
(xcoffout_source_line): Update prototype.
* xcoffout.h (xcoffout_begin_prologue): Rename xcoffout_begin_function,
update prototype.
(xcoffout_source_line): Update prototype.

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

15 files changed:
gcc/ChangeLog
gcc/dbxout.c
gcc/dbxout.h
gcc/debug.c
gcc/debug.h
gcc/dwarf2out.c
gcc/dwarfout.c
gcc/dwarfout.h
gcc/final.c
gcc/sdbout.c
gcc/sdbout.h
gcc/tree.h
gcc/varasm.c
gcc/xcoffout.c
gcc/xcoffout.h

index 39b7e98..3d5e479 100644 (file)
@@ -1,3 +1,55 @@
+2001-07-17  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * dbxout.c (dbxout_really_begin_function): Rename to
+       dbxout_begin_function.
+       (dbx_debug_hooks, xcoff_debug_hooks): Update.
+       (dbxout_begin_function): Remove.
+       (dbxout_function): Update.
+       (dbxout_source_line): Update prototype.
+       * dbxout.h (dbxout_begin_function): Remove.
+       * debug.c (do_nothing_debug_hooks): Update.
+       (debug_nothing_tree): Update.
+       (debug_nothing_charstar_rtx): Remove.
+       * debug.h (union tree_node): Declare.
+       (struct rtx_def): Remove.
+       (gcc_debug_hooks): New hooks begin_prologue, end_prologue,
+       begin_function.  Change source_line prototype.
+       (debug_nothing_tree): New.
+       (debug_nothing_charstar_rtx): Delete.
+       (dwarf2out_begin_prologue): Moved from ...
+       * tree.h: ... here.
+       * dwarf2out.c (dwarf2_debug_hooks): Update.
+       (dwarf2out_begin_prologue): Update prototype.  If genuine dwarf2
+       debug info, call dwarf2out_source_line.
+       (dwarf2out_souce_line): Update prototype.
+       * dwarfout.c (dwarfout_begin_function): Rename dwarfout_end_prologue.
+       Change prototype, make static.
+       (dwarfout_source_line): Update prototype.
+       (dwarf_debug_hooks): Update.
+       * dwarfout.h (dwarfout_begin_function): Remove.
+       * final.c (final_start_function, final_scan_insn): Use appropriate
+       debug hooks, update to use notice_source_line.
+       (output_source_line): Rename notice_source_line.  Don't call the
+       source_line debug hook.
+       * sdbout.c (sdbout_begin_function): Rename sdbout_begin_prologue,
+       make static, update prototype.
+       (sdbout_mark_begin_function): Rename sdbout_begin_function, update
+       prototype.
+       (sdbout_end_prologue): New.
+       (sdbout_source_line): Update prototype.
+       (sdbout_debug_hooks): Update.
+       (sdbout_symbol): Remove unused var.
+       * sdbout.h (sdbout_begin_function, sdbout_mark_begin_function):
+       Delete.
+       * varasm.c: Include debug.h.
+       (assemble_start_function): Use begin_function debug_hook.
+       * xcoffout.c (xcoffout_begin_prologue): Rename xcoffout_begin_function,
+       update with prototype.
+       (xcoffout_source_line): Update prototype.
+       * xcoffout.h (xcoffout_begin_prologue): Rename xcoffout_begin_function,
+       update prototype.
+       (xcoffout_source_line): Update prototype.
+
 2001-07-17  Richard Henderson  <rth@redhat.com>
 
        * c-typeck.c (build_binary_op): Do not shorten unsigned
index 3dd3f80..e2f21ff 100644 (file)
@@ -288,7 +288,7 @@ static void dbxout_init                     PARAMS ((const char *));
 static void dbxout_finish              PARAMS ((const char *));
 static void dbxout_start_source_file   PARAMS ((unsigned, const char *));
 static void dbxout_end_source_file     PARAMS ((unsigned));
-static void dbxout_source_line         PARAMS ((const char *, rtx));
+static void dbxout_source_line         PARAMS ((unsigned int, const char *));
 #if defined(ASM_OUTPUT_SECTION_NAME)
 static void dbxout_function_end                PARAMS ((void));
 #endif
@@ -310,7 +310,7 @@ static void dbxout_symbol_name              PARAMS ((tree, const char *, int));
 static void dbxout_prepare_symbol      PARAMS ((tree));
 static void dbxout_finish_symbol       PARAMS ((tree));
 static void dbxout_block               PARAMS ((tree, int, tree));
-static void dbxout_really_begin_function PARAMS ((tree));
+static void dbxout_begin_function      PARAMS ((tree));
 \f
 /* The debug hooks structure.  */
 #if defined (DBX_DEBUGGING_INFO)
@@ -328,9 +328,16 @@ struct gcc_debug_hooks dbx_debug_hooks =
   dbxout_end_source_file,
   dbxout_begin_block,
   dbxout_end_block,
-  dbxout_source_line,
+  dbxout_source_line,          /* source_line */
+  dbxout_source_line,          /* begin_prologue: just output line info */
+  debug_nothing_int,           /* end_prologue */
   debug_nothing_void,          /* end_epilogue */
-  debug_nothing_int            /* end function */
+#ifdef DBX_FUNCTION_FIRST
+  dbxout_begin_function,
+#else
+  debug_nothing_tree,          /* begin_function */
+#endif
+  debug_nothing_int            /* end_function */
 };
 #endif /* DBX_DEBUGGING_INFO  */
 
@@ -346,7 +353,10 @@ struct gcc_debug_hooks xcoff_debug_hooks =
   xcoffout_begin_block,
   xcoffout_end_block,
   xcoffout_source_line,
+  xcoffout_begin_prologue,     /* begin_prologue */
+  debug_nothing_int,           /* end_prologue */
   xcoffout_end_epilogue,
+  debug_nothing_tree,          /* begin_function */
   xcoffout_end_function
 };
 #endif /* XCOFF_DEBUGGING_INFO  */
@@ -559,16 +569,14 @@ dbxout_source_file (file, filename)
     }
 }
 
-/* Output a line number symbol entry into output stream FILE, 
-   for source file FILENAME and line number LINENO.  */
+/* Output a line number symbol entry for source file FILENAME and line
+   number LINENO.  */
 
 static void
-dbxout_source_line (filename, note)
+dbxout_source_line (lineno, filename)
+     unsigned int lineno;
      const char *filename;
-     rtx note;
 {
-  unsigned int lineno = NOTE_LINE_NUMBER (note);
-
   dbxout_source_file (asmfile, filename);
 
 #ifdef ASM_OUTPUT_SOURCE_LINE
@@ -2716,7 +2724,7 @@ dbxout_block (block, depth, args)
    but on some systems, it comes before.  */
 
 static void
-dbxout_really_begin_function (decl)
+dbxout_begin_function (decl)
      tree decl;
 {
   dbxout_symbol (decl, 0);
@@ -2725,17 +2733,6 @@ dbxout_really_begin_function (decl)
     dbxout_symbol (DECL_RESULT (decl), 1);
 }
 
-/* Called at beginning of output of function definition.  */
-
-void
-dbxout_begin_function (decl)
-     tree decl ATTRIBUTE_UNUSED;
-{
-#ifdef DBX_FUNCTION_FIRST
-  dbxout_really_begin_function (decl);
-#endif
-}
-
 /* Output dbx data for a function definition.
    This includes a definition of the function name itself (a symbol),
    definitions of the parameters (locating them in the parameter list)
@@ -2747,7 +2744,7 @@ dbxout_function (decl)
      tree decl;
 {
 #ifndef DBX_FUNCTION_FIRST
-  dbxout_really_begin_function (decl);
+  dbxout_begin_function (decl);
 #endif
   dbxout_block (DECL_INITIAL (decl), 0, DECL_ARGUMENTS (decl));
 #ifdef DBX_OUTPUT_FUNCTION_END
index e196b8f..91bbced 100644 (file)
@@ -26,4 +26,3 @@ extern void dbxout_parms              PARAMS ((tree));
 extern void dbxout_reg_parms           PARAMS ((tree));
 extern int dbxout_syms                 PARAMS ((tree));
 extern void dbxout_function            PARAMS ((tree));
-extern void dbxout_begin_function      PARAMS ((tree));
index 5aa651c..0c75909 100644 (file)
@@ -30,9 +30,12 @@ struct gcc_debug_hooks do_nothing_debug_hooks =
   debug_nothing_int,
   debug_nothing_int_int,
   debug_nothing_int_int,
-  debug_nothing_charstar_rtx,
-  debug_nothing_void,
-  debug_nothing_int
+  debug_nothing_int_charstar,  /* source_line */
+  debug_nothing_int_charstar,  /* begin_prologue */
+  debug_nothing_int,           /* end_prologue */
+  debug_nothing_void,          /* end_epilogue */
+  debug_nothing_tree,          /* begin_function */
+  debug_nothing_int            /* end_function */
 };
 
 /* This file contains implementations of each debug hook that do
@@ -44,6 +47,12 @@ debug_nothing_void ()
 }
 
 void
+debug_nothing_tree (decl)
+     union tree_node *decl ATTRIBUTE_UNUSED;
+{
+}
+
+void
 debug_nothing_charstar (main_filename)
      const char *main_filename ATTRIBUTE_UNUSED;
 {
@@ -68,10 +77,3 @@ debug_nothing_int_int (line, n)
      unsigned int n ATTRIBUTE_UNUSED;
 {
 }
-
-void
-debug_nothing_charstar_rtx (filename, note)
-     const char *filename ATTRIBUTE_UNUSED;
-     struct rtx_def *note ATTRIBUTE_UNUSED;
-{
-}
index c2e31a8..56b2e03 100644 (file)
@@ -18,7 +18,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #ifndef GCC_DEBUG_H
 #define GCC_DEBUG_H
 
-struct rtx_def;
+union tree_node;
 
 /* This structure contains hooks for the debug information output
    functions, accessed through the global instance debug_hooks set in
@@ -53,13 +53,24 @@ struct gcc_debug_hooks
   /* Record the end of a block.  Arguments as for begin_block.  */
   void (* end_block) PARAMS ((unsigned int line, unsigned int n));
 
-  /* Record a line based on NOTE.  Obtain the line number with
-     NOTE_LINE_NUMBER (note).  */
-  void (* source_line) PARAMS ((const char *filename, struct rtx_def *note));
+  /* Record a source file location at (FILE, LINE).  */
+  void (* source_line) PARAMS ((unsigned int line, const char *file));
+
+  /* Called at start of prologue code.  LINE is the first line in the
+     function.  This has been given the same prototype as source_line,
+     so that the source_line hook can be substituted if appropriate.  */
+  void (* begin_prologue) PARAMS ((unsigned int line, const char *file));
+
+  /* Called at end of prologue code.  LINE is the first line in the
+     function.  */
+  void (* end_prologue) PARAMS ((unsigned int line));
 
   /* Record end of epilogue code.  */
   void (* end_epilogue) PARAMS ((void));
 
+  /* Called at start of function DECL, before it is declared.  */
+  void (* begin_function) PARAMS ((union tree_node *decl));
+
   /* Record end of function.  LINE is highest line number in function.  */
   void (* end_function) PARAMS ((unsigned int line));
 };
@@ -77,8 +88,8 @@ extern void debug_nothing_int
   PARAMS ((unsigned int));
 extern void debug_nothing_int_int
   PARAMS ((unsigned int, unsigned int));
-extern void debug_nothing_charstar_rtx
-  PARAMS ((const char *, struct rtx_def *));
+extern void debug_nothing_tree
+  PARAMS ((union tree_node *));
 
 /* Hooks for various debug formats.  */
 extern struct gcc_debug_hooks do_nothing_debug_hooks;
@@ -90,6 +101,10 @@ extern struct gcc_debug_hooks dwarf2_debug_hooks;
 
 /* Dwarf2 frame information.  */
 
+/* FILE is NULL iff being called for frame information for non-dwarf
+   debug output.  */
+extern void dwarf2out_begin_prologue
+  PARAMS ((unsigned int, const char * file));
 extern void dwarf2out_end_epilogue
   PARAMS ((void));
 
index 207bda7..1aa927a 100644 (file)
@@ -59,6 +59,10 @@ Boston, MA 02111-1307, USA.  */
 #include "diagnostic.h"
 #include "debug.h"
 
+#ifdef DWARF2_DEBUGGING_INFO
+static void dwarf2out_source_line      PARAMS ((unsigned int, const char *));
+#endif
+
 /* DWARF2 Abbreviation Glossary:
    CFA = Canonical Frame Address
           a fixed address on the stack which identifies a call frame.
@@ -1999,7 +2003,9 @@ output_call_frame_info (for_eh)
    the prologue.  */
 
 void
-dwarf2out_begin_prologue ()
+dwarf2out_begin_prologue (line, file)
+     unsigned int line ATTRIBUTE_UNUSED;
+     const char *file ATTRIBUTE_UNUSED;
 {
   char label[MAX_ARTIFICIAL_LABEL_BYTES];
   register dw_fde_ref fde;
@@ -2056,6 +2062,13 @@ dwarf2out_begin_prologue ()
   fde->uses_eh_lsda = cfun->uses_eh_lsda;
 
   args_size = old_args_size = 0;
+
+  /* We only want to output line number information for the genuine
+     dwarf2 prologue case, not the eh frame case.  */
+#ifdef DWARF2_DEBUGGING_INFO
+  if (file)
+    dwarf2out_source_line (line, file);
+#endif
 }
 
 /* Output a marker (i.e. a label) for the absolute end of the generated code
@@ -3009,7 +3022,6 @@ static void dwarf2out_start_source_file   PARAMS ((unsigned, const char *));
 static void dwarf2out_end_source_file  PARAMS ((unsigned));
 static void dwarf2out_begin_block      PARAMS ((unsigned, unsigned));
 static void dwarf2out_end_block                PARAMS ((unsigned, unsigned));
-static void dwarf2out_source_line      PARAMS ((const char *, rtx));
 
 /* The debug hooks structure.  */
 
@@ -3024,7 +3036,10 @@ struct gcc_debug_hooks dwarf2_debug_hooks =
   dwarf2out_begin_block,
   dwarf2out_end_block,
   dwarf2out_source_line,
+  dwarf2out_begin_prologue,
+  debug_nothing_int,           /* end_prologue */
   dwarf2out_end_epilogue,
+  debug_nothing_tree,          /* begin_function */
   debug_nothing_int            /* end_function */
 };
 \f
@@ -11224,12 +11239,10 @@ init_file_table ()
    'line_info_table' for later output of the .debug_line section.  */
 
 static void
-dwarf2out_source_line (filename, note)
+dwarf2out_source_line (line, filename)
+     unsigned int line;
      register const char *filename;
-     rtx note;
 {
-  unsigned int line = NOTE_LINE_NUMBER (note);
-
   if (debug_info_level >= DINFO_LEVEL_NORMAL)
     {
       function_section (current_function_decl);
index f6e984e..65e324a 100644 (file)
@@ -798,7 +798,8 @@ static void dwarfout_end_source_file_check PARAMS ((unsigned));
 static void dwarfout_begin_block       PARAMS ((unsigned, unsigned));
 static void dwarfout_end_block         PARAMS ((unsigned, unsigned));
 static void dwarfout_end_epilogue      PARAMS ((void));
-static void dwarfout_source_line       PARAMS (( const char *, rtx));
+static void dwarfout_source_line       PARAMS ((unsigned int, const char *));
+static void dwarfout_end_prologue      PARAMS ((unsigned int));
 static void dwarfout_end_function      PARAMS ((unsigned int));
 static const char *dwarf_tag_name      PARAMS ((unsigned));
 static const char *dwarf_attr_name     PARAMS ((unsigned));
@@ -1383,8 +1384,11 @@ struct gcc_debug_hooks dwarf_debug_hooks =
   dwarfout_end_source_file_check,
   dwarfout_begin_block,
   dwarfout_end_block,
-  dwarfout_source_line,
+  dwarfout_source_line,                /* source_line */
+  dwarfout_source_line,                /* begin_prologue */
+  dwarfout_end_prologue,
   dwarfout_end_epilogue,
+  debug_nothing_tree,          /* begin_function */
   dwarfout_end_function
 };
 \f
@@ -5874,13 +5878,15 @@ dwarfout_end_block (line, blocknum)
    the real body of the function begins (after parameters have been moved
    to their home locations).  */
 
-void
-dwarfout_begin_function ()
+static void
+dwarfout_end_prologue (line)
+     unsigned int line ATTRIBUTE_UNUSED;
 {
   char label[MAX_ARTIFICIAL_LABEL_BYTES];
 
   if (! use_gnu_debug_info_extensions)
     return;
+
   function_section (current_function_decl);
   sprintf (label, BODY_BEGIN_LABEL_FMT, current_funcdef_number);
   ASM_OUTPUT_LABEL (asm_out_file, label);
@@ -6059,12 +6065,10 @@ generate_srcinfo_entry (line_entry_num, files_entry_num)
 }
 
 static void
-dwarfout_source_line (filename, note)
+dwarfout_source_line (line, filename)
+     unsigned int line;
      const char *filename;
-     rtx note;
 {
-  unsigned int line = NOTE_LINE_NUMBER (note);
-
   if (debug_info_level >= DINFO_LEVEL_NORMAL
       /* We can't emit line number info for functions in separate sections,
         because the assembler can't subtract labels in different sections.  */
index bd4eaf3..973c07e 100644 (file)
@@ -19,5 +19,3 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 extern void dwarfout_file_scope_decl   PARAMS ((tree , int));
-
-extern void dwarfout_begin_function    PARAMS ((void));
index 83b2297..6a8c298 100644 (file)
@@ -252,7 +252,7 @@ static void profile_function        PARAMS ((FILE *));
 static void profile_after_prologue PARAMS ((FILE *));
 static void add_bb             PARAMS ((FILE *));
 static int add_bb_string       PARAMS ((const char *, int));
-static void output_source_line PARAMS ((rtx));
+static void notice_source_line PARAMS ((rtx));
 static rtx walk_alter_subreg   PARAMS ((rtx));
 static void output_asm_name    PARAMS ((void));
 static void output_operand     PARAMS ((rtx, int));
@@ -1576,37 +1576,16 @@ final_start_function (first, file, optimize)
     }
 #endif
 
-  /* Initial line number is supposed to be output
-     before the function's prologue and label
-     so that the function's address will not appear to be
-     in the last statement of the preceding function.  */
   if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED)
-    last_linenum = high_block_linenum = high_function_linenum
-      = NOTE_LINE_NUMBER (first);
+    notice_source_line (first);
+  high_block_linenum = high_function_linenum = last_linenum;
 
-#if defined (DWARF2_UNWIND_INFO) || defined (IA64_UNWIND_INFO) \
-    || defined (DWARF2_DEBUGGING_INFO)
-  dwarf2out_begin_prologue ();
-#endif
+  (*debug_hooks->begin_prologue) (last_linenum, last_filename);
 
-  /* For SDB and XCOFF, the function beginning must be marked between
-     the function label and the prologue.  We always need this, even when
-     -g1 was used.  Defer on MIPS systems so that parameter descriptions
-     follow function entry.  */
-#if defined(SDB_DEBUGGING_INFO) && !defined(MIPS_DEBUGGING_INFO)
-  if (write_symbols == SDB_DEBUG)
-    sdbout_begin_function (last_linenum);
-  else
-#endif
-#ifdef XCOFF_DEBUGGING_INFO
-    if (write_symbols == XCOFF_DEBUG)
-      xcoffout_begin_function (file, last_linenum);
-    else
+#if defined (DWARF2_UNWIND_INFO) || defined (IA64_UNWIND_INFO)
+  if (write_symbols != DWARF2_DEBUG)
+    dwarf2out_begin_prologue (0, NULL);
 #endif
-      /* But only output line number for other debug info types if -g2
-        or better.  */
-      if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED)
-       output_source_line (first);
 
 #ifdef LEAF_REG_REMAP
   if (current_function_uses_only_leaf_regs)
@@ -2079,24 +2058,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
          break;
 
        case NOTE_INSN_FUNCTION_BEG:
-#if defined(SDB_DEBUGGING_INFO) && defined(MIPS_DEBUGGING_INFO)
-         /* MIPS stabs require the parameter descriptions to be after the
-            function entry point rather than before.  */
-         if (write_symbols == SDB_DEBUG)
-           {
-             app_disable ();
-             sdbout_begin_function (last_linenum);
-           }
-#endif
-#ifdef DWARF_DEBUGGING_INFO
-         /* This outputs a marker where the function body starts, so it
-            must be after the prologue.  */
-         if (write_symbols == DWARF_DEBUG)
-           {
-             app_disable ();
-             dwarfout_begin_function ();
-           }
-#endif
+         app_disable ();
+         (*debug_hooks->end_prologue) (last_linenum);
          break;
 
        case NOTE_INSN_BLOCK_BEG:
@@ -2191,7 +2154,10 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
            /* Output this line note if it is the first or the last line
               note in a row.  */
            if (!note_after)
-             output_source_line (insn);
+             {
+               notice_source_line (insn);
+               (*debug_hooks->source_line) (last_linenum, last_filename);
+             }
          }
          break;
        }
@@ -2906,7 +2872,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
    based on the NOTE-insn INSN, assumed to be a line number.  */
 
 static void
-output_source_line (insn)
+notice_source_line (insn)
      rtx insn;
 {
   register const char *filename = NOTE_SOURCE_FILE (insn);
@@ -2923,8 +2889,6 @@ output_source_line (insn)
   last_linenum = NOTE_LINE_NUMBER (insn);
   high_block_linenum = MAX (last_linenum, high_block_linenum);
   high_function_linenum = MAX (last_linenum, high_function_linenum);
-
-  (*debug_hooks->source_line) (filename, insn);
 }
 \f
 /* For each operand in INSN, simplify (subreg (reg)) so that it refers
index 0738ca3..d6bccab 100644 (file)
@@ -97,8 +97,13 @@ static void sdbout_start_source_file PARAMS ((unsigned, const char *));
 static void sdbout_end_source_file     PARAMS ((unsigned));
 static void sdbout_begin_block         PARAMS ((unsigned, unsigned));
 static void sdbout_end_block           PARAMS ((unsigned, unsigned));
-static void sdbout_source_line         PARAMS ((const char *, rtx));
+static void sdbout_source_line         PARAMS ((unsigned int, const char *));
 static void sdbout_end_epilogue                PARAMS ((void));
+#ifndef MIPS_DEBUGGING_INFO
+static void sdbout_begin_prologue      PARAMS ((unsigned int, const char *));
+#endif
+static void sdbout_end_prologue                PARAMS ((unsigned int));
+static void sdbout_begin_function      PARAMS ((tree));
 static void sdbout_end_function                PARAMS ((unsigned int));
 static char *gen_fake_label            PARAMS ((void));
 static int plain_type                  PARAMS ((tree));
@@ -299,7 +304,17 @@ struct gcc_debug_hooks sdb_debug_hooks =
   sdbout_begin_block,
   sdbout_end_block,
   sdbout_source_line,
+#ifdef MIPS_DEBUGGING_INFO
+  /* Defer on MIPS systems so that parameter descriptions follow
+     function entry.  */
+  debug_nothing_int_charstar,  /* begin_prologue */
+  sdbout_end_prologue,         /* end_prologue */
+#else
+  sdbout_begin_prologue,       /* begin_prologue */
+  debug_nothing_int,           /* end_prologue */
+#endif
   sdbout_end_epilogue,
+  sdbout_begin_function,
   sdbout_end_function
 };
 \f
@@ -775,8 +790,6 @@ sdbout_symbol (decl, local)
        }
       else if (GET_CODE (value) == SUBREG)
        {
-         int offset = 0;
-
          while (GET_CODE (value) == SUBREG)
            value = SUBREG_REG (value);
          if (GET_CODE (value) == REG)
@@ -1521,12 +1534,10 @@ sdbout_end_block (line, n)
 }
 
 static void
-sdbout_source_line (filename, note)
+sdbout_source_line (line, filename)
+     unsigned int line;
      const char *filename ATTRIBUTE_UNUSED;
-     rtx note;
 {
-  unsigned int line = NOTE_LINE_NUMBER (note);
-
   /* COFF relative line numbers must be positive.  */
   if (line > sdb_begin_function_line)
     {
@@ -1543,21 +1554,32 @@ sdbout_source_line (filename, note)
 /* Output sdb info for the current function name.
    Called from assemble_start_function.  */
 
-void
-sdbout_mark_begin_function ()
+static void
+sdbout_begin_function (decl)
+     tree decl ATTRIBUTE_UNUSED;
 {
   sdbout_symbol (current_function_decl, 0);
 }
 
-/* Called at beginning of function body (after prologue).
-   Record the function's starting line number, so we can output
-   relative line numbers for the other lines.
-   Describe beginning of outermost block.
-   Also describe the parameter list.  */
+/* Called at beginning of function body (before or after prologue,
+   depending on MIPS_DEBUGGING_INFO).  Record the function's starting
+   line number, so we can output relative line numbers for the other
+   lines.  Describe beginning of outermost block.  Also describe the
+   parameter list.  */
 
-void
-sdbout_begin_function (line)
-     int line;
+#ifndef MIPS_DEBUGGING_INFO
+static void
+sdbout_begin_prologue (line, file)
+     unsigned int line;
+     const char *file ATTRIBUTE_UNUSED;
+{
+  sdbout_end_prologue (line);
+}
+#endif
+
+static void
+sdbout_end_prologue (line)
+     unsigned int line;
 {
   sdb_begin_function_line = line - 1;
   PUT_SDB_FUNCTION_START (line);
index 5a5ca8f..51317d6 100644 (file)
@@ -18,12 +18,7 @@ along with GNU CC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-extern void sdbout_begin_function      PARAMS ((int));
-
 extern void sdbout_label               PARAMS ((rtx));
 extern void sdbout_symbol              PARAMS ((tree, int));
 extern void sdbout_toplevel_data       PARAMS ((tree));
 extern void sdbout_types               PARAMS ((tree));
-
-extern void sdbout_mark_begin_function PARAMS ((void));
-
index 657b971..b1a9551 100644 (file)
@@ -2919,11 +2919,6 @@ extern void dwarf2out_return_save        PARAMS ((const char *, long));
 
 extern void dwarf2out_return_reg       PARAMS ((const char *, unsigned));
 
-/* Output a marker (i.e. a label) for the beginning of a function, before
-   the prologue.  */
-
-extern void dwarf2out_begin_prologue   PARAMS ((void));
-
 \f
 /* Redefine abort to report an internal error w/o coredump, and
    reporting the location of the error in the source file.  This logic
index 76f1c67..630dad0 100644 (file)
@@ -47,6 +47,7 @@ Boston, MA 02111-1307, USA.  */
 #include "c-pragma.h"
 #include "ggc.h"
 #include "tm_p.h"
+#include "debug.h"
 
 #ifdef XCOFF_DEBUGGING_INFO
 #include "xcoffout.h"
@@ -947,17 +948,7 @@ assemble_start_function (decl, fnname)
   ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname);
 #endif
 
-#ifdef SDB_DEBUGGING_INFO
-  /* Output SDB definition of the function.  */
-  if (write_symbols == SDB_DEBUG)
-    sdbout_mark_begin_function ();
-#endif
-
-#ifdef DBX_DEBUGGING_INFO
-  /* Output DBX definition of the function.  */
-  if (write_symbols == DBX_DEBUG)
-    dbxout_begin_function (decl);
-#endif
+  (*debug_hooks->begin_function) (decl);
 
   /* Make function name accessible from other files, if appropriate.  */
 
index e8dd43f..6955329 100644 (file)
@@ -304,17 +304,19 @@ xcoffout_source_file (file, filename, inline_p)
     }
 }
 
-/* Output a line number symbol entry into output stream FILE,
-   for source file FILENAME and line number NOTE.  */
+/* Output a line number symbol entry for location (FILENAME, LINE).  */
 
 void
-xcoffout_source_line (filename, note)
+xcoffout_source_line (line, filename)
+     unsigned int line;
      const char *filename;
-     rtx note;
 {
-  xcoffout_source_file (asm_out_file, filename, RTX_INTEGRATED_P (note));
+  bool inline_p = (strcmp (xcoff_current_function_file, filename) != 0
+                  || (int) line < xcoff_begin_function_line);
+
+  xcoffout_source_file (asm_out_file, filename, inline_p);
 
-  ASM_OUTPUT_SOURCE_LINE (asm_out_file, NOTE_LINE_NUMBER (note));
+  ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
 }
 \f
 /* Output the symbols defined in block number DO_BLOCK.
@@ -431,17 +433,17 @@ xcoffout_declare_function (file, decl, name)
           name, name, name, name);
 }
 
-/* Called at beginning of function body (after prologue).
+/* Called at beginning of function body (at start of prologue).
    Record the function's starting line number, so we can output
    relative line numbers for the other lines.
    Record the file name that this function is contained in.  */
 
 void
-xcoffout_begin_function (file, last_linenum)
-     FILE *file;
-     int last_linenum;
+xcoffout_begin_prologue (line, file)
+     unsigned int line;
+     const char *file ATTRIBUTE_UNUSED;
 {
-  ASM_OUTPUT_LFB (file, last_linenum);
+  ASM_OUTPUT_LFB (asm_out_file, line);
   dbxout_parms (DECL_ARGUMENTS (current_function_decl));
 
   /* Emit the symbols for the outermost BLOCK's variables.  sdbout.c does this
@@ -452,7 +454,7 @@ xcoffout_begin_function (file, last_linenum)
   xcoffout_block (DECL_INITIAL (current_function_decl), 0,
                  DECL_ARGUMENTS (current_function_decl));
 
-  ASM_OUTPUT_SOURCE_LINE (file, last_linenum);
+  ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
 }
 
 /* Called at end of function (before epilogue).
index a7cfe63..27b4ffe 100644 (file)
@@ -199,7 +199,8 @@ extern const char *xcoff_lastfile;
 
 extern int stab_to_sclass                      PARAMS ((int));
 #ifdef BUFSIZ
-extern void xcoffout_begin_function            PARAMS ((FILE *, int));
+extern void xcoffout_begin_prologue            PARAMS ((unsigned int,
+                                                        const char *));
 extern void xcoffout_begin_block               PARAMS ((unsigned, unsigned));
 extern void xcoffout_end_epilogue              PARAMS ((void));
 extern void xcoffout_end_function              PARAMS ((unsigned int));
@@ -215,6 +216,7 @@ extern void xcoffout_declare_function               PARAMS ((FILE *, tree, const char *));
 
 #ifdef RTX_CODE
 #ifdef BUFSIZ
-extern void xcoffout_source_line               PARAMS ((const char *, rtx));
+extern void xcoffout_source_line               PARAMS ((unsigned int,
+                                                        const char *));
 #endif /* BUFSIZ */
 #endif /* RTX_CODE */