Commit 653e276c by Neil Booth Committed by Neil Booth

dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function.

	* 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.

From-SVN: r44087
parent 91a18fe0
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> 2001-07-17 Richard Henderson <rth@redhat.com>
* c-typeck.c (build_binary_op): Do not shorten unsigned * c-typeck.c (build_binary_op): Do not shorten unsigned
......
...@@ -288,7 +288,7 @@ static void dbxout_init PARAMS ((const char *)); ...@@ -288,7 +288,7 @@ static void dbxout_init PARAMS ((const char *));
static void dbxout_finish PARAMS ((const char *)); static void dbxout_finish PARAMS ((const char *));
static void dbxout_start_source_file PARAMS ((unsigned, const char *)); static void dbxout_start_source_file PARAMS ((unsigned, const char *));
static void dbxout_end_source_file PARAMS ((unsigned)); 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) #if defined(ASM_OUTPUT_SECTION_NAME)
static void dbxout_function_end PARAMS ((void)); static void dbxout_function_end PARAMS ((void));
#endif #endif
...@@ -310,7 +310,7 @@ static void dbxout_symbol_name PARAMS ((tree, const char *, int)); ...@@ -310,7 +310,7 @@ static void dbxout_symbol_name PARAMS ((tree, const char *, int));
static void dbxout_prepare_symbol PARAMS ((tree)); static void dbxout_prepare_symbol PARAMS ((tree));
static void dbxout_finish_symbol PARAMS ((tree)); static void dbxout_finish_symbol PARAMS ((tree));
static void dbxout_block PARAMS ((tree, int, 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. */ /* The debug hooks structure. */
#if defined (DBX_DEBUGGING_INFO) #if defined (DBX_DEBUGGING_INFO)
...@@ -328,9 +328,16 @@ struct gcc_debug_hooks dbx_debug_hooks = ...@@ -328,9 +328,16 @@ struct gcc_debug_hooks dbx_debug_hooks =
dbxout_end_source_file, dbxout_end_source_file,
dbxout_begin_block, dbxout_begin_block,
dbxout_end_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_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 */ #endif /* DBX_DEBUGGING_INFO */
...@@ -346,7 +353,10 @@ struct gcc_debug_hooks xcoff_debug_hooks = ...@@ -346,7 +353,10 @@ struct gcc_debug_hooks xcoff_debug_hooks =
xcoffout_begin_block, xcoffout_begin_block,
xcoffout_end_block, xcoffout_end_block,
xcoffout_source_line, xcoffout_source_line,
xcoffout_begin_prologue, /* begin_prologue */
debug_nothing_int, /* end_prologue */
xcoffout_end_epilogue, xcoffout_end_epilogue,
debug_nothing_tree, /* begin_function */
xcoffout_end_function xcoffout_end_function
}; };
#endif /* XCOFF_DEBUGGING_INFO */ #endif /* XCOFF_DEBUGGING_INFO */
...@@ -559,16 +569,14 @@ dbxout_source_file (file, filename) ...@@ -559,16 +569,14 @@ dbxout_source_file (file, filename)
} }
} }
/* Output a line number symbol entry into output stream FILE, /* Output a line number symbol entry for source file FILENAME and line
for source file FILENAME and line number LINENO. */ number LINENO. */
static void static void
dbxout_source_line (filename, note) dbxout_source_line (lineno, filename)
unsigned int lineno;
const char *filename; const char *filename;
rtx note;
{ {
unsigned int lineno = NOTE_LINE_NUMBER (note);
dbxout_source_file (asmfile, filename); dbxout_source_file (asmfile, filename);
#ifdef ASM_OUTPUT_SOURCE_LINE #ifdef ASM_OUTPUT_SOURCE_LINE
...@@ -2716,7 +2724,7 @@ dbxout_block (block, depth, args) ...@@ -2716,7 +2724,7 @@ dbxout_block (block, depth, args)
but on some systems, it comes before. */ but on some systems, it comes before. */
static void static void
dbxout_really_begin_function (decl) dbxout_begin_function (decl)
tree decl; tree decl;
{ {
dbxout_symbol (decl, 0); dbxout_symbol (decl, 0);
...@@ -2725,17 +2733,6 @@ dbxout_really_begin_function (decl) ...@@ -2725,17 +2733,6 @@ dbxout_really_begin_function (decl)
dbxout_symbol (DECL_RESULT (decl), 1); 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. /* Output dbx data for a function definition.
This includes a definition of the function name itself (a symbol), This includes a definition of the function name itself (a symbol),
definitions of the parameters (locating them in the parameter list) definitions of the parameters (locating them in the parameter list)
...@@ -2747,7 +2744,7 @@ dbxout_function (decl) ...@@ -2747,7 +2744,7 @@ dbxout_function (decl)
tree decl; tree decl;
{ {
#ifndef DBX_FUNCTION_FIRST #ifndef DBX_FUNCTION_FIRST
dbxout_really_begin_function (decl); dbxout_begin_function (decl);
#endif #endif
dbxout_block (DECL_INITIAL (decl), 0, DECL_ARGUMENTS (decl)); dbxout_block (DECL_INITIAL (decl), 0, DECL_ARGUMENTS (decl));
#ifdef DBX_OUTPUT_FUNCTION_END #ifdef DBX_OUTPUT_FUNCTION_END
......
...@@ -26,4 +26,3 @@ extern void dbxout_parms PARAMS ((tree)); ...@@ -26,4 +26,3 @@ extern void dbxout_parms PARAMS ((tree));
extern void dbxout_reg_parms PARAMS ((tree)); extern void dbxout_reg_parms PARAMS ((tree));
extern int dbxout_syms PARAMS ((tree)); extern int dbxout_syms PARAMS ((tree));
extern void dbxout_function PARAMS ((tree)); extern void dbxout_function PARAMS ((tree));
extern void dbxout_begin_function PARAMS ((tree));
...@@ -30,9 +30,12 @@ struct gcc_debug_hooks do_nothing_debug_hooks = ...@@ -30,9 +30,12 @@ struct gcc_debug_hooks do_nothing_debug_hooks =
debug_nothing_int, debug_nothing_int,
debug_nothing_int_int, debug_nothing_int_int,
debug_nothing_int_int, debug_nothing_int_int,
debug_nothing_charstar_rtx, debug_nothing_int_charstar, /* source_line */
debug_nothing_void, debug_nothing_int_charstar, /* begin_prologue */
debug_nothing_int 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 /* This file contains implementations of each debug hook that do
...@@ -44,6 +47,12 @@ debug_nothing_void () ...@@ -44,6 +47,12 @@ debug_nothing_void ()
} }
void void
debug_nothing_tree (decl)
union tree_node *decl ATTRIBUTE_UNUSED;
{
}
void
debug_nothing_charstar (main_filename) debug_nothing_charstar (main_filename)
const char *main_filename ATTRIBUTE_UNUSED; const char *main_filename ATTRIBUTE_UNUSED;
{ {
...@@ -68,10 +77,3 @@ debug_nothing_int_int (line, n) ...@@ -68,10 +77,3 @@ debug_nothing_int_int (line, n)
unsigned int n 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;
{
}
...@@ -18,7 +18,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ...@@ -18,7 +18,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef GCC_DEBUG_H #ifndef GCC_DEBUG_H
#define GCC_DEBUG_H #define GCC_DEBUG_H
struct rtx_def; union tree_node;
/* This structure contains hooks for the debug information output /* This structure contains hooks for the debug information output
functions, accessed through the global instance debug_hooks set in functions, accessed through the global instance debug_hooks set in
...@@ -53,13 +53,24 @@ struct gcc_debug_hooks ...@@ -53,13 +53,24 @@ struct gcc_debug_hooks
/* Record the end of a block. Arguments as for begin_block. */ /* Record the end of a block. Arguments as for begin_block. */
void (* end_block) PARAMS ((unsigned int line, unsigned int n)); void (* end_block) PARAMS ((unsigned int line, unsigned int n));
/* Record a line based on NOTE. Obtain the line number with /* Record a source file location at (FILE, LINE). */
NOTE_LINE_NUMBER (note). */ void (* source_line) PARAMS ((unsigned int line, const char *file));
void (* source_line) PARAMS ((const char *filename, struct rtx_def *note));
/* 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. */ /* Record end of epilogue code. */
void (* end_epilogue) PARAMS ((void)); 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. */ /* Record end of function. LINE is highest line number in function. */
void (* end_function) PARAMS ((unsigned int line)); void (* end_function) PARAMS ((unsigned int line));
}; };
...@@ -77,8 +88,8 @@ extern void debug_nothing_int ...@@ -77,8 +88,8 @@ extern void debug_nothing_int
PARAMS ((unsigned int)); PARAMS ((unsigned int));
extern void debug_nothing_int_int extern void debug_nothing_int_int
PARAMS ((unsigned int, unsigned int)); PARAMS ((unsigned int, unsigned int));
extern void debug_nothing_charstar_rtx extern void debug_nothing_tree
PARAMS ((const char *, struct rtx_def *)); PARAMS ((union tree_node *));
/* Hooks for various debug formats. */ /* Hooks for various debug formats. */
extern struct gcc_debug_hooks do_nothing_debug_hooks; extern struct gcc_debug_hooks do_nothing_debug_hooks;
...@@ -90,6 +101,10 @@ extern struct gcc_debug_hooks dwarf2_debug_hooks; ...@@ -90,6 +101,10 @@ extern struct gcc_debug_hooks dwarf2_debug_hooks;
/* Dwarf2 frame information. */ /* 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 extern void dwarf2out_end_epilogue
PARAMS ((void)); PARAMS ((void));
......
...@@ -59,6 +59,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -59,6 +59,10 @@ Boston, MA 02111-1307, USA. */
#include "diagnostic.h" #include "diagnostic.h"
#include "debug.h" #include "debug.h"
#ifdef DWARF2_DEBUGGING_INFO
static void dwarf2out_source_line PARAMS ((unsigned int, const char *));
#endif
/* DWARF2 Abbreviation Glossary: /* DWARF2 Abbreviation Glossary:
CFA = Canonical Frame Address CFA = Canonical Frame Address
a fixed address on the stack which identifies a call frame. a fixed address on the stack which identifies a call frame.
...@@ -1999,7 +2003,9 @@ output_call_frame_info (for_eh) ...@@ -1999,7 +2003,9 @@ output_call_frame_info (for_eh)
the prologue. */ the prologue. */
void 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]; char label[MAX_ARTIFICIAL_LABEL_BYTES];
register dw_fde_ref fde; register dw_fde_ref fde;
...@@ -2056,6 +2062,13 @@ dwarf2out_begin_prologue () ...@@ -2056,6 +2062,13 @@ dwarf2out_begin_prologue ()
fde->uses_eh_lsda = cfun->uses_eh_lsda; fde->uses_eh_lsda = cfun->uses_eh_lsda;
args_size = old_args_size = 0; 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 /* 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 *)); ...@@ -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_end_source_file PARAMS ((unsigned));
static void dwarf2out_begin_block PARAMS ((unsigned, unsigned)); static void dwarf2out_begin_block PARAMS ((unsigned, unsigned));
static void dwarf2out_end_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. */ /* The debug hooks structure. */
...@@ -3024,7 +3036,10 @@ struct gcc_debug_hooks dwarf2_debug_hooks = ...@@ -3024,7 +3036,10 @@ struct gcc_debug_hooks dwarf2_debug_hooks =
dwarf2out_begin_block, dwarf2out_begin_block,
dwarf2out_end_block, dwarf2out_end_block,
dwarf2out_source_line, dwarf2out_source_line,
dwarf2out_begin_prologue,
debug_nothing_int, /* end_prologue */
dwarf2out_end_epilogue, dwarf2out_end_epilogue,
debug_nothing_tree, /* begin_function */
debug_nothing_int /* end_function */ debug_nothing_int /* end_function */
}; };
...@@ -11224,12 +11239,10 @@ init_file_table () ...@@ -11224,12 +11239,10 @@ init_file_table ()
'line_info_table' for later output of the .debug_line section. */ 'line_info_table' for later output of the .debug_line section. */
static void static void
dwarf2out_source_line (filename, note) dwarf2out_source_line (line, filename)
unsigned int line;
register const char *filename; register const char *filename;
rtx note;
{ {
unsigned int line = NOTE_LINE_NUMBER (note);
if (debug_info_level >= DINFO_LEVEL_NORMAL) if (debug_info_level >= DINFO_LEVEL_NORMAL)
{ {
function_section (current_function_decl); function_section (current_function_decl);
......
...@@ -798,7 +798,8 @@ static void dwarfout_end_source_file_check PARAMS ((unsigned)); ...@@ -798,7 +798,8 @@ static void dwarfout_end_source_file_check PARAMS ((unsigned));
static void dwarfout_begin_block PARAMS ((unsigned, unsigned)); static void dwarfout_begin_block PARAMS ((unsigned, unsigned));
static void dwarfout_end_block PARAMS ((unsigned, unsigned)); static void dwarfout_end_block PARAMS ((unsigned, unsigned));
static void dwarfout_end_epilogue PARAMS ((void)); 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 void dwarfout_end_function PARAMS ((unsigned int));
static const char *dwarf_tag_name PARAMS ((unsigned)); static const char *dwarf_tag_name PARAMS ((unsigned));
static const char *dwarf_attr_name PARAMS ((unsigned)); static const char *dwarf_attr_name PARAMS ((unsigned));
...@@ -1383,8 +1384,11 @@ struct gcc_debug_hooks dwarf_debug_hooks = ...@@ -1383,8 +1384,11 @@ struct gcc_debug_hooks dwarf_debug_hooks =
dwarfout_end_source_file_check, dwarfout_end_source_file_check,
dwarfout_begin_block, dwarfout_begin_block,
dwarfout_end_block, dwarfout_end_block,
dwarfout_source_line, dwarfout_source_line, /* source_line */
dwarfout_source_line, /* begin_prologue */
dwarfout_end_prologue,
dwarfout_end_epilogue, dwarfout_end_epilogue,
debug_nothing_tree, /* begin_function */
dwarfout_end_function dwarfout_end_function
}; };
...@@ -5874,13 +5878,15 @@ dwarfout_end_block (line, blocknum) ...@@ -5874,13 +5878,15 @@ dwarfout_end_block (line, blocknum)
the real body of the function begins (after parameters have been moved the real body of the function begins (after parameters have been moved
to their home locations). */ to their home locations). */
void static void
dwarfout_begin_function () dwarfout_end_prologue (line)
unsigned int line ATTRIBUTE_UNUSED;
{ {
char label[MAX_ARTIFICIAL_LABEL_BYTES]; char label[MAX_ARTIFICIAL_LABEL_BYTES];
if (! use_gnu_debug_info_extensions) if (! use_gnu_debug_info_extensions)
return; return;
function_section (current_function_decl); function_section (current_function_decl);
sprintf (label, BODY_BEGIN_LABEL_FMT, current_funcdef_number); sprintf (label, BODY_BEGIN_LABEL_FMT, current_funcdef_number);
ASM_OUTPUT_LABEL (asm_out_file, label); ASM_OUTPUT_LABEL (asm_out_file, label);
...@@ -6059,12 +6065,10 @@ generate_srcinfo_entry (line_entry_num, files_entry_num) ...@@ -6059,12 +6065,10 @@ generate_srcinfo_entry (line_entry_num, files_entry_num)
} }
static void static void
dwarfout_source_line (filename, note) dwarfout_source_line (line, filename)
unsigned int line;
const char *filename; const char *filename;
rtx note;
{ {
unsigned int line = NOTE_LINE_NUMBER (note);
if (debug_info_level >= DINFO_LEVEL_NORMAL if (debug_info_level >= DINFO_LEVEL_NORMAL
/* We can't emit line number info for functions in separate sections, /* We can't emit line number info for functions in separate sections,
because the assembler can't subtract labels in different sections. */ because the assembler can't subtract labels in different sections. */
......
...@@ -19,5 +19,3 @@ the Free Software Foundation, 59 Temple Place - Suite 330, ...@@ -19,5 +19,3 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
extern void dwarfout_file_scope_decl PARAMS ((tree , int)); extern void dwarfout_file_scope_decl PARAMS ((tree , int));
extern void dwarfout_begin_function PARAMS ((void));
...@@ -252,7 +252,7 @@ static void profile_function PARAMS ((FILE *)); ...@@ -252,7 +252,7 @@ static void profile_function PARAMS ((FILE *));
static void profile_after_prologue PARAMS ((FILE *)); static void profile_after_prologue PARAMS ((FILE *));
static void add_bb PARAMS ((FILE *)); static void add_bb PARAMS ((FILE *));
static int add_bb_string PARAMS ((const char *, int)); 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 rtx walk_alter_subreg PARAMS ((rtx));
static void output_asm_name PARAMS ((void)); static void output_asm_name PARAMS ((void));
static void output_operand PARAMS ((rtx, int)); static void output_operand PARAMS ((rtx, int));
...@@ -1576,37 +1576,16 @@ final_start_function (first, file, optimize) ...@@ -1576,37 +1576,16 @@ final_start_function (first, file, optimize)
} }
#endif #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) if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED)
last_linenum = high_block_linenum = high_function_linenum notice_source_line (first);
= NOTE_LINE_NUMBER (first); high_block_linenum = high_function_linenum = last_linenum;
#if defined (DWARF2_UNWIND_INFO) || defined (IA64_UNWIND_INFO) \ (*debug_hooks->begin_prologue) (last_linenum, last_filename);
|| defined (DWARF2_DEBUGGING_INFO)
dwarf2out_begin_prologue ();
#endif
/* For SDB and XCOFF, the function beginning must be marked between #if defined (DWARF2_UNWIND_INFO) || defined (IA64_UNWIND_INFO)
the function label and the prologue. We always need this, even when if (write_symbols != DWARF2_DEBUG)
-g1 was used. Defer on MIPS systems so that parameter descriptions dwarf2out_begin_prologue (0, NULL);
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
#endif #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 #ifdef LEAF_REG_REMAP
if (current_function_uses_only_leaf_regs) if (current_function_uses_only_leaf_regs)
...@@ -2079,24 +2058,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -2079,24 +2058,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
break; break;
case NOTE_INSN_FUNCTION_BEG: 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 (); app_disable ();
sdbout_begin_function (last_linenum); (*debug_hooks->end_prologue) (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
break; break;
case NOTE_INSN_BLOCK_BEG: case NOTE_INSN_BLOCK_BEG:
...@@ -2191,7 +2154,10 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -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 /* Output this line note if it is the first or the last line
note in a row. */ note in a row. */
if (!note_after) if (!note_after)
output_source_line (insn); {
notice_source_line (insn);
(*debug_hooks->source_line) (last_linenum, last_filename);
}
} }
break; break;
} }
...@@ -2906,7 +2872,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -2906,7 +2872,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
based on the NOTE-insn INSN, assumed to be a line number. */ based on the NOTE-insn INSN, assumed to be a line number. */
static void static void
output_source_line (insn) notice_source_line (insn)
rtx insn; rtx insn;
{ {
register const char *filename = NOTE_SOURCE_FILE (insn); register const char *filename = NOTE_SOURCE_FILE (insn);
...@@ -2923,8 +2889,6 @@ output_source_line (insn) ...@@ -2923,8 +2889,6 @@ output_source_line (insn)
last_linenum = NOTE_LINE_NUMBER (insn); last_linenum = NOTE_LINE_NUMBER (insn);
high_block_linenum = MAX (last_linenum, high_block_linenum); high_block_linenum = MAX (last_linenum, high_block_linenum);
high_function_linenum = MAX (last_linenum, high_function_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 /* For each operand in INSN, simplify (subreg (reg)) so that it refers
......
...@@ -97,8 +97,13 @@ static void sdbout_start_source_file PARAMS ((unsigned, const char *)); ...@@ -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_end_source_file PARAMS ((unsigned));
static void sdbout_begin_block PARAMS ((unsigned, unsigned)); static void sdbout_begin_block PARAMS ((unsigned, unsigned));
static void sdbout_end_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)); 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 void sdbout_end_function PARAMS ((unsigned int));
static char *gen_fake_label PARAMS ((void)); static char *gen_fake_label PARAMS ((void));
static int plain_type PARAMS ((tree)); static int plain_type PARAMS ((tree));
...@@ -299,7 +304,17 @@ struct gcc_debug_hooks sdb_debug_hooks = ...@@ -299,7 +304,17 @@ struct gcc_debug_hooks sdb_debug_hooks =
sdbout_begin_block, sdbout_begin_block,
sdbout_end_block, sdbout_end_block,
sdbout_source_line, 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_end_epilogue,
sdbout_begin_function,
sdbout_end_function sdbout_end_function
}; };
...@@ -775,8 +790,6 @@ sdbout_symbol (decl, local) ...@@ -775,8 +790,6 @@ sdbout_symbol (decl, local)
} }
else if (GET_CODE (value) == SUBREG) else if (GET_CODE (value) == SUBREG)
{ {
int offset = 0;
while (GET_CODE (value) == SUBREG) while (GET_CODE (value) == SUBREG)
value = SUBREG_REG (value); value = SUBREG_REG (value);
if (GET_CODE (value) == REG) if (GET_CODE (value) == REG)
...@@ -1521,12 +1534,10 @@ sdbout_end_block (line, n) ...@@ -1521,12 +1534,10 @@ sdbout_end_block (line, n)
} }
static void static void
sdbout_source_line (filename, note) sdbout_source_line (line, filename)
unsigned int line;
const char *filename ATTRIBUTE_UNUSED; const char *filename ATTRIBUTE_UNUSED;
rtx note;
{ {
unsigned int line = NOTE_LINE_NUMBER (note);
/* COFF relative line numbers must be positive. */ /* COFF relative line numbers must be positive. */
if (line > sdb_begin_function_line) if (line > sdb_begin_function_line)
{ {
...@@ -1543,21 +1554,32 @@ sdbout_source_line (filename, note) ...@@ -1543,21 +1554,32 @@ sdbout_source_line (filename, note)
/* Output sdb info for the current function name. /* Output sdb info for the current function name.
Called from assemble_start_function. */ Called from assemble_start_function. */
void static void
sdbout_mark_begin_function () sdbout_begin_function (decl)
tree decl ATTRIBUTE_UNUSED;
{ {
sdbout_symbol (current_function_decl, 0); sdbout_symbol (current_function_decl, 0);
} }
/* Called at beginning of function body (after prologue). /* Called at beginning of function body (before or after prologue,
Record the function's starting line number, so we can output depending on MIPS_DEBUGGING_INFO). Record the function's starting
relative line numbers for the other lines. line number, so we can output relative line numbers for the other
Describe beginning of outermost block. lines. Describe beginning of outermost block. Also describe the
Also describe the parameter list. */ parameter list. */
void #ifndef MIPS_DEBUGGING_INFO
sdbout_begin_function (line) static void
int line; 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; sdb_begin_function_line = line - 1;
PUT_SDB_FUNCTION_START (line); PUT_SDB_FUNCTION_START (line);
......
...@@ -18,12 +18,7 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -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, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
extern void sdbout_begin_function PARAMS ((int));
extern void sdbout_label PARAMS ((rtx)); extern void sdbout_label PARAMS ((rtx));
extern void sdbout_symbol PARAMS ((tree, int)); extern void sdbout_symbol PARAMS ((tree, int));
extern void sdbout_toplevel_data PARAMS ((tree)); extern void sdbout_toplevel_data PARAMS ((tree));
extern void sdbout_types PARAMS ((tree)); extern void sdbout_types PARAMS ((tree));
extern void sdbout_mark_begin_function PARAMS ((void));
...@@ -2919,11 +2919,6 @@ extern void dwarf2out_return_save PARAMS ((const char *, long)); ...@@ -2919,11 +2919,6 @@ extern void dwarf2out_return_save PARAMS ((const char *, long));
extern void dwarf2out_return_reg PARAMS ((const char *, unsigned)); 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 /* Redefine abort to report an internal error w/o coredump, and
reporting the location of the error in the source file. This logic reporting the location of the error in the source file. This logic
......
...@@ -47,6 +47,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -47,6 +47,7 @@ Boston, MA 02111-1307, USA. */
#include "c-pragma.h" #include "c-pragma.h"
#include "ggc.h" #include "ggc.h"
#include "tm_p.h" #include "tm_p.h"
#include "debug.h"
#ifdef XCOFF_DEBUGGING_INFO #ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h" #include "xcoffout.h"
...@@ -947,17 +948,7 @@ assemble_start_function (decl, fnname) ...@@ -947,17 +948,7 @@ assemble_start_function (decl, fnname)
ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname); ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname);
#endif #endif
#ifdef SDB_DEBUGGING_INFO (*debug_hooks->begin_function) (decl);
/* 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
/* Make function name accessible from other files, if appropriate. */ /* Make function name accessible from other files, if appropriate. */
......
...@@ -304,17 +304,19 @@ xcoffout_source_file (file, filename, inline_p) ...@@ -304,17 +304,19 @@ xcoffout_source_file (file, filename, inline_p)
} }
} }
/* Output a line number symbol entry into output stream FILE, /* Output a line number symbol entry for location (FILENAME, LINE). */
for source file FILENAME and line number NOTE. */
void void
xcoffout_source_line (filename, note) xcoffout_source_line (line, filename)
unsigned int line;
const char *filename; 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. /* Output the symbols defined in block number DO_BLOCK.
...@@ -431,17 +433,17 @@ xcoffout_declare_function (file, decl, name) ...@@ -431,17 +433,17 @@ xcoffout_declare_function (file, decl, name)
name, name, name, 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 Record the function's starting line number, so we can output
relative line numbers for the other lines. relative line numbers for the other lines.
Record the file name that this function is contained in. */ Record the file name that this function is contained in. */
void void
xcoffout_begin_function (file, last_linenum) xcoffout_begin_prologue (line, file)
FILE *file; unsigned int line;
int last_linenum; 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)); dbxout_parms (DECL_ARGUMENTS (current_function_decl));
/* Emit the symbols for the outermost BLOCK's variables. sdbout.c does this /* Emit the symbols for the outermost BLOCK's variables. sdbout.c does this
...@@ -452,7 +454,7 @@ xcoffout_begin_function (file, last_linenum) ...@@ -452,7 +454,7 @@ xcoffout_begin_function (file, last_linenum)
xcoffout_block (DECL_INITIAL (current_function_decl), 0, xcoffout_block (DECL_INITIAL (current_function_decl), 0,
DECL_ARGUMENTS (current_function_decl)); 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). /* Called at end of function (before epilogue).
......
...@@ -199,7 +199,8 @@ extern const char *xcoff_lastfile; ...@@ -199,7 +199,8 @@ extern const char *xcoff_lastfile;
extern int stab_to_sclass PARAMS ((int)); extern int stab_to_sclass PARAMS ((int));
#ifdef BUFSIZ #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_begin_block PARAMS ((unsigned, unsigned));
extern void xcoffout_end_epilogue PARAMS ((void)); extern void xcoffout_end_epilogue PARAMS ((void));
extern void xcoffout_end_function PARAMS ((unsigned int)); extern void xcoffout_end_function PARAMS ((unsigned int));
...@@ -215,6 +216,7 @@ extern void xcoffout_declare_function PARAMS ((FILE *, tree, const char *)); ...@@ -215,6 +216,7 @@ extern void xcoffout_declare_function PARAMS ((FILE *, tree, const char *));
#ifdef RTX_CODE #ifdef RTX_CODE
#ifdef BUFSIZ #ifdef BUFSIZ
extern void xcoffout_source_line PARAMS ((const char *, rtx)); extern void xcoffout_source_line PARAMS ((unsigned int,
const char *));
#endif /* BUFSIZ */ #endif /* BUFSIZ */
#endif /* RTX_CODE */ #endif /* RTX_CODE */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment