aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2003-06-17 10:06:58 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2003-06-17 08:06:58 +0000
commita8d0467e650910986afba4b0b9ed863f9138729c (patch)
tree98d6f0492483bbcc24e337cccf53625556e15f44 /gcc
parent730cf8223861736f94452b3d0047f95c29e3ad19 (diff)
downloadgcc-a8d0467e650910986afba4b0b9ed863f9138729c.zip
gcc-a8d0467e650910986afba4b0b9ed863f9138729c.tar.gz
gcc-a8d0467e650910986afba4b0b9ed863f9138729c.tar.bz2
dbxout.c (dbxout_source_line_counter): New global variable.
* dbxout.c (dbxout_source_line_counter): New global variable. Mark it with GTY(()). (dbxout_source_line): Increment dbxout_source_line_counter and pass it to ASM_OUTPUT_SOURCE_LINE. * sdbout.c (sdbout_source_line_counter): New global variable. Mark it with GTY(()). (unnamed_struct_number): Mark it with GTY(()). (sdbout_source_line): Increment sdbout_source_line_counter and pass it to ASM_OUTPUT_SOURCE_LINE. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Add third parameter (xcoffout_source_line): Pass 0 as third argument to ASM_OUTPUT_SOURCE_LINE. (xcoffout_begin_prologue): Likewise. * config/dbxout.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. Use it instead of 'sym_lineno' but without incrementing it. * config/dbxelf.h (ASM_OUTPUT_SOURCE_LINE): Likewise. * config/lynx.h (ASM_OUTPUT_SOURCE_LINE): Likewise. * config/ptx4.h (ASM_OUTPUT_SOURCE_LINE): Likewise. * config/alpha/alpha.c (alpha_start_function): Pass 0 as third argument to ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. * config/arm/aout.h: Remove useless comment. * config/avr/avr.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. * config/i960/i960.h (ASM_OUTPUT_SOURCE_LINE): Likewise. * config/m32r/m32r.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. Use it instead of 'sym_lineno' but without incrementing it. * config/m68k/hp320.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. * config/mcore/mcore-pe.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. Use it instead of 'sym_lineno' but without incrementing it. * config/mips/mips.c (mips_output_function_prologue): Pass 0 as third argument to ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. * config/mmix/mmix.h (ASM_OUTPUT_SOURCE_LINE): Likewise. * config/pa/som.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. Use it instead of 'sym_lineno' but without incrementing it. * config/rs6000/linux64.h (ASM_OUTPUT_SOURCE_LINE): Likewise. * config/sh/elf.h (ASM_OUTPUT_SOURCE_LINE): Likewise. * config/sparc/aout.h (ASM_OUTPUT_SOURCE_LINE): Likewise. * config/sparc/pbd.h (ASM_OUTPUT_SOURCE_LINE): Likewise. * doc/tm.texi (ASM_OUTPUT_SOURCE_LINE): Document third parameter. From-SVN: r68072
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog43
-rw-r--r--gcc/config/alpha/alpha.c2
-rw-r--r--gcc/config/alpha/alpha.h2
-rw-r--r--gcc/config/arm/aout.h3
-rw-r--r--gcc/config/avr/avr.h3
-rw-r--r--gcc/config/dbxcoff.h8
-rw-r--r--gcc/config/dbxelf.h8
-rw-r--r--gcc/config/i960/i960.h2
-rw-r--r--gcc/config/lynx.h10
-rw-r--r--gcc/config/m32r/m32r.h8
-rw-r--r--gcc/config/m68k/hp320.h2
-rw-r--r--gcc/config/mcore/mcore-pe.h8
-rw-r--r--gcc/config/mips/mips.c2
-rw-r--r--gcc/config/mips/mips.h2
-rw-r--r--gcc/config/mmix/mmix.h2
-rw-r--r--gcc/config/pa/som.h11
-rw-r--r--gcc/config/ptx4.h8
-rw-r--r--gcc/config/rs6000/linux64.h8
-rw-r--r--gcc/config/sh/elf.h8
-rw-r--r--gcc/config/sparc/aout.h8
-rw-r--r--gcc/config/sparc/pbd.h8
-rw-r--r--gcc/dbxout.c7
-rw-r--r--gcc/doc/tm.texi6
-rw-r--r--gcc/sdbout.c17
-rw-r--r--gcc/xcoffout.c6
25 files changed, 114 insertions, 78 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8410d0c..1c81e12 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,46 @@
+2003-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * dbxout.c (dbxout_source_line_counter): New global variable.
+ Mark it with GTY(()).
+ (dbxout_source_line): Increment dbxout_source_line_counter
+ and pass it to ASM_OUTPUT_SOURCE_LINE.
+ * sdbout.c (sdbout_source_line_counter): New global variable.
+ Mark it with GTY(()).
+ (unnamed_struct_number): Mark it with GTY(()).
+ (sdbout_source_line): Increment sdbout_source_line_counter
+ and pass it to ASM_OUTPUT_SOURCE_LINE.
+ * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Add third parameter
+ (xcoffout_source_line): Pass 0 as third argument to
+ ASM_OUTPUT_SOURCE_LINE.
+ (xcoffout_begin_prologue): Likewise.
+ * config/dbxout.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ Use it instead of 'sym_lineno' but without incrementing it.
+ * config/dbxelf.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/lynx.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/ptx4.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/alpha/alpha.c (alpha_start_function): Pass 0 as third
+ argument to ASM_OUTPUT_SOURCE_LINE.
+ * config/alpha/alpha.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/arm/aout.h: Remove useless comment.
+ * config/avr/avr.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/i960/i960.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/m32r/m32r.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ Use it instead of 'sym_lineno' but without incrementing it.
+ * config/m68k/hp320.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/mcore/mcore-pe.h (ASM_OUTPUT_SOURCE_LINE): Add third
+ parameter. Use it instead of 'sym_lineno' but without incrementing it.
+ * config/mips/mips.c (mips_output_function_prologue): Pass 0 as third
+ argument to ASM_OUTPUT_SOURCE_LINE.
+ * config/mips/mips.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/mmix/mmix.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/pa/som.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ Use it instead of 'sym_lineno' but without incrementing it.
+ * config/rs6000/linux64.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/sh/elf.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/sparc/aout.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/sparc/pbd.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * doc/tm.texi (ASM_OUTPUT_SOURCE_LINE): Document third parameter.
+
2003-06-17 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips-protos.h (mips_expand_block_move): Declare.
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 47bd3ca..cb937df 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -7232,7 +7232,7 @@ alpha_start_function (FILE *file, const char *fnname,
#ifdef ASM_OUTPUT_SOURCE_LINE
if (debug_info_level != DINFO_LEVEL_TERSE)
ASM_OUTPUT_SOURCE_LINE (file,
- DECL_SOURCE_LINE (current_function_decl));
+ DECL_SOURCE_LINE (current_function_decl), 0);
#endif
}
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index b8bcba9..7ba7b15 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -1778,7 +1778,7 @@ extern long alpha_auto_offset;
#define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET + alpha_arg_offset)
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
alpha_output_lineno (STREAM, LINE)
#define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
diff --git a/gcc/config/arm/aout.h b/gcc/config/arm/aout.h
index 71fa43b..263c334 100644
--- a/gcc/config/arm/aout.h
+++ b/gcc/config/arm/aout.h
@@ -291,9 +291,6 @@
#define ASM_OUTPUT_ALIGNED_BSS(STREAM, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (STREAM, DECL, NAME, SIZE, ALIGN)
#endif
-
-/* Output a source line for the debugger. */
-/* #define ASM_OUTPUT_SOURCE_LINE(STREAM,LINE) */
/* Output a #ident directive. */
#ifndef ASM_OUTPUT_IDENT
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 3d09c00..4bdad07 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -1718,7 +1718,8 @@ progmem_section () \
time-saving assumptions that are valid for ordinary compiler
output. */
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) fprintf (STREAM,"/* line: %d */\n",LINE)
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
+ fprintf (STREAM,"/* line: %d */\n",LINE)
/* A C statement to output DBX or SDB debugging information before
code for line number LINE of the current source file to the stdio
stream STREAM.
diff --git a/gcc/config/dbxcoff.h b/gcc/config/dbxcoff.h
index 1d54ecf..c7f6757 100644
--- a/gcc/config/dbxcoff.h
+++ b/gcc/config/dbxcoff.h
@@ -55,23 +55,21 @@ Boston, MA 02111-1307, USA. */
current function. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, 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) { \
- static int sym_lineno = 1; \
char buffer[256]; \
- ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", sym_lineno); \
+ 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", sym_lineno); \
- sym_lineno++; \
+ (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
} }
/* When generating stabs debugging, use N_BINCL entries. */
diff --git a/gcc/config/dbxelf.h b/gcc/config/dbxelf.h
index dbc8f34..dc04832 100644
--- a/gcc/config/dbxelf.h
+++ b/gcc/config/dbxelf.h
@@ -57,20 +57,18 @@ Boston, MA 02111-1307, USA. */
current function. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
do \
{ \
- static int sym_lineno = 1; \
char temp[256]; \
- ASM_GENERATE_INTERNAL_LABEL (temp, "LM", sym_lineno); \
+ 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", sym_lineno); \
- sym_lineno += 1; \
+ (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
} \
while (0)
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index 5971977..8af0a70c 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -1206,7 +1206,7 @@ extern struct rtx_def *i960_compare_op0, *i960_compare_op1;
/* This is how to output a note to DBX telling it the line number
to which the following sequence of instructions corresponds. */
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
{ if (write_symbols == SDB_DEBUG) { \
fprintf ((FILE), "\t.ln %d\n", \
(sdb_begin_function_line \
diff --git a/gcc/config/lynx.h b/gcc/config/lynx.h
index 8761f19..267f499 100644
--- a/gcc/config/lynx.h
+++ b/gcc/config/lynx.h
@@ -84,14 +84,12 @@ Boston, MA 02111-1307, USA. */
"\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO)
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
- { static int sym_lineno = 1; \
- fprintf (file, ".stabn 68,0,%d,.LM%d-", \
- line, sym_lineno); \
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
+ { 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", sym_lineno); \
- sym_lineno += 1; }
+ fprintf (file, "\n.LM%d:\n", counter); }
/* Handle #pragma pack and sometimes #pragma weak. */
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index 080e8ce..b490683 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -1545,19 +1545,17 @@ do { \
of a word. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
do \
{ \
- static int sym_lineno = 1; \
fprintf (file, ".stabn 68,0,%d,.LM%d-", \
- line, sym_lineno); \
+ line, counter); \
assemble_name \
(file, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
fprintf (file, (optimize_size || TARGET_M32R) \
? "\n\t.debugsym .LM%d\n" \
: "\n.LM%d:\n", \
- sym_lineno); \
- sym_lineno += 1; \
+ counter); \
} \
while (0)
diff --git a/gcc/config/m68k/hp320.h b/gcc/config/m68k/hp320.h
index a63f364..0830707 100644
--- a/gcc/config/m68k/hp320.h
+++ b/gcc/config/m68k/hp320.h
@@ -276,7 +276,7 @@ do { \
fprintf (FILE, "\tspace %u\n", (int)(SIZE))
#define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME)
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO, COUNTER)
/* Output a float value (represented as a C double) as an immediate operand.
This macro is a 68k-specific macro. */
diff --git a/gcc/config/mcore/mcore-pe.h b/gcc/config/mcore/mcore-pe.h
index 96381c9..2aaa977 100644
--- a/gcc/config/mcore/mcore-pe.h
+++ b/gcc/config/mcore/mcore-pe.h
@@ -116,22 +116,20 @@ drectve_section () \
while (0)
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
{ \
if (write_symbols == DBX_DEBUG) \
{ \
- static int sym_lineno = 1; \
char buffer[256]; \
\
- ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", sym_lineno); \
+ 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", sym_lineno); \
- sym_lineno ++; \
+ (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
} \
}
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index c27bfea..c55d448 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -6884,7 +6884,7 @@ mips_output_function_prologue (file, size)
#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));
+ ASM_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl), 0);
#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 cfb3e72..b00c52a 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3704,7 +3704,7 @@ while (0)
#endif
#ifndef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
mips_output_lineno (STREAM, LINE)
#endif
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 9ff4e97..fbfd91b 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -939,7 +939,7 @@ 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) \
+#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
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index 577a67e..9a8d53d 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -30,18 +30,17 @@ Boston, MA 02111-1307, USA. */
/* 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) \
- { static int sym_lineno = 1; \
- static tree last_function_decl = NULL; \
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
+ { static tree last_function_decl = NULL; \
if (current_function_decl == last_function_decl) \
fprintf (file, "\t.stabn 68,0,%d,L$M%d-%s\nL$M%d:\n", \
- line, sym_lineno, \
+ line, counter, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0) + 1, \
- sym_lineno); \
+ counter); \
else \
fprintf (file, "\t.stabn 68,0,%d,0\n", line); \
last_function_decl = current_function_decl; \
- sym_lineno += 1; }
+ }
/* gdb needs a null N_SO at the end of each file for scattered loading. */
diff --git a/gcc/config/ptx4.h b/gcc/config/ptx4.h
index f3ccb02..2ce8379 100644
--- a/gcc/config/ptx4.h
+++ b/gcc/config/ptx4.h
@@ -184,16 +184,14 @@ Boston, MA 02111-1307, USA.
current function. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
do \
{ \
- static int sym_lineno = 1; \
fprintf (file, ".stabn 68,0,%d,.LM%d-", \
- line, sym_lineno); \
+ line, counter); \
assemble_name (file, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
- fprintf (file, "\n.LM%d:\n", sym_lineno); \
- sym_lineno += 1; \
+ fprintf (file, "\n.LM%d:\n", counter); \
} \
while (0)
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index a5c62e2..5119390 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -443,12 +443,11 @@
/* This is the same as the dbxelf.h version, except that we need to
use the function code label, not the function descriptor. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
do \
{ \
- static int sym_lineno = 1; \
char temp[256]; \
- ASM_GENERATE_INTERNAL_LABEL (temp, "LM", sym_lineno); \
+ ASM_GENERATE_INTERNAL_LABEL (temp, "LM", COUNTER); \
fprintf (FILE, "\t.stabn 68,0,%d,", LINE); \
assemble_name (FILE, temp); \
putc ('-', FILE); \
@@ -457,8 +456,7 @@ do \
assemble_name (FILE, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
putc ('\n', FILE); \
- (*targetm.asm_out.internal_label) (FILE, "LM", sym_lineno); \
- sym_lineno += 1; \
+ (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
} \
while (0)
diff --git a/gcc/config/sh/elf.h b/gcc/config/sh/elf.h
index 0dc2468..f2d6dc0 100644
--- a/gcc/config/sh/elf.h
+++ b/gcc/config/sh/elf.h
@@ -91,16 +91,14 @@ Boston, MA 02111-1307, USA. */
sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
do \
{ \
- static int sym_lineno = 1; \
asm_fprintf ((file), ".stabn 68,0,%d,%LLM%d-", \
- (line), sym_lineno); \
+ (line), (counter)); \
assemble_name ((file), \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
- asm_fprintf ((file), "\n%LLM%d:\n", sym_lineno); \
- sym_lineno += 1; \
+ asm_fprintf ((file), "\n%LLM%d:\n", (counter)); \
} \
while (0)
diff --git a/gcc/config/sparc/aout.h b/gcc/config/sparc/aout.h
index ffc5e4e..1031048 100644
--- a/gcc/config/sparc/aout.h
+++ b/gcc/config/sparc/aout.h
@@ -59,8 +59,6 @@ do { \
This is needed for SunOS 4.0, and should not hurt for 3.2
versions either. */
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
- { static int sym_lineno = 1; \
- fprintf (file, ".stabn 68,0,%d,LM%d\nLM%d:\n", \
- line, sym_lineno, sym_lineno); \
- sym_lineno += 1; }
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
+ fprintf (file, ".stabn 68,0,%d,LM%d\nLM%d:\n", \
+ line, counter, counter)
diff --git a/gcc/config/sparc/pbd.h b/gcc/config/sparc/pbd.h
index 45675b1..e3b591a 100644
--- a/gcc/config/sparc/pbd.h
+++ b/gcc/config/sparc/pbd.h
@@ -140,10 +140,8 @@ Boston, MA 02111-1307, USA. */
/* This is needed for SunOS 4.0, and should not hurt for 3.2
versions either. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
- { static int sym_lineno = 1; \
- fprintf (file, ".stabn 68,0,%d,.LM%d\n.LM%d:\n", \
- line, sym_lineno, sym_lineno); \
- sym_lineno += 1; }
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
+ fprintf (file, ".stabn 68,0,%d,.LM%d\n.LM%d:\n", \
+ line, counter, counter)
#define ASM_INT_OP "\t.long "
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index baf473b..5a00d46 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -193,6 +193,10 @@ static GTY(()) int next_file_number;
static GTY(()) int scope_labelno;
+/* A counter for dbxout_source_line. */
+
+static GTY(()) int dbxout_source_line_counter;
+
/* Nonzero if we have actually used any of the GDB extensions
to the debugging format. The idea is that we use them for the
first time only if there's a strong reason, but once we have done that,
@@ -638,7 +642,8 @@ dbxout_source_line (lineno, filename)
dbxout_source_file (asmfile, filename);
#ifdef ASM_OUTPUT_SOURCE_LINE
- ASM_OUTPUT_SOURCE_LINE (asmfile, lineno);
+ dbxout_source_line_counter += 1;
+ ASM_OUTPUT_SOURCE_LINE (asmfile, lineno, dbxout_source_line_counter);
#else
fprintf (asmfile, "%s%d,0,%d\n", ASM_STABD_OP, N_SLINE, lineno);
#endif
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index b837816..6a686e9 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -6242,10 +6242,12 @@ the assembler source. So you can use it to canonicalize the format
of the filename using this macro.
@findex ASM_OUTPUT_SOURCE_LINE
-@item ASM_OUTPUT_SOURCE_LINE (@var{stream}, @var{line})
+@item ASM_OUTPUT_SOURCE_LINE (@var{stream}, @var{line}, @var{counter})
A C statement to output DBX or SDB debugging information before code
for line number @var{line} of the current source file to the
-stdio stream @var{stream}.
+stdio stream @var{stream}. @var{counter} is the number of time the
+macro was invoked, including the current invocation; it is intended
+to generate unique labels in the assembly output.
This macro need not be defined if the standard form of debugging
information for the debugger in use is appropriate.
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 0af958c..54dcc79 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -51,6 +51,14 @@ AT&T C compiler. From the example below I would conclude the following:
static GTY(()) tree anonymous_types;
+/* Counter for sdbout_source_line. */
+
+static GTY(()) int sdbout_source_line_counter;
+
+/* Counter to generate unique "names" for nameless struct members. */
+
+static GTY(()) int unnamed_struct_number;
+
#ifdef SDB_DEBUGGING_INFO
#include "rtl.h"
@@ -88,9 +96,6 @@ static GTY(()) tree anonymous_types;
int sdb_begin_function_line = -1;
-/* Counter to generate unique "names" for nameless struct members. */
-
-static int unnamed_struct_number = 0;
extern FILE *asm_out_file;
@@ -1527,6 +1532,9 @@ sdbout_end_block (unsigned int line, unsigned int n ATTRIBUTE_UNUSED)
PUT_SDB_BLOCK_END (line - sdb_begin_function_line);
}
+/* Output a line number symbol entry for source file FILENAME and line
+ number LINE. */
+
static void
sdbout_source_line (line, filename)
unsigned int line;
@@ -1536,7 +1544,8 @@ sdbout_source_line (line, filename)
if ((int) line > sdb_begin_function_line)
{
#ifdef ASM_OUTPUT_SOURCE_LINE
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
+ sdbout_source_line_counter += 1;
+ ASM_OUTPUT_SOURCE_LINE (asm_out_file, line, sdbout_source_line_counter);
#else
fprintf (asm_out_file, "\t.ln\t%d\n",
((sdb_begin_function_line > -1)
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index c34096b..faf8717 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -78,7 +78,7 @@ const char *xcoff_lastfile;
((xcoff_inlining) ? (LINENO) : (LINENO) - xcoff_begin_function_line)
/* Output source line numbers via ".line" rather than ".stabd". */
-#define ASM_OUTPUT_SOURCE_LINE(FILE,LINENUM) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE,LINENUM,COUNTER) \
do \
{ \
if (xcoff_begin_function_line >= 0) \
@@ -323,7 +323,7 @@ xcoffout_source_line (line, filename)
xcoffout_source_file (asm_out_file, filename, inline_p);
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
+ ASM_OUTPUT_SOURCE_LINE (asm_out_file, line, 0);
}
/* Output the symbols defined in block number DO_BLOCK.
@@ -461,7 +461,7 @@ xcoffout_begin_prologue (line, file)
xcoffout_block (DECL_INITIAL (current_function_decl), 0,
DECL_ARGUMENTS (current_function_decl));
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
+ ASM_OUTPUT_SOURCE_LINE (asm_out_file, line, 0);
}
/* Called at end of function (before epilogue).