summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-21 00:53:47 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-21 00:53:47 +0000
commite3b8b6976b826173fef677fe922dec4911c255be (patch)
treeea17211112b44ee6bb2818eb53ac97aadff9e550 /gcc/config
parent345f9bf751a7605a97debb82b10fb954d09dd28e (diff)
downloadgcc-e3b8b6976b826173fef677fe922dec4911c255be.tar.gz
* dbxout.c (asmfile): Delete. All uses changed to asm_out_file.
(DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89357 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha-protos.h1
-rw-r--r--gcc/config/alpha/alpha.c42
-rw-r--r--gcc/config/alpha/alpha.h11
-rw-r--r--gcc/config/alpha/unicosmk.h2
-rw-r--r--gcc/config/arm/aout.h13
-rw-r--r--gcc/config/avr/avr.h3
-rw-r--r--gcc/config/c4x/c4x.h2
-rw-r--r--gcc/config/darwin.h7
-rw-r--r--gcc/config/dbxcoff.h25
-rw-r--r--gcc/config/dbxelf.h24
-rw-r--r--gcc/config/h8300/coff.h6
-rw-r--r--gcc/config/m32r/m32r.h3
-rw-r--r--gcc/config/mcore/mcore-pe.h18
-rw-r--r--gcc/config/mips/mips-protos.h1
-rw-r--r--gcc/config/mips/mips.c40
-rw-r--r--gcc/config/mips/mips.h23
-rw-r--r--gcc/config/mips/sdb.h2
-rw-r--r--gcc/config/mmix/mmix.c10
-rw-r--r--gcc/config/mmix/mmix.h4
-rw-r--r--gcc/config/pa/pa.h4
-rw-r--r--gcc/config/pa/som.h26
-rw-r--r--gcc/config/ptx4.h17
-rw-r--r--gcc/config/rs6000/linux64.h16
-rw-r--r--gcc/config/sh/elf.h20
-rw-r--r--gcc/config/vax/elf.h3
25 files changed, 55 insertions, 268 deletions
diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h
index c5d0157baef..07d70649908 100644
--- a/gcc/config/alpha/alpha-protos.h
+++ b/gcc/config/alpha/alpha-protos.h
@@ -34,7 +34,6 @@ extern int alpha_using_fp (void);
extern void alpha_expand_prologue (void);
extern void alpha_expand_epilogue (void);
extern void alpha_output_filename (FILE *, const char *);
-extern void alpha_output_lineno (FILE *, int);
extern bool alpha_const_ok_for_letter_p (HOST_WIDE_INT, int);
extern bool alpha_const_double_ok_for_letter_p (rtx, int);
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index b1de390bc53..eeff191dd2a 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -6547,6 +6547,9 @@ alpha_expand_prologue (void)
emit_insn (gen_blockage ());
}
+/* Count the number of .file directives, so that .loc is up to date. */
+static int num_source_filenames = 0;
+
/* Output the textual info surrounding the prologue. */
void
@@ -6613,10 +6616,10 @@ alpha_start_function (FILE *file, const char *fnname,
ASM_OUTPUT_SOURCE_FILENAME (file,
DECL_SOURCE_FILE (current_function_decl));
#endif
-#ifdef ASM_OUTPUT_SOURCE_LINE
+#ifdef SDB_OUTPUT_SOURCE_LINE
if (debug_info_level != DINFO_LEVEL_TERSE)
- ASM_OUTPUT_SOURCE_LINE (file,
- DECL_SOURCE_LINE (current_function_decl), 0);
+ SDB_OUTPUT_SOURCE_LINE (file,
+ DECL_SOURCE_LINE (current_function_decl));
#endif
}
@@ -7149,14 +7152,6 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
int sdb_label_count = 0;
-/* Next label # for each statement. */
-
-static int sym_lineno = 0;
-
-/* Count the number of .file directives, so that .loc is up to date. */
-
-static int num_source_filenames = 0;
-
/* Name of the file containing the current function. */
static const char *current_function_file = "";
@@ -7172,7 +7167,6 @@ void
alpha_output_filename (FILE *stream, const char *name)
{
static int first_time = TRUE;
- char ltext_label_name[100];
if (first_time)
{
@@ -7187,12 +7181,8 @@ alpha_output_filename (FILE *stream, const char *name)
}
else if (write_symbols == DBX_DEBUG)
- {
- ASM_GENERATE_INTERNAL_LABEL (ltext_label_name, "Ltext", 0);
- fprintf (stream, "%s", ASM_STABS_OP);
- output_quoted_string (stream, name);
- fprintf (stream, ",%d,0,0,%s\n", N_SOL, &ltext_label_name[1]);
- }
+ /* dbxout.c will emit an appropriate .stabs directive. */
+ return;
else if (name != current_function_file
&& strcmp (name, current_function_file) != 0)
@@ -7210,22 +7200,6 @@ alpha_output_filename (FILE *stream, const char *name)
fprintf (stream, "\n");
}
}
-
-/* Emit a linenumber to a stream. */
-
-void
-alpha_output_lineno (FILE *stream, int line)
-{
- if (write_symbols == DBX_DEBUG)
- {
- /* mips-tfile doesn't understand .stabd directives. */
- ++sym_lineno;
- fprintf (stream, "$LM%d:\n%s%d,0,%d,$LM%d\n",
- sym_lineno, ASM_STABN_OP, N_SLINE, line, sym_lineno);
- }
- else
- fprintf (stream, "\n\t.loc\t%d %d\n", num_source_filenames, line);
-}
/* Structure to show the current status of registers and memory. */
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index fe3cedcb520..edda309d1be 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -1661,9 +1661,14 @@ extern long alpha_auto_offset;
((GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) + alpha_auto_offset)
#define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET + alpha_arg_offset)
-
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
- alpha_output_lineno (STREAM, LINE)
+/* mips-tfile doesn't understand .stabd directives. */
+#define DBX_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
+ fprintf (STREAM, "$LM%d:\n%s%d,0,%d,$LM%d\n", COUNTER, ASM_STABN_OP, \
+ N_SLINE, LINE, COUNTER)
+
+/* We want to use MIPS-style .loc directives for SDB line numbers. */
+#define SDB_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ fprintf (STREAM, "\t.loc\t%d %d", num_source_filenames, LINE)
#define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
alpha_output_filename (STREAM, NAME)
diff --git a/gcc/config/alpha/unicosmk.h b/gcc/config/alpha/unicosmk.h
index c0aac5330e8..1f6be35e09b 100644
--- a/gcc/config/alpha/unicosmk.h
+++ b/gcc/config/alpha/unicosmk.h
@@ -470,7 +470,7 @@ ssib_section (void) \
#undef DWARF2_DEBUGGING_INFO
#undef DWARF2_UNWIND_INFO
#undef INCOMING_RETURN_ADDR_RTX
-#undef ASM_OUTPUT_SOURCE_LINE
+#undef PREFERRED_DEBUGGING_TYPE
/* We don't need a start file. */
diff --git a/gcc/config/arm/aout.h b/gcc/config/arm/aout.h
index fb27dc5c383..91fc6d266c1 100644
--- a/gcc/config/arm/aout.h
+++ b/gcc/config/arm/aout.h
@@ -193,19 +193,6 @@
#define DBX_CONTIN_LENGTH 0
#endif
-/* Output a source filename for the debugger. RISCiX dbx insists that the
- ``desc'' field is set to compiler version number >= 315 (sic). */
-#define DBX_OUTPUT_MAIN_SOURCE_FILENAME(STREAM, NAME) \
- do \
- { \
- fprintf (STREAM, ".stabs "); \
- output_quoted_string (STREAM, NAME); \
- fprintf (STREAM, ",%d,0,315,%s\n", N_SO, &ltext_label_name[1]); \
- text_section (); \
- (*targetm.asm_out.internal_label) (STREAM, "Ltext", 0); \
- } \
- while (0)
-
/* Output a function label definition. */
#ifndef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index da06c207604..669ca36d26a 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -557,9 +557,6 @@ progmem_section (void) \
#define ASM_APP_OFF "/* #NOAPP */\n"
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
- fprintf (STREAM,"/* line: %d */\n",LINE)
-
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index 18f31805d6f..d514e5aa806 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -1452,8 +1452,6 @@ fini_section () \
} \
}
-#define ASM_STABS_OP "\t.stabs\t"
-
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION c4x_asm_named_section
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 75ac884c5e4..554ae9f89ed 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -362,12 +362,7 @@ extern const char *darwin_fix_and_continue_switch;
/* gdb needs a null N_SO at the end of each file for scattered loading. */
-#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
-#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
-do { text_section (); \
- fprintf (FILE, \
- "\t.stabs \"%s\",%d,0,0,Letext\nLetext:\n", "" , N_SO); \
- } while (0)
+#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
/* Making a symbols weak on Darwin requires more than just setting DECL_WEAK. */
#define MAKE_DECL_ONE_ONLY(DECL) darwin_make_decl_one_only (DECL)
diff --git a/gcc/config/dbxcoff.h b/gcc/config/dbxcoff.h
index 76a910f3225..e9e9acaec75 100644
--- a/gcc/config/dbxcoff.h
+++ b/gcc/config/dbxcoff.h
@@ -34,43 +34,22 @@ Boston, MA 02111-1307, USA. */
/* Be function-relative for block and source line stab directives. */
-#undef DBX_BLOCKS_FUNCTION_RELATIVE
#define DBX_BLOCKS_FUNCTION_RELATIVE 1
/* but, to make this work, functions must appear prior to line info. */
-#undef DBX_FUNCTION_FIRST
#define DBX_FUNCTION_FIRST
/* Generate a blank trailing N_SO to mark the end of the .o file, since
we can't depend upon the linker to mark .o file boundaries with
embedded stabs. */
-#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
-#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
- asm_fprintf (FILE, \
- "\t.text\n\t.stabs \"\",%d,0,0,%LLetext\n%LLetext:\n", N_SO)
+#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
/* Like block addresses, stabs line numbers are relative to the
current function. */
-#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
-{ if (write_symbols == SDB_DEBUG) { \
- fprintf ((FILE), "\t.ln\t%d\n", \
- ((sdb_begin_function_line > -1) \
- ? (LINE) - sdb_begin_function_line : 1)); \
- } else if (write_symbols == DBX_DEBUG) { \
- char buffer[256]; \
- ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", COUNTER); \
- fprintf (FILE, ".stabn 68,0,%d,", LINE); \
- assemble_name (FILE, buffer); \
- putc ('-', FILE); \
- assemble_name (FILE, \
- XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
- putc ('\n', FILE); \
- (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
- } }
+#define DBX_LINES_FUNCTION_RELATIVE 1
/* When generating stabs debugging, use N_BINCL entries. */
diff --git a/gcc/config/dbxelf.h b/gcc/config/dbxelf.h
index e636daddc87..b26b005a864 100644
--- a/gcc/config/dbxelf.h
+++ b/gcc/config/dbxelf.h
@@ -34,17 +34,14 @@ Boston, MA 02111-1307, USA. */
way, gdb expects it, and it reduces the number of relocation
entries... */
-#undef DBX_BLOCKS_FUNCTION_RELATIVE
#define DBX_BLOCKS_FUNCTION_RELATIVE 1
/* ... but, to make this work, functions must appear prior to line info. */
-#undef DBX_FUNCTION_FIRST
#define DBX_FUNCTION_FIRST
/* When generating stabs debugging, use N_BINCL entries. */
-#undef DBX_USE_BINCL
#define DBX_USE_BINCL
/* There is no limit to the length of stabs strings. */
@@ -56,29 +53,12 @@ Boston, MA 02111-1307, USA. */
/* Like block addresses, stabs line numbers are relative to the
current function. */
-#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
-do \
- { \
- char temp[256]; \
- ASM_GENERATE_INTERNAL_LABEL (temp, "LM", COUNTER); \
- fprintf (FILE, "\t.stabn 68,0,%d,", LINE); \
- assemble_name (FILE, temp); \
- putc ('-', FILE); \
- assemble_name (FILE, \
- XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
- putc ('\n', FILE); \
- (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
- } \
-while (0)
+#define DBX_LINES_FUNCTION_RELATIVE 1
/* Generate a blank trailing N_SO to mark the end of the .o file, since
we can't depend upon the linker to mark .o file boundaries with
embedded stabs. */
-#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
-#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
- asm_fprintf (FILE, \
- "\t.text\n\t.stabs \"\",%d,0,0,%LLetext\n%LLetext:\n", N_SO)
+#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
#endif /* ! GCC_DBX_ELF_H */
diff --git a/gcc/config/h8300/coff.h b/gcc/config/h8300/coff.h
index 7d173193ad1..0420277d078 100644
--- a/gcc/config/h8300/coff.h
+++ b/gcc/config/h8300/coff.h
@@ -27,15 +27,11 @@ Boston, MA 02111-1307, USA. */
#define SDB_DEBUGGING_INFO 1
#define SDB_DELIM "\n"
-/* Override definition in dbxcoff.h. */
/* Generate a blank trailing N_SO to mark the end of the .o file, since
we can't depend upon the linker to mark .o file boundaries with
embedded stabs. */
-#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
-#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
- fprintf (FILE, \
- "\t.text\n.stabs \"\",%d,0,0,.Letext\n.Letext:\n", N_SO)
+#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
/* This is how to output an assembler line
that says to advance the location counter by SIZE bytes. */
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index d5aa56b82e6..5513feadfbb 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -1525,8 +1525,7 @@ L2: .word STATIC
a word so don't ever force line number labels to begin at the beginning
of a word. */
-#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
+#define DBX_OUTPUT_SOURCE_LINE(file, line, counter) \
do \
{ \
fprintf (file, ".stabn 68,0,%d,.LM%d-", \
diff --git a/gcc/config/mcore/mcore-pe.h b/gcc/config/mcore/mcore-pe.h
index 502ca018e16..224f3423981 100644
--- a/gcc/config/mcore/mcore-pe.h
+++ b/gcc/config/mcore/mcore-pe.h
@@ -104,23 +104,7 @@ drectve_section () \
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
-#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
- { \
- if (write_symbols == DBX_DEBUG) \
- { \
- char buffer[256]; \
- \
- ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", COUNTER); \
- fprintf (FILE, ".stabn 68,0,%d,", LINE); \
- assemble_name (FILE, buffer); \
- putc ('-', FILE); \
- assemble_name (FILE, \
- XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
- putc ('\n', FILE); \
- (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
- } \
- }
+#define DBX_LINES_FUNCTION_RELATIVE 1
#define STARTFILE_SPEC "crt0.o%s"
#define ENDFILE_SPEC "%{!mno-lsim:-lsim}"
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index 177da63bd13..834c41d1a8e 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -158,7 +158,6 @@ extern void print_operand (FILE *, rtx, int);
extern void print_operand_address (FILE *, rtx);
extern int mips_output_external (FILE *, tree, const char *);
extern void mips_output_filename (FILE *, const char *);
-extern void mips_output_lineno (FILE *, int);
extern void mips_output_ascii (FILE *, const char *, size_t, const char *);
extern void mips_output_aligned_bss (FILE *, tree, const char *,
unsigned HOST_WIDE_INT, int);
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 048e5a8a365..a109b82a099 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -5069,44 +5069,24 @@ mips_output_filename (FILE *stream, const char *name)
mips_output_filename_first_time = 0;
num_source_filenames += 1;
current_function_file = name;
- ASM_OUTPUT_FILENAME (stream, num_source_filenames, name);
+ fprintf (stream, "\t.file\t%d ", num_source_filenames);
+ output_quoted_string (stream, name);
+ putc ('\n', stream);
}
+ /* If we are emitting stabs, let dbxout.c handle this (except for
+ the mips_output_filename_first_time case). */
else if (write_symbols == DBX_DEBUG)
- {
- ASM_GENERATE_INTERNAL_LABEL (ltext_label_name, "Ltext", 0);
- fputs ("\t.stabs\t", stream);
- output_quoted_string (stream, name);
- fprintf (stream, ",%d,0,0,%s\n", N_SOL, &ltext_label_name[1]);
- }
+ return;
else if (name != current_function_file
&& strcmp (name, current_function_file) != 0)
{
num_source_filenames += 1;
current_function_file = name;
- ASM_OUTPUT_FILENAME (stream, num_source_filenames, name);
- }
-}
-
-/* Emit a linenumber. For encapsulated stabs, we need to put out a stab
- as well as a .loc, since it is possible that MIPS ECOFF might not be
- able to represent the location for inlines that come from a different
- file. */
-
-void
-mips_output_lineno (FILE *stream, int line)
-{
- if (write_symbols == DBX_DEBUG)
- {
- ++sym_lineno;
- fprintf (stream, "%sLM%d:\n\t.stabn\t%d,0,%d,%sLM%d\n",
- LOCAL_LABEL_PREFIX, sym_lineno, N_SLINE, line,
- LOCAL_LABEL_PREFIX, sym_lineno);
- }
- else
- {
- fprintf (stream, "\n\t.loc\t%d %d\n", num_source_filenames, line);
+ fprintf (stream, "\t.file\t%d ", num_source_filenames);
+ output_quoted_string (stream, name);
+ putc ('\n', stream);
}
}
@@ -5963,7 +5943,7 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
#ifdef SDB_DEBUGGING_INFO
if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG)
- ASM_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl), 0);
+ SDB_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl));
#endif
/* In mips16 mode, we may need to generate a 32 bit to handle
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 6ec54072749..b35b7d9b3df 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -2790,20 +2790,15 @@ while (0)
#define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
mips_output_filename (STREAM, NAME)
-/* This is defined so that it can be overridden in iris6.h. */
-#define ASM_OUTPUT_FILENAME(STREAM, NUM_SOURCE_FILENAMES, NAME) \
-do \
- { \
- fprintf (STREAM, "\t.file\t%d ", NUM_SOURCE_FILENAMES); \
- output_quoted_string (STREAM, NAME); \
- fputs ("\n", STREAM); \
- } \
-while (0)
-
-#ifndef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
- mips_output_lineno (STREAM, LINE)
-#endif
+/* mips-tfile does not understand .stabd directives. */
+#define DBX_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
+ fprintf (STREAM, "%sLM%d:\n\t.stabn\t%d,0,%d,%sLM%d\n", \
+ LOCAL_LABEL_PREFIX, COUNTER, N_SLINE, LINE, \
+ LOCAL_LABEL_PREFIX, COUNTER)
+
+/* Use .loc directives for SDB line numbers. */
+#define SDB_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ fprintf (STREAM, "\t.loc\t%d %d", num_source_filenames, LINE)
/* The MIPS implementation uses some labels for its own purpose. The
following lists what labels are created, and are all formed by the
diff --git a/gcc/config/mips/sdb.h b/gcc/config/mips/sdb.h
index 50d0158057d..fe52c0dc88d 100644
--- a/gcc/config/mips/sdb.h
+++ b/gcc/config/mips/sdb.h
@@ -67,7 +67,7 @@ do { \
#define PUT_SDB_FUNCTION_END(LINE) \
do { \
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line, 0); \
+ SDB_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line); \
} while (0)
#define PUT_SDB_EPILOGUE_END(NAME)
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index c08fa92e1d7..98d8d60fd38 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -1236,16 +1236,6 @@ mmix_output_quoted_string (FILE *stream, const char *string, int length)
}
}
-/* ASM_OUTPUT_SOURCE_LINE. */
-
-void
-mmix_asm_output_source_line (FILE *stream, int lineno)
-{
- fprintf (stream, "# %d ", lineno);
- OUTPUT_QUOTED_STRING (stream, main_input_filename);
- fprintf (stream, "\n");
-}
-
/* Target hook for assembling integer objects. Use mmix_print_operand
for WYDE and TETRA. Use mmix_output_octa to output 8-byte
CONST_DOUBLEs. */
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 143c8de462e..501837ebf85 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -888,12 +888,8 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
#define OUTPUT_QUOTED_STRING(STREAM, STRING) \
mmix_output_quoted_string (STREAM, STRING, strlen (STRING))
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
- mmix_asm_output_source_line (STREAM, LINE)
-
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
-
/* Node: Data Output */
#define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 18fb21706a3..e5c30b2c147 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -369,10 +369,6 @@ extern int target_flags;
#undef DBX_CONTIN_LENGTH
#define DBX_CONTIN_LENGTH 3000
-/* Only labels should ever begin in column zero. */
-#define ASM_STABS_OP "\t.stabs\t"
-#define ASM_STABN_OP "\t.stabn\t"
-
/* GDB always assumes the current function's frame begins at the value
of the stack pointer upon entry to the current function. Accessing
local variables and parameters passed on the stack is done using the
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index ff152aecf96..ac01ca1de4f 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -27,33 +27,11 @@ Boston, MA 02111-1307, USA. */
from other embedded stabs implementations. */
#undef DBX_USE_BINCL
-/* We make the first line stab special to avoid adding several
- gross hacks to GAS. */
-#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
- { static tree last_function_decl = NULL; \
- if (current_function_decl == last_function_decl) \
- { \
- rtx func = DECL_RTL (current_function_decl); \
- const char *name = XSTR (XEXP (func, 0), 0); \
- fprintf (file, "\t.stabn 68,0,%d,L$M%d-%s\nL$M%d:\n", \
- line, counter, \
- (* targetm.strip_name_encoding) (name), \
- counter); \
- } \
- else \
- fprintf (file, "\t.stabn 68,0,%d,0\n", line); \
- last_function_decl = current_function_decl; \
- }
+#define DBX_LINES_FUNCTION_RELATIVE 1
/* gdb needs a null N_SO at the end of each file for scattered loading. */
-#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
-#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
- text_section (); \
- fputs ("\t.SPACE $TEXT$\n\t.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n", FILE); \
- fprintf (FILE, \
- "\t.stabs \"\",%d,0,0,L$text_end0000\nL$text_end0000:\n", N_SO)
+#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
/* Select a format to encode pointers in exception handling data. CODE
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
diff --git a/gcc/config/ptx4.h b/gcc/config/ptx4.h
index 33e91d15135..2b0fadcd69a 100644
--- a/gcc/config/ptx4.h
+++ b/gcc/config/ptx4.h
@@ -184,26 +184,13 @@ Boston, MA 02111-1307, USA.
/* Like block addresses, stabs line numbers are relative to the
current function. */
-#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
-do \
- { \
- fprintf (file, ".stabn 68,0,%d,.LM%d-", \
- line, counter); \
- assemble_name (file, \
- XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
- fprintf (file, "\n.LM%d:\n", counter); \
- } \
-while (0)
+#define DBX_LINES_FUNCTION_RELATIVE 1
/* Generate a blank trailing N_SO to mark the end of the .o file, since
we can't depend upon the linker to mark .o file boundaries with
embedded stabs. */
-#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
-#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
- fprintf (FILE, \
- "\t.text\n\t.stabs \"\",%d,0,0,.Letext\n.Letext:\n", N_SO)
+#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
/* Define the actual types of some ANSI-mandated types. (These
definitions should work for most SVR4 systems). */
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index c98a39059e3..02d5167c2d9 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -482,10 +482,9 @@ extern int dot_symbols;
&& GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
&& BITS_PER_WORD == HOST_BITS_PER_INT)))))
-/* This is the same as the dbxelf.h version, except that we need to
+/* This ABI cannot use DBX_LINES_FUNCTION_RELATIVE, because we must
use the function code label, not the function descriptor. */
-#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
+#define DBX_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
do \
{ \
char temp[256]; \
@@ -509,15 +508,8 @@ while (0)
fprintf (FILE, "%s%d,0,0,", ASM_STABN_OP, BRAC); \
assemble_name (FILE, NAME); \
putc ('-', FILE); \
- if (current_function_func_begin_label != NULL) \
- { \
- assemble_name (FILE, current_function_func_begin_label); \
- } \
- else \
- { \
- s = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \
- rs6000_output_function_entry (FILE, s); \
- } \
+ s = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \
+ rs6000_output_function_entry (FILE, s); \
putc ('\n', FILE); \
} \
while (0)
diff --git a/gcc/config/sh/elf.h b/gcc/config/sh/elf.h
index 2a0527ffef1..b069308ea8c 100644
--- a/gcc/config/sh/elf.h
+++ b/gcc/config/sh/elf.h
@@ -83,24 +83,8 @@ Boston, MA 02111-1307, USA. */
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
-#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
-do \
- { \
- asm_fprintf ((file), ".stabn 68,0,%d,%LLM%d-", \
- (line), (counter)); \
- assemble_name ((file), \
- XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
- asm_fprintf ((file), "\n%LLM%d:\n", (counter)); \
- } \
-while (0)
-
-#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
-#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
-do { \
- text_section (); \
- asm_fprintf ((FILE), "\t.stabs \"\",%d,0,0,%LLetext\n%LLetext:\n", N_SO); \
-} while (0)
+#define DBX_LINES_FUNCTION_RELATIVE 1
+#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
diff --git a/gcc/config/vax/elf.h b/gcc/config/vax/elf.h
index 533ce92b8bd..43757ebdfee 100644
--- a/gcc/config/vax/elf.h
+++ b/gcc/config/vax/elf.h
@@ -42,9 +42,6 @@ Boston, MA 02111-1307, USA. */
/* Let's be re-entrant. */
#undef PCC_STATIC_STRUCT_RETURN
-/* Make sure .stabs for a function are always the same section. */
-#define DBX_OUTPUT_FUNCTION_END(file,decl) function_section(decl)
-
/* Before the prologue, the top of the frame is below the argument
count pushed by the CALLS and before the start of the saved registers. */
#define INCOMING_FRAME_SP_OFFSET 0