summaryrefslogtreecommitdiff
path: root/gcc/sdbout.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-15 08:34:46 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-15 08:34:46 +0000
commitb9b7f8b4fd08792aa9fb040e026241d2cc1d2381 (patch)
tree3f39c7aa98569361a789583a5906c27e2596de19 /gcc/sdbout.c
parent1467e95364dd9434b7b74f72e3f5e482ae9b1fd7 (diff)
downloadgcc-b9b7f8b4fd08792aa9fb040e026241d2cc1d2381.tar.gz
* dbxout.c (dbxout_source_line): Make static, update prototype.
(dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44017 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sdbout.c')
-rw-r--r--gcc/sdbout.c77
1 files changed, 50 insertions, 27 deletions
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index aecdcf7826f..1faffbede39 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -80,7 +80,7 @@ AT&T C compiler. From the example below I would conclude the following:
/* Line number of beginning of current function, minus one.
Negative means not in a function or not using sdb. */
-int sdb_begin_function_line = -1;
+static int sdb_begin_function_line = -1;
/* Counter to generate unique "names" for nameless struct members. */
@@ -92,11 +92,14 @@ extern tree current_function_decl;
#include "sdbout.h"
-static void sdbout_init PARAMS ((FILE *, const char *));
+static void sdbout_init PARAMS ((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 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_end_epilogue PARAMS ((void));
+static void sdbout_end_function PARAMS ((unsigned int));
static char *gen_fake_label PARAMS ((void));
static int plain_type PARAMS ((tree));
static int template_name_p PARAMS ((tree));
@@ -225,15 +228,6 @@ do { fprintf (asm_out_file, "\t.tag\t"); \
SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM)
#endif
-#ifndef PUT_SDB_EPILOGUE_END
-#define PUT_SDB_EPILOGUE_END(NAME) \
-do { fprintf (asm_out_file, "\t.def\t"); \
- assemble_name (asm_out_file, NAME); \
- fprintf (asm_out_file, \
- "%s\t.val\t.%s\t.scl\t-1%s\t.endef\n", \
- SDB_DELIM, SDB_DELIM, SDB_DELIM); } while (0)
-#endif
-
#ifndef SDB_GENERATE_FAKE
#define SDB_GENERATE_FAKE(BUFFER, NUMBER) \
sprintf ((BUFFER), ".%dfake", (NUMBER));
@@ -297,13 +291,16 @@ static struct sdb_file *current_file;
struct gcc_debug_hooks sdb_debug_hooks =
{
sdbout_init,
- debug_nothing_file_charstar,
+ debug_nothing_charstar,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
sdbout_start_source_file,
sdbout_end_source_file,
sdbout_begin_block,
- sdbout_end_block
+ sdbout_end_block,
+ sdbout_source_line,
+ sdbout_end_epilogue,
+ sdbout_end_function
};
#if 0
@@ -1471,8 +1468,7 @@ sdbout_reg_parms (parms)
if the count starts at 0 for the outermost one. */
static void
-sdbout_begin_block (file, line, n)
- FILE *file ATTRIBUTE_UNUSED;
+sdbout_begin_block (line, n)
unsigned int line;
unsigned int n;
{
@@ -1508,9 +1504,8 @@ sdbout_begin_block (file, line, n)
/* Describe the end line-number of an internal block within a function. */
-void
-sdbout_end_block (file, line, n)
- FILE *file ATTRIBUTE_UNUSED;
+static void
+sdbout_end_block (line, n)
unsigned int line;
unsigned int n ATTRIBUTE_UNUSED;
{
@@ -1525,6 +1520,26 @@ sdbout_end_block (file, line, n)
PUT_SDB_BLOCK_END (line - sdb_begin_function_line);
}
+static void
+sdbout_source_line (filename, note)
+ 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)
+ {
+#ifdef ASM_OUTPUT_SOURCE_LINE
+ ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
+#else
+ fprintf (asm_out_file, "\t.ln\t%d\n",
+ ((sdb_begin_function_line > -1)
+ ? line - sdb_begin_function_line : 1));
+#endif
+ }
+}
+
/* Output sdb info for the current function name.
Called from assemble_start_function. */
@@ -1553,9 +1568,9 @@ sdbout_begin_function (line)
/* Called at end of function (before epilogue).
Describe end of outermost block. */
-void
+static void
sdbout_end_function (line)
- int line;
+ unsigned int line;
{
#ifdef SDB_ALLOW_FORWARD_REFERENCES
sdbout_dequeue_anonymous_types ();
@@ -1571,11 +1586,20 @@ sdbout_end_function (line)
/* Output sdb info for the absolute end of a function.
Called after the epilogue is output. */
-void
+static void
sdbout_end_epilogue ()
{
- PUT_SDB_EPILOGUE_END
- (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)));
+ const char *name
+ = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl));
+
+#ifdef PUT_SDB_EPILOGUE_END
+ PUT_SDB_EPILOGUE_END (name);
+#else
+ fprintf (asm_out_file, "\t.def\t");
+ assemble_name (asm_out_file, name);
+ fprintf (asm_out_file, "%s\t.val\t.%s\t.scl\t-1%s\t.endef\n",
+ SDB_DELIM, SDB_DELIM, SDB_DELIM);
+#endif
}
/* Output sdb info for the given label. Called only if LABEL_NAME (insn)
@@ -1628,8 +1652,7 @@ sdbout_end_source_file (line)
/* Set up for SDB output at the start of compilation. */
static void
-sdbout_init (asm_file, input_file_name)
- FILE *asm_file ATTRIBUTE_UNUSED;
+sdbout_init (input_file_name)
const char *input_file_name ATTRIBUTE_UNUSED;
{
#ifdef MIPS_DEBUGGING_INFO