From 2dc172e8882d81ee5e083c53299ce2c6896a8c50 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Fri, 16 Dec 1994 15:30:11 -0800 Subject: [PATCH] (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_FUNCTION_FIRST, DBX_OUTPUT_MAIN_SOURCE_FILE_END): Define. (ASM_OUTPUT_SOURCE_LINE): Modify it to output function relative stabs. From-SVN: r8659 --- gcc/config/sparc/litecoff.h | 50 ++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/gcc/config/sparc/litecoff.h b/gcc/config/sparc/litecoff.h index a471cb3194a..df7f3669153 100644 --- a/gcc/config/sparc/litecoff.h +++ b/gcc/config/sparc/litecoff.h @@ -22,20 +22,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef ASM_OUTPUT_IDENT -/* This is copied from final.c and sparc.h. */ -#undef ASM_OUTPUT_SOURCE_LINE -#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \ -{ 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; \ - fprintf ((FILE), ".stabn 68,0,%d,LM%d\nLM%d:\n", \ - (LINE), sym_lineno, sym_lineno); \ - sym_lineno += 1; \ - } } - #undef SELECT_SECTION #undef SELECT_RTX_SECTION #define BSS_SECTION_ASM_OP ".section\t\".bss\"" @@ -51,6 +37,42 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define DBX_DEBUGGING_INFO #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG +/* These are all necessary because this is how gdb expects gcc to output + stabs in coff. */ + +/* Be function-relative for block and source line stab directives. */ + +#define DBX_BLOCKS_FUNCTION_RELATIVE 1 + +/* but, to make this work, functions must appear prior to line info. */ + +#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. */ + +#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ + fprintf (FILE, \ + "\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO) + +/* This is copied from final.c and sparc.h. */ +#undef ASM_OUTPUT_SOURCE_LINE +#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \ +{ 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; \ + fprintf (FILE, ".stabn 68,0,%d,.LM%d-", \ + LINE, sym_lineno); \ + assemble_name (FILE, \ + XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ + fprintf (FILE, "\n.LM%d:\n", sym_lineno); \ + sym_lineno += 1; \ + } } + /* Support the ctors and dtors sections for g++. */ #undef INIT_SECTION_ASM_OP -- 2.30.2