Makefile.in (final.o): Depend on debug.h.

* Makefile.in (final.o): Depend on debug.h.
	* dbxout.c (dbxout_begin_block, dbxout_end_block): New.
	(dbx_debug_hooks): Add new hooks.
	(xcoff_debug_hooks): New.
	* debug.c (debug_nothing_file_int_int): New.
	(do_nothing_debug_hooks): Update.
	* debug.h (gcc_debug_hooks): New hooks begin_block and end_block.
	(debug_nothing_file_int_int): New.
	* dwarf2out.c (dwarf2out_begin_block, dwarf2out_end_block): Make
	static, update prototype.
	(dwarf2_debug_hooks): Update.
	* dwarf2out.h (dwarf2out_begin_block, dwarf2out_end_block): Remove.
	* dwarfout.c (dwarfout_begin_block, dwarfout_end_block): Make
	static, update prototype.
	(dwarf_debug_hooks): Update.
	* dwarfout.h (dwarfout_begin_block, dwarfout_end_block): Remove.
	* final.c: Include debug.h.
	(final_scan_insn): Use debug hooks when beginning and ending blocks.
	* sdbout.c (sdbout_begin_block, sdbout_end_block): Make
	static, update prototype.
	(sdb_debug_hooks): Update.
	* sdbout.h (sdbout_begin_block, sdbout_end_block): Remove.
	* toplev.c: Distinguish between xcoff and dbx.

	* f/lex.c (ffelex_file_pop_, ffelex_file_push_, ffelex_hash_):
	Call all debug hooks, not just dwarf ones.

From-SVN: r43959
This commit is contained in:
Neil Booth 2001-07-12 05:56:27 +00:00 committed by Neil Booth
parent c177db4bbe
commit a5a42b9293
14 changed files with 154 additions and 81 deletions

View File

@ -1,3 +1,32 @@
2001-07-12 Neil Booth <neil@daikokuya.demon.co.uk>
* Makefile.in (final.o): Depend on debug.h.
* dbxout.c (dbxout_begin_block, dbxout_end_block): New.
(dbx_debug_hooks): Add new hooks.
(xcoff_debug_hooks): New.
* debug.c (debug_nothing_file_int_int): New.
(do_nothing_debug_hooks): Update.
* debug.h (gcc_debug_hooks): New hooks begin_block and end_block.
(debug_nothing_file_int_int): New.
* dwarf2out.c (dwarf2out_begin_block, dwarf2out_end_block): Make
static, update prototype.
(dwarf2_debug_hooks): Update.
* dwarf2out.h (dwarf2out_begin_block, dwarf2out_end_block): Remove.
* dwarfout.c (dwarfout_begin_block, dwarfout_end_block): Make
static, update prototype.
(dwarf_debug_hooks): Update.
* dwarfout.h (dwarfout_begin_block, dwarfout_end_block): Remove.
* final.c: Include debug.h.
(final_scan_insn): Use debug hooks when beginning and ending blocks.
* sdbout.c (sdbout_begin_block, sdbout_end_block): Make
static, update prototype.
(sdb_debug_hooks): Update.
* sdbout.h (sdbout_begin_block, sdbout_end_block): Remove.
* toplev.c: Distinguish between xcoff and dbx.
* f/lex.c (ffelex_file_pop_, ffelex_file_push_, ffelex_hash_):
Call all debug hooks, not just dwarf ones.
2001-07-11 Timothy Wall <twall@redhat.com>
* config.gcc: Add configuration for AIX5/IA64.

View File

@ -1523,7 +1523,7 @@ sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H)
final.o : final.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h intl.h \
$(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \
real.h output.h hard-reg-set.h except.h \
real.h output.h hard-reg-set.h except.h debug.h \
xcoffout.h toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h \
dbxout.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H)
recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) function.h $(BASIC_BLOCK_H) \

View File

