* 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
+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.
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) \
static void dbxout_really_begin_function PARAMS ((tree));
\f
/* 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,
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 */
\f
#if defined(ASM_OUTPUT_SECTION_NAME)
static void
#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. */
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
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;
+{
+}
/* 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;
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;
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. */
dwarf2out_define,
dwarf2out_undef,
dwarf2out_start_source_file,
- dwarf2out_end_source_file
+ dwarf2out_end_source_file,
+ dwarf2out_begin_block,
+ dwarf2out_end_block
};
\f
/* NOTE: In the comments in this file, many references are made to
/* 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);
/* 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);
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));
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));
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
};
\f
/************************ general utility functions **************************/
/* 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];
/* 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];
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));
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");
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. */
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;
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;
#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"
++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;
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;
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));
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
};
\f
#if 0
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);
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);
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));
/* 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;