www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000196

When Created: 12/22/1997 03:28:22
Against DJGPP version: 2.01
By whom: eldredge@ap.net
Abstract: gcc 2.7.2.1 doesn't support stabs debugging
Gcc 2.7.2.1 only supports COFF debugging info, which has many limitations,
in particular when debugging C++ programs, #include'd sources, etc.

Stabs debugging info doesn't have these limitations, and it is already
supported by GDB.

Solution added: 12/22/1997 03:32:10
By whom: eldredge@ap.net
The following patch to GCC sources (contributed by Robert Hoehne) will
enable stabs debugging support in GCC 2.7.2.1.  (Submitted on behalf of
Nate Eldridge by Eli Zaretskii.)
*** config/i386/go32.h~ Fri May 12 13:24:30 1995
--- config/i386/go32.h  Mon Feb  3 20:08:04 1997
***************
*** 1,5 ****
--- 1,13 ----
  /* Configuration for an i386 running MS-DOS with djgpp/go32.  */

+ #define DBX_DEBUGGING_INFO /* support for stabs debugging info */
+ #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG /* leave sdb as default */
+ #define NO_STAB_H /* DJGPP has no stab.h */
+ #if 1 /* enable this, if '-g' should select stabs debugging */ /* I did -NE */
+ #undef PREFERRED_DEBUGGING_TYPE
+ #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+ #endif
+
  /* Don't assume anything about the header files. */
  #define NO_IMPLICIT_EXTERN_C

***************
*** 61,64 ****
--- 69,116 ----
      fprintf (FILE, "\n");                     \
    } while (0)

+ /* Output at beginning of assembler file.  */
+ /* The .file command should always begin the output.  */
+ /* Use the main_input_filename instead of dump_base_name */
+
+ #undef ASM_FILE_START
+ #define ASM_FILE_START(FILE)                                          \
+   do {                                                                \
+       output_file_directive (FILE, main_input_filename);              \
+   } while (0)
+
+ /* 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,                                                      \
+          "	.text
	.stabs \"\",%d,0,0,Letext
Letext:\n", N_SO)
+
+ #undef  ASM_OUTPUT_SOURCE_LINE
+ #define ASM_OUTPUT_SOURCE_LINE(file, line)            \
+   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, "
.LM%d:\n", sym_lineno);         \
+     sym_lineno += 1; } \
+   else { \
+     fprintf (file, "	.ln	%d\n", \
+            ((sdb_begin_function_line > -1) \
+            ? line - sdb_begin_function_line : 1)); }
+
+ #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME)\
+   do {                                                \
+     fprintf (FILE, "	.section %s\n", NAME);  \
+   } while (0)

Fixed in version on 04/12/1999 10:00:40
By whom: eliz@is.elta.co.il



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010