diff options
| author | fvdl <fvdl@NetBSD.org> | 1999-07-07 22:23:35 +0000 |
|---|---|---|
| committer | fvdl <fvdl@NetBSD.org> | 1999-07-07 22:23:35 +0000 |
| commit | b2e6565c2ccf2d5bf453802a462720cdcd20be8c (patch) | |
| tree | 614f9723da3478d474759cdf631b8d945200d805 /gnu | |
| parent | 7089fc0a1d2c8f427698f32d8d78aff492038bc9 (diff) | |
Do DBX debugging symbols (stabs) the usual ELF way, using relative
offsets to the beginning of the function. Other i386 ELF systems do
this as well, and gdb expects it by default.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/dist/gcc/config/i386/netbsd-elf.h | 78 |
1 files changed, 71 insertions, 7 deletions
diff --git a/gnu/dist/gcc/config/i386/netbsd-elf.h b/gnu/dist/gcc/config/i386/netbsd-elf.h index d497e5983f4..61c234ffe73 100644 --- a/gnu/dist/gcc/config/i386/netbsd-elf.h +++ b/gnu/dist/gcc/config/i386/netbsd-elf.h @@ -39,16 +39,80 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define OBJECT_FORMAT_ELF -/* This is BSD, so it wants DBX format. */ +/* + * DBX stabs definitions. Same as Solaris and other i386 ELF platforms. + */ -#if 0 -#define DBX_DEBUGGING_INFO +#undef DBX_CONTIN_CHAR +#define DBX_CONTIN_CHAR '?' -/* This is the char to use for continuation (in case we need to turn - continuation back on). */ +/* When generating stabs debugging, use N_BINCL entries. */ + +#define DBX_USE_BINCL + +/* Make LBRAC and RBRAC addresses relative to the start of the + function. The native Solaris stabs debugging format works this + way, gdb expects it, and it reduces the number of relocation + entries. */ + +#define DBX_BLOCKS_FUNCTION_RELATIVE 1 + +/* When using stabs, gcc2_compiled must be a stabs entry, not an + ordinary symbol, or gdb won't see it. Furthermore, since gdb reads + the input piecemeal, starting with each N_SO, it's a lot easier if + the gcc2 flag symbol is *after* the N_SO rather than before it. So + we emit an N_OPT stab there. */ + +#define ASM_IDENTIFY_GCC(FILE) \ +do \ + { \ + if (write_symbols != DBX_DEBUG) \ + fputs ("gcc2_compiled.:\n", FILE); \ + } \ +while (0) + +#define ASM_IDENTIFY_GCC_AFTER_SOURCE(FILE) \ +do \ + { \ + if (write_symbols == DBX_DEBUG) \ + fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE); \ + } \ +while (0) + +/* Like block addresses, stabs line numbers are relative to the + current function. */ + +#define ASM_OUTPUT_SOURCE_LINE(file, line) \ +do \ + { \ + 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; \ + } \ +while (0) + +/* In order for relative line numbers to work, we must output the + stabs entry for the function name 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. (XXX do we need this?) */ + +#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ +do \ + { \ + text_section (); \ + fprintf (FILE, \ + "\t.stabs \"\",%d,0,0,.Letext\n.Letext:\n", N_SO); \ + } \ +while (0) -#define DBX_CONTIN_CHAR '?' -#endif #undef ASM_FINAL_SPEC |