@ -312,6 +312,11 @@ static void dbxout_block PARAMS ((tree, int, tree));
static void dbxout_really_begin_function PARAMS ((tree));
/* The debug hooks structure. */
#if defined (DBX_DEBUGGING_INFO)
static void dbxout_begin_block PARAMS ((FILE *, unsigned, unsigned));
static void dbxout_end_block PARAMS ((FILE *, unsigned, unsigned));
struct gcc_debug_hooks dbx_debug_hooks =
{
dbxout_init,
@ -319,8 +324,25 @@ struct gcc_debug_hooks dbx_debug_hooks =
debug_nothing_int_charstar,
debug_nothing_int_charstar,
dbxout_start_source_file,
dbxout_end_source_file
dbxout_end_source_file,
dbxout_begin_block,
dbxout_end_block
};
#endif /* DBX_DEBUGGING_INFO */
#if defined (XCOFF_DEBUGGING_INFO)
struct gcc_debug_hooks xcoff_debug_hooks =
{
dbxout_init,
dbxout_finish,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
dbxout_start_source_file,
dbxout_end_source_file,
xcoffout_begin_block,
xcoffout_end_block
};
#endif /* XCOFF_DEBUGGING_INFO */
#if defined(ASM_OUTPUT_SECTION_NAME)
static void
@ -549,6 +571,32 @@ dbxout_source_line (file, filename, lineno)
#endif
}
#if defined (DBX_DEBUGGING_INFO)
/* Describe the beginning of an internal block within a function. */
static void
dbxout_begin_block (file, line, n)
FILE *file;
unsigned int line ATTRIBUTE_UNUSED;
unsigned int n;
{
ASM_OUTPUT_INTERNAL_LABEL (file, "LBB", n);
}
/* Describe the end line-number of an internal block within a function. */
static void
dbxout_end_block (file, line, n)
FILE *file;
unsigned int line ATTRIBUTE_UNUSED;
unsigned int n;
{
ASM_OUTPUT_INTERNAL_LABEL (file, "LBE", n);
}
#endif /* DBX_DEBUGGING_INFO */
/* At the end of compilation, finish writing the symbol table.
Unless you define DBX_OUTPUT_MAIN_SOURCE_FILE_END, the default is
to do nothing. */

View File

@ -27,7 +27,9 @@ struct gcc_debug_hooks do_nothing_debug_hooks =
debug_nothing_int_charstar,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
debug_nothing_int
debug_nothing_int,
debug_nothing_file_int_int,
debug_nothing_file_int_int
};
/* This file contains implementations of each debug hook that do
@ -52,3 +54,11 @@ debug_nothing_int (line)
unsigned int line ATTRIBUTE_UNUSED;
{
}
void
debug_nothing_file_int_int (file, line, n)
FILE *file ATTRIBUTE_UNUSED;
unsigned int line ATTRIBUTE_UNUSED;
unsigned int n ATTRIBUTE_UNUSED;
{
}

View File

@ -43,6 +43,13 @@ struct gcc_debug_hooks
/* Record the resumption of a source file. LINE is the line number
in the source file we are returning to. */
void (* end_source_file) PARAMS ((unsigned int line));
/* Record the beginning of block N, counting from 1 and not
including the function-scope block, at LINE. Output to FILE. */
void (* begin_block) PARAMS ((FILE *, unsigned int line, unsigned int n));
/* Record the end of a block. Arguments as for begin_block. */
void (* end_block) PARAMS ((FILE *, unsigned int line, unsigned int n));
};
extern struct gcc_debug_hooks *debug_hooks;
@ -54,11 +61,14 @@ extern void debug_nothing_int_charstar
PARAMS ((unsigned int, const char *));
extern void debug_nothing_int
PARAMS ((unsigned int));
extern void debug_nothing_file_int_int
PARAMS ((FILE *, unsigned int, unsigned int));
/* Hooks for various debug formats. */
extern struct gcc_debug_hooks do_nothing_debug_hooks;
extern struct gcc_debug_hooks dbx_debug_hooks;
extern struct gcc_debug_hooks sdb_debug_hooks;
extern struct gcc_debug_hooks xcoff_debug_hooks;
extern struct gcc_debug_hooks dwarf_debug_hooks;
extern struct gcc_debug_hooks dwarf2_debug_hooks;

