Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/gnu/dist/gcc/config/i386 Do DBX debugging symbols (stabs) th...
details: https://anonhg.NetBSD.org/src/rev/70c496376a13
branches: trunk
changeset: 474468:70c496376a13
user: fvdl <fvdl%NetBSD.org@localhost>
date: Wed Jul 07 22:23:35 1999 +0000
description:
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:
gnu/dist/gcc/config/i386/netbsd-elf.h | 78 +++++++++++++++++++++++++++++++---
1 files changed, 71 insertions(+), 7 deletions(-)
diffs (91 lines):
diff -r e6576c10d648 -r 70c496376a13 gnu/dist/gcc/config/i386/netbsd-elf.h
--- a/gnu/dist/gcc/config/i386/netbsd-elf.h Wed Jul 07 22:00:31 1999 +0000
+++ b/gnu/dist/gcc/config/i386/netbsd-elf.h Wed Jul 07 22:23:35 1999 +0000
@@ -39,16 +39,80 @@
#define OBJECT_FORMAT_ELF
-/* This is BSD, so it wants DBX format. */
+/*
+ * DBX stabs definitions. Same as Solaris and other i386 ELF platforms.
+ */
+
+#undef DBX_CONTIN_CHAR
+#define DBX_CONTIN_CHAR '?'
+
+/* 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. */
-#if 0
-#define DBX_DEBUGGING_INFO
+#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)
-/* This is the char to use for continuation (in case we need to turn
- continuation back on). */
+#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 DBX_CONTIN_CHAR '?'
-#endif
+#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)
+
#undef ASM_FINAL_SPEC
Home |
Main Index |
Thread Index |
Old Index