]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dbxout.c (dbxout_source_line_counter): New global variable.
authorEric Botcazou <ebotcazou@libertysurf.fr>
Tue, 17 Jun 2003 08:06:58 +0000 (10:06 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 17 Jun 2003 08:06:58 +0000 (08:06 +0000)
* 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

25 files changed:
gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/config/alpha/alpha.h
gcc/config/arm/aout.h
gcc/config/avr/avr.h
gcc/config/dbxcoff.h
gcc/config/dbxelf.h
gcc/config/i960/i960.h
gcc/config/lynx.h
gcc/config/m32r/m32r.h
gcc/config/m68k/hp320.h
gcc/config/mcore/mcore-pe.h
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/mmix/mmix.h
gcc/config/pa/som.h
gcc/config/ptx4.h
gcc/config/rs6000/linux64.h
gcc/config/sh/elf.h
gcc/config/sparc/aout.h
gcc/config/sparc/pbd.h
gcc/dbxout.c
gcc/doc/tm.texi
gcc/sdbout.c
gcc/xcoffout.c

index 8410d0ca98ef7e3ec87c763a475fb4de2d456071..1c81e12be4f916f0d0fe9f095605d1345ac0398f 100644 (file)
@@ -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.
index 47bd3ca837d6a59a1eeec227c4997d01b4392f20..cb937df34ceac75ea6f64f324547bd83a2957634 100644 (file)
@@ -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
     }
 
index b8bcba915b653ebbafdf63f078fa0c044563afab..7ba7b15483fdf708d2dca29edd60ed7f98e9dbc0 100644 (file)
@@ -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)                       \
index 71fa43b496424c088873f8bd84de5165c53c979c..263c33432a4a5cd7145335c7c1cf9aefbc0a8d72 100644 (file)
 #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
index 3d09c00b9c0a739a8784d49efbbb58a3c27d924c..4bdad07206163830b82b9b878fa6057ec0575da6 100644 (file)
@@ -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.
index 1d54ecf36047332aee203a5a3df206c92af5d404..c7f675768c6ad134c786ed80c6d93aea6a3a3141 100644 (file)
@@ -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.  */
index dbc8f347eb384baa9cda64705a0634b05139dd25..dc048320e7ce8a63cd8a3b6d14d980ab572e0379 100644 (file)
@@ -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)
 
index 59719776bce36f67731bb14e27185d0f67d3a2ff..8af0a70cd9f08226517e2ef9f8453f3d65a5e917 100644 (file)
@@ -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                           \
index 8761f19281d61491987c4764923638dc55d316b4..267f499e2216796cea43d45b6625b82ca674f61e 100644 (file)
@@ -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.  */
 
index 080e8ceb492b8bea274e0b805aed1d1a10de3738..b4906838bd3c2dbd02768027af779a9d2db5cf40 100644 (file)
@@ -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)
 
index a63f36438314e917fd096aef7f5e187d0bfc3712..0830707334d0e80651719e793ccd93982be47085 100644 (file)
@@ -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.  */
index 96381c97e7bb011454f314e5e0e3dcd233256fdb..2aaa9772f6602aa44090a30666e89e168c16d15f 100644 (file)
@@ -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);         \
       }                                                                          \
   }
 
index c27bfea8788175e628fad5631c75ffee320c5b09..c55d4480338e0494d092435b550d6f5cd9972906 100644 (file)
@@ -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
index cfb3e72fce99f79df250c9791a3e18f108c6c6fd..b00c52ab0c04001ea679296713542e33d69f4a2c 100644 (file)
@@ -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
 
index 9ff4e97e52e11a14e7579c19d1e0d9d0e95e5254..fbfd91bf9440ed1d1185c2c9093e70ee9dad2716 100644 (file)
@@ -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
index 577a67ea31e75c827346eb48e4f4e0dbc0e201b9..9a8d53d3a26f14bb152201716a2e0f725730e24f 100644 (file)
@@ -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.  */
 
index f3ccb02a116e15a3703df47716bdbc3b585f888b..2ce83798b7c7cb982d5efa1e90db8e044c6618cc 100644 (file)
@@ -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)
 
index a5c62e2f9044589a8903288ecead036b3d6506a3..51193905545f75d07eb68349e52a6262a6f1edb5 100644 (file)
 /* 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)
 
index 0dc2468a8603f14350d5e7707ac2efcafc4d3dc4..f2d6dc08ddfc57de2a11a9193e441a7baff3fe39 100644 (file)
@@ -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)
 
index ffc5e4ec12ade8d76aab555925e67097717ca0b3..1031048df696210ec068b72c75a68b6651d031cb 100644 (file)
@@ -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)
index 45675b138b55f476f7bf36d489bdd05d0cf9325e..e3b591a6316bffdcebf8efda334f22078cb6643e 100644 (file)
@@ -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 "
index baf473b9006215e7113129a33e069a9283d8f2a6..5a00d46555693d5e2c6c423fad152cb823aa7d11 100644 (file)
@@ -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
index b83781642cb2c00cd162f7452674ad7ed2b1227b..6a686e93643f34502dd059cdfd3ecef832198689 100644 (file)
@@ -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.
index 0af958c79247895d7f5733bf59f5e82a504f44c3..54dcc799f40f630eec5d22e8c9800e285d57793b 100644 (file)
@@ -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)
index c34096bd382a9ace2c3757cd1288defb06b285ab..faf8717e82b5df469b0294f7b689d5dd6cc633f4 100644 (file)
@@ -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);
 }
 \f
 /* 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).