View File

@ -3007,6 +3007,8 @@ static void dwarf2out_define PARAMS ((unsigned int, const char *));
static void dwarf2out_undef PARAMS ((unsigned int, const char *));
static void dwarf2out_start_source_file PARAMS ((unsigned, const char *));
static void dwarf2out_end_source_file PARAMS ((unsigned));
static void dwarf2out_begin_block PARAMS ((FILE *, unsigned, unsigned));
static void dwarf2out_end_block PARAMS ((FILE *, unsigned, unsigned));
/* The debug hooks structure. */
@ -3017,7 +3019,9 @@ struct gcc_debug_hooks dwarf2_debug_hooks =
dwarf2out_define,
dwarf2out_undef,
dwarf2out_start_source_file,
dwarf2out_end_source_file
dwarf2out_end_source_file,
dwarf2out_begin_block,
dwarf2out_end_block
};
/* NOTE: In the comments in this file, many references are made to
@ -11103,9 +11107,11 @@ dwarf2out_decl (decl)
/* Output a marker (i.e. a label) for the beginning of the generated code for
a lexical block. */
void
dwarf2out_begin_block (blocknum)
register unsigned blocknum;
static void
dwarf2out_begin_block (file, line, blocknum)
FILE *file ATTRIBUTE_UNUSED;
unsigned int line ATTRIBUTE_UNUSED;
unsigned int blocknum;
{
function_section (current_function_decl);
ASM_OUTPUT_DEBUG_LABEL (asm_out_file, BLOCK_BEGIN_LABEL, blocknum);
@ -11114,9 +11120,11 @@ dwarf2out_begin_block (blocknum)
/* Output a marker (i.e. a label) for the end of the generated code for a
lexical block. */
void
dwarf2out_end_block (blocknum)
register unsigned blocknum;
static void
dwarf2out_end_block (file, line, blocknum)
FILE *file ATTRIBUTE_UNUSED;
unsigned int line ATTRIBUTE_UNUSED;
unsigned int blocknum;
{
function_section (current_function_decl);
ASM_OUTPUT_DEBUG_LABEL (asm_out_file, BLOCK_END_LABEL, blocknum);

View File

@ -18,8 +18,6 @@ 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 dwarf2out_begin_block PARAMS ((unsigned));
extern void dwarf2out_end_block PARAMS ((unsigned));
extern int dwarf2out_ignore_block PARAMS ((tree));
extern void dwarf2out_decl PARAMS ((tree));
extern void dwarf2out_line PARAMS ((const char *, unsigned));

View File

@ -795,6 +795,8 @@ static void dwarfout_start_source_file PARAMS ((unsigned, const char *));
static void dwarfout_start_source_file_check PARAMS ((unsigned, const char *));
static void dwarfout_end_source_file PARAMS ((unsigned));
static void dwarfout_end_source_file_check PARAMS ((unsigned));
static void dwarfout_begin_block PARAMS ((FILE *, unsigned, unsigned));
static void dwarfout_end_block PARAMS ((FILE *, unsigned, unsigned));
static const char *dwarf_tag_name PARAMS ((unsigned));
static const char *dwarf_attr_name PARAMS ((unsigned));
static const char *dwarf_stack_op_name PARAMS ((unsigned));
@ -1375,7 +1377,9 @@ struct gcc_debug_hooks dwarf_debug_hooks =
dwarfout_define,
dwarfout_undef,
dwarfout_start_source_file_check,
dwarfout_end_source_file_check
dwarfout_end_source_file_check,
dwarfout_begin_block,
dwarfout_end_block
};
/************************ general utility functions **************************/
@ -5833,9 +5837,11 @@ dwarfout_file_scope_decl (decl, set_finalizing)
/* Output a marker (i.e. a label) for the beginning of the generated code
for a lexical block. */
void
dwarfout_begin_block (blocknum)
register unsigned blocknum;
static void
dwarfout_begin_block (file, line, blocknum)
FILE *file ATTRIBUTE_UNUSED;
unsigned int line ATTRIBUTE_UNUSED;
unsigned int blocknum;
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
@ -5847,9 +5853,11 @@ dwarfout_begin_block (blocknum)
/* Output a marker (i.e. a label) for the end of the generated code
for a lexical block. */
void
dwarfout_end_block (blocknum)
register unsigned blocknum;
static void
dwarfout_end_block (file, line, blocknum)
FILE *file ATTRIBUTE_UNUSED;
unsigned int line ATTRIBUTE_UNUSED;
unsigned int blocknum;
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];

