debug/3532: mips stabs are emitted wrongly for current binutils

H . J . Lu hjl@lucon.org
Mon Jul 2 22:02:00 GMT 2001


This is an untested patch. Let me know if it works.


H.J.
---
2001-07-02  H.J. Lu <hjl@gnu.org>

	* gcc/config/mips/linux.h (ASM_OUTPUT_SOURCE_LINE): Defined.

--- gcc/config/mips/linux.h.stabs	Mon Jul  2 21:53:09 2001
+++ gcc/config/mips/linux.h	Mon Jul  2 21:58:00 2001
@@ -182,6 +182,22 @@ Boston, MA 02111-1307, USA.  */
 #undef SET_ASM_OP
 #define SET_ASM_OP "\t.dummy\t"
 
+#undef  ASM_OUTPUT_SOURCE_LINE
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE)				\
+do									\
+  {									\
+    static int sym_lineno = 1;						\
+    fprintf (stream, "%sLM%d:\n\t%s %d,0,%d,%sLM%d",			\
+	     LOCAL_LABEL_PREFIX, sym_lineno, ASM_STABN_OP, N_SLINE,	\
+	     line, LOCAL_LABEL_PREFIX, sym_lineno);			\
+    putc ('-', FILE);							\
+    assemble_name (FILE,						\
+		   XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
+    putc ('\n', FILE);							\
+    sym_lineno++;							\
+  }									\
+while (0)
+
 /* This is how we tell the assembler that two symbols have the
    same value.  */
 #undef ASM_OUTPUT_DEF



More information about the Gcc-bugs mailing list