This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 3 debug hooks for begin_function


Richard Henderson wrote:-

>  (5) This leaves the beginning of final_start_function looking like
> 
>   /* 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.  The actual
>      line number debug output is done in debug_hooks->begin_prologue.  */
>   if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED)
>     notice_source_line (first);
>   high_block_linenum = high_function_linenum = last_linenum;
> 
>   (*debug_hooks->begin_prologue) (last_filename, last_linenum);
> 
> #if defined (DWARF2_UNWIND_INFO) || defined (IA64_UNWIND_INFO)
>   if (write_symbols != DWARF2_DEBUG && dwarf2out_do_frame ())
>     dwarf2out_begin_prologue (NULL, 0);
> #endif

This is quite a nice little cleanup.

I've done the above.  Note that the high_block_linenum stuff was in
the if() too, and is made redundant by the call to notice_source_line,
so I've removed it.  Also the dwarf2out_do_frame() you have was not
there before, and is not quite the same semantics as before -
dwarf2out_begin_prologue() does those checks itself, and some other
stuff unconditionally, so I've left out that part to retain semantics.

This is bootstrapping x86 Linux, I've confirmed that xcoffout.c and
sdbout.c, which don't normally compile under Linux, do compile without
error.

OK?

Neil.

	* 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, dwarf2out_souce_line): Update prototypes.
	* 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.

============================================================
Index: gcc/dbxout.c
--- gcc/dbxout.c	2001/07/15 08:34:42	1.91
+++ gcc/dbxout.c	2001/07/17 06:49:21
@@ -288,7 +288,7 @@ static void dbxout_init			PARAMS ((const
 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 (
 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));
 
 /* 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: gcc/dbxout.h
--- gcc/dbxout.h	2001/07/15 08:34:43	1.10
+++ gcc/dbxout.h	2001/07/17 06:49:21
@@ -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: gcc/debug.c
--- gcc/debug.c	2001/07/15 08:34:43	1.4
+++ gcc/debug.c	2001/07/17 06:49:21
@@ -30,9 +30,12 @@ struct gcc_debug_hooks do_nothing_debug_
   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;
 {
@@ -66,12 +75,5 @@ void
 debug_nothing_int_int (line, n)
      unsigned int line ATTRIBUTE_UNUSED;
      unsigned int n ATTRIBUTE_UNUSED;
-{
-}
-
-void
-debug_nothing_charstar_rtx (filename, note)
-     const char *filename ATTRIBUTE_UNUSED;
-     struct rtx_def *note ATTRIBUTE_UNUSED;
 {
 }
============================================================
Index: gcc/debug.h
--- gcc/debug.h	2001/07/15 08:34:43	1.4
+++ gcc/debug.h	2001/07/17 06:49:21
@@ -18,7 +18,7 @@ Foundation, 59 Temple Place - Suite 330,
 #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,8 @@ extern struct gcc_debug_hooks dwarf2_deb
 
 /* Dwarf2 frame information.  */
 
+extern void dwarf2out_begin_prologue
+  PARAMS ((unsigned int, const char *));
 extern void dwarf2out_end_epilogue
   PARAMS ((void));
 
============================================================
Index: gcc/dwarf2out.c
--- gcc/dwarf2out.c	2001/07/15 08:34:43	1.290
+++ gcc/dwarf2out.c	2001/07/17 06:49:49
@@ -1999,7 +1999,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;
@@ -3009,7 +3011,7 @@ static void dwarf2out_start_source_file	
 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));
+static void dwarf2out_source_line	PARAMS ((unsigned int, const char *));
 
 /* The debug hooks structure.  */
 
@@ -3024,7 +3026,10 @@ struct gcc_debug_hooks dwarf2_debug_hook
   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 */
 };
 
@@ -11224,12 +11229,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: gcc/dwarfout.c
--- gcc/dwarfout.c	2001/07/15 08:34:44	1.90
+++ gcc/dwarfout.c	2001/07/17 06:50:07
@@ -798,7 +798,8 @@ static void dwarfout_end_source_file_che
 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
 };
 
@@ -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, 
 }
 
 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: gcc/dwarfout.h
--- gcc/dwarfout.h	2001/07/15 08:34:44	1.11
+++ gcc/dwarfout.h	2001/07/17 06:50:08
@@ -19,5 +19,3 @@ the Free Software Foundation, 59 Temple 
 Boston, MA 02111-1307, USA.  */
 
 extern void dwarfout_file_scope_decl 	PARAMS ((tree , int));
-
-extern void dwarfout_begin_function	PARAMS ((void));
============================================================
Index: gcc/final.c
--- gcc/final.c	2001/07/15 08:34:44	1.184
+++ gcc/final.c	2001/07/17 06:50:18
@@ -252,7 +252,7 @@ static void profile_function	PARAMS ((FI
 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,15 @@ final_start_function (first, file, optim
     }
 #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);
 
-#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
+#if defined (DWARF2_UNWIND_INFO) || defined (IA64_UNWIND_INFO)
+  if (write_symbols != DWARF2_DEBUG)
+    dwarf2out_begin_prologue (0, NULL);
 #endif
-#ifdef XCOFF_DEBUGGING_INFO
-    if (write_symbols == XCOFF_DEBUG)
-      xcoffout_begin_function (file, last_linenum);
-    else
-#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 +2057,8 @@ final_scan_insn (insn, file, optimize, p
 	  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 +2153,10 @@ final_scan_insn (insn, file, optimize, p
 	    /* 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 +2871,7 @@ final_scan_insn (insn, file, optimize, p
    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 +2888,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);
 }
 
 /* For each operand in INSN, simplify (subreg (reg)) so that it refers
============================================================
Index: gcc/sdbout.c
--- gcc/sdbout.c	2001/07/16 06:01:40	1.48
+++ gcc/sdbout.c	2001/07/17 06:50:23
@@ -97,8 +97,13 @@ static void sdbout_start_source_file	PAR
 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.  */
+  sdbout_source_line,		/* 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
 };
 
@@ -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: gcc/sdbout.h
--- gcc/sdbout.h	2001/07/15 08:34:45	1.10
+++ gcc/sdbout.h	2001/07/17 06:50:23
@@ -18,12 +18,7 @@ along with GNU CC; see the file COPYING.
 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: gcc/tree.h
--- gcc/tree.h	2001/07/15 08:34:45	1.255
+++ gcc/tree.h	2001/07/17 06:50:33
@@ -2919,11 +2919,6 @@ extern void dwarf2out_return_save	PARAMS
 
 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));
-
 
 /* Redefine abort to report an internal error w/o coredump, and
    reporting the location of the error in the source file.  This logic
============================================================
Index: gcc/varasm.c
--- gcc/varasm.c	2001/06/04 13:21:38	1.176
+++ gcc/varasm.c	2001/07/17 06:50:45
@@ -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: gcc/xcoffout.c
--- gcc/xcoffout.c	2001/07/15 08:34:45	1.24
+++ gcc/xcoffout.c	2001/07/17 06:51:00
@@ -304,17 +304,19 @@ xcoffout_source_file (file, filename, in
     }
 }
 
-/* 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);
 }
 
 /* Output the symbols defined in block number DO_BLOCK.
@@ -431,17 +433,17 @@ xcoffout_declare_function (file, decl, n
 	   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_line
   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: gcc/xcoffout.h
--- gcc/xcoffout.h	2001/07/15 08:34:46	1.13
+++ gcc/xcoffout.h	2001/07/17 06:51:00
@@ -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		P
 
 #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 */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]