View File

@ -24,7 +24,5 @@ extern void dwarfout_begin_function PARAMS ((void));
extern void dwarfout_end_function PARAMS ((void));
extern void dwarfout_begin_epilogue PARAMS ((void));
extern void dwarfout_end_epilogue PARAMS ((void));
extern void dwarfout_begin_block PARAMS ((unsigned));
extern void dwarfout_end_block PARAMS ((unsigned));
extern void dwarfout_line PARAMS ((const char *, unsigned));

View File

@ -857,8 +857,7 @@ ffelex_file_pop_ (const char *input_filename)
input_file_stack = p->next;
free (p);
input_file_stack_tick++;
if (write_symbols == DWARF_DEBUG)
(*debug_hooks->end_source_file) (input_file_stack->line);
(*debug_hooks->end_source_file) (input_file_stack->line);
}
else
error ("#-lines for entering and leaving files don't match");
@ -883,8 +882,7 @@ ffelex_file_push_ (int old_lineno, const char *input_filename)
input_file_stack = p;
input_file_stack_tick++;
if (write_symbols == DWARF_DEBUG)
(*debug_hooks->start_source_file) (0, input_filename);
(*debug_hooks->start_source_file) (0, input_filename);
/* Now that we've pushed or popped the input stack,
update the name in the top element. */
@ -1165,8 +1163,7 @@ ffelex_hash_ (FILE *finput)
c = ffelex_get_directive_line_ (&text, finput);
if ((debug_info_level == DINFO_LEVEL_VERBOSE)
&& (write_symbols == DWARF_DEBUG))
if (debug_info_level == DINFO_LEVEL_VERBOSE)
(*debug_hooks->define) (lineno, text);
goto skipline;
@ -1185,8 +1182,7 @@ ffelex_hash_ (FILE *finput)
c = ffelex_get_directive_line_ (&text, finput);
if ((debug_info_level == DINFO_LEVEL_VERBOSE)
&& (write_symbols == DWARF_DEBUG))
if (debug_info_level == DINFO_LEVEL_VERBOSE)
(*debug_hooks->undef) (lineno, text);
goto skipline;

View File

@ -66,6 +66,7 @@ Boston, MA 02111-1307, USA. */
#include "intl.h"
#include "basic-block.h"
#include "target.h"
#include "debug.h"
#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
#include "dbxout.h"
@ -2138,27 +2139,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
++block_depth;
high_block_linenum = last_linenum;
/* Output debugging info about the symbol-block beginning. */
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)
sdbout_begin_block (file, last_linenum, n);
#endif
#ifdef XCOFF_DEBUGGING_INFO
if (write_symbols == XCOFF_DEBUG)
xcoffout_begin_block (file, last_linenum, n);
#endif
#ifdef DBX_DEBUGGING_INFO
if (write_symbols == DBX_DEBUG)
ASM_OUTPUT_INTERNAL_LABEL (file, "LBB", n);
#endif
#ifdef DWARF_DEBUGGING_INFO
if (write_symbols == DWARF_DEBUG)
dwarfout_begin_block (n);
#endif
#ifdef DWARF2_DEBUGGING_INFO
if (write_symbols == DWARF2_DEBUG)
dwarf2out_begin_block (n);
#endif
/* Output debugging info about the symbol-block beginning. */
(*debug_hooks->begin_block) (file, last_linenum, n);
/* Mark this block as output. */
TREE_ASM_WRITTEN (NOTE_BLOCK (insn)) = 1;
@ -2180,26 +2162,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (block_depth < 0)
abort ();
#ifdef XCOFF_DEBUGGING_INFO
if (write_symbols == XCOFF_DEBUG)
xcoffout_end_block (file, high_block_linenum, n);
#endif
#ifdef DBX_DEBUGGING_INFO
if (write_symbols == DBX_DEBUG)
ASM_OUTPUT_INTERNAL_LABEL (file, "LBE", n);
#endif
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)
sdbout_end_block (file, high_block_linenum, n);
#endif
#ifdef DWARF_DEBUGGING_INFO
if (write_symbols == DWARF_DEBUG)
dwarfout_end_block (n);
#endif
#ifdef DWARF2_DEBUGGING_INFO
if (write_symbols == DWARF2_DEBUG)
dwarf2out_end_block (n);
#endif
(*debug_hooks->end_block) (file, high_block_linenum, n);
}
break;

View File

@ -95,6 +95,8 @@ extern tree current_function_decl;
static void sdbout_init PARAMS ((FILE *, const char *));
static void sdbout_start_source_file PARAMS ((unsigned, const char *));
static void sdbout_end_source_file PARAMS ((unsigned));
static void sdbout_begin_block PARAMS ((FILE *, unsigned, unsigned));
static void sdbout_end_block PARAMS ((FILE *, unsigned, unsigned));
static char *gen_fake_label PARAMS ((void));
static int plain_type PARAMS ((tree));
static int template_name_p PARAMS ((tree));
@ -299,7 +301,9 @@ struct gcc_debug_hooks sdb_debug_hooks =
debug_nothing_int_charstar,
debug_nothing_int_charstar,
sdbout_start_source_file,
sdbout_end_source_file
sdbout_end_source_file,
sdbout_begin_block,
sdbout_end_block
};
#if 0
@ -1466,11 +1470,11 @@ sdbout_reg_parms (parms)
The blocks match the BLOCKs in DECL_INITIAL (current_function_decl),
if the count starts at 0 for the outermost one. */
void
static void
sdbout_begin_block (file, line, n)
FILE *file ATTRIBUTE_UNUSED;
int line;
int n;
unsigned int line;
unsigned int n;
{
tree decl = current_function_decl;
MAKE_LINE_SAFE (line);
@ -1507,8 +1511,8 @@ sdbout_begin_block (file, line, n)
void
sdbout_end_block (file, line, n)
FILE *file ATTRIBUTE_UNUSED;
int line;
int n ATTRIBUTE_UNUSED;
unsigned int line;
unsigned int n ATTRIBUTE_UNUSED;
{
MAKE_LINE_SAFE (line);

View File

@ -21,9 +21,6 @@ Boston, MA 02111-1307, USA. */
extern void sdbout_begin_function PARAMS ((int));
extern void sdbout_end_function PARAMS ((int));
extern void sdbout_begin_block PARAMS ((FILE *, int, int));
extern void sdbout_end_block PARAMS ((FILE *, int, int));
extern void sdbout_label PARAMS ((rtx));
extern void sdbout_symbol PARAMS ((tree, int));
extern void sdbout_toplevel_data PARAMS ((tree));

View File

@ -2289,10 +2289,14 @@ compile_file (name)
/* Set up the debug hooks based on write_symbols. Default to doing
nothing. */
debug_hooks = &do_nothing_debug_hooks;
#if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
#if defined(DBX_DEBUGGING_INFO)
if (write_symbols == DBX_DEBUG)
debug_hooks = &dbx_debug_hooks;
#endif
#if defined(XCOFF_DEBUGGING_INFO)
if (write_symbols == XCOFF_DEBUG)
debug_hooks = &xcoff_debug_hooks;
#endif
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)
debug_hooks = &sdb_debug_hooks;