This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix N_BNSYM horkage on alpha


> This patch,
>
> 2004-08-12  Devang patel  <dpatel@apple.com>
>
>         * dbxout.c (dbxout_begin_prologue): New function.
>         (dbx_debug_hooks): Use new begin prologue hook.
>         (dbxout_function_end): Emit N_ENSYM.
>         * stab.def (N_BNSYM, N_ENSYM): Define and document these two new
> stabs.
>
> causes the Alpha stabs-to-mdebug converter to hork.

It's problematic on Solaris too, because the assembler can't grok .stabd 
directives.

> It's certain that we shouldn't be using the new stabs without
> extensions enabled.  It's also certain that if NO_DBX_FUNCTION_END
> is defined, we're working with a stabs subset.

NO_DBX_FUNCTION_END is not defined on Solaris so I'd like to add an ad-hoc 
macro to have a bit more granularity.

OK for mainline?


2004-09-21  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* config.gcc (sparc64-*-solaris2*): Include sparc/sol2-gas.h
	if the GNU assembler is used.
	(sparc-*-solaris2*): Likewise.
	* dbxout.c (NO_DBX_BNSYM_ENSYM): Default to zero.
	(dbxout_function_end): Protect N_ENSYM with it.
	(dbxout_begin_prologue): Protect N_BNSYM with it.
	* doc/tm.texi (NO_DBX_BNSYM_ENSYM): Document it.
	* config/sparc/sol2.h (NO_DBX_BNSYM_ENSYM): Define to 1.
	* config/sparc/sol2-gas.h: New file.


-- 
Eric Botcazou
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.490
diff -u -p -r1.490 config.gcc
--- config.gcc	14 Sep 2004 19:58:49 -0000	1.490
+++ config.gcc	21 Sep 2004 10:21:31 -0000
@@ -1868,7 +1868,7 @@ sparc64-*-solaris2* | sparcv9-*-solaris2
 		tm_file="${tm_file} sparc/sol2-gld.h sparc/sol2-gld-bi.h"
 	fi
 	if test x$gas = xyes; then
-		tm_file="${tm_file} sparc/sol2-gas-bi.h"
+		tm_file="${tm_file} sparc/sol2-gas.h sparc/sol2-gas-bi.h"
 	fi
 	tmake_file="t-sol2 sparc/t-sol2 sparc/t-sol2-64 sparc/t-crtfm"
 	if test x$gnu_ld = xyes; then
@@ -1893,6 +1893,9 @@ sparc-*-solaris2*)
 	if test x$gnu_ld = xyes; then
 		tm_file="${tm_file} sparc/sol2-gld.h"
 	fi
+	if test x$gas = xyes; then
+		tm_file="${tm_file} sparc/sol2-gas.h"
+	fi
 	tmake_file="t-sol2 sparc/t-sol2 sparc/t-crtfm"
 	if test x$gnu_ld = xyes; then
 		tmake_file="$tmake_file t-slibgcc-elf-ver"
Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.201
diff -u -p -r1.201 dbxout.c
--- dbxout.c	17 Sep 2004 21:54:27 -0000	1.201
+++ dbxout.c	21 Sep 2004 10:21:42 -0000
@@ -150,6 +150,10 @@ Software Foundation, 59 Temple Place - S
 #define NO_DBX_FUNCTION_END 0
 #endif
 
+#ifndef NO_DBX_BNSYM_ENSYM
+#define NO_DBX_BNSYM_ENSYM 0
+#endif
+
 enum typestatus {TYPE_UNSEEN, TYPE_XREF, TYPE_DEFINED};
 
 /* Structure recording information about a C data type.
@@ -485,7 +489,7 @@ dbxout_function_end (void)
   fprintf (asmfile, "\n");
 #endif
 
-  if (!flag_debug_only_used_symbols)
+  if (!NO_DBX_BNSYM_ENSYM && !flag_debug_only_used_symbols)
     fprintf (asmfile, "%s%d,0,0\n", ASM_STABD_OP, N_ENSYM);
 }
 #endif /* DBX_DEBUGGING_INFO */
@@ -790,6 +794,7 @@ dbxout_begin_prologue (unsigned int line
 {
   if (use_gnu_debug_info_extensions
       && !NO_DBX_FUNCTION_END
+      && !NO_DBX_BNSYM_ENSYM
       && !flag_debug_only_used_symbols)
     fprintf (asmfile, "%s%d,0,0\n", ASM_STABD_OP, N_BNSYM);
 
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.372
diff -u -p -r1.372 tm.texi
--- doc/tm.texi	17 Sep 2004 08:22:49 -0000	1.372
+++ doc/tm.texi	21 Sep 2004 10:22:30 -0000
@@ -7998,6 +7998,12 @@ On those machines, define this macro to 
 disturbing the rest of the gdb extensions.
 @end defmac
 
+@defmac NO_DBX_BNSYM_ENSYM
+Some assemblers cannot handle the @code{.stabd BNSYM/ENSYM,0,0} gdb dbx
+extension construct.  On those machines, define this macro to turn this
+feature off without disturbing the rest of the gdb extensions.
+@end defmac
+
 @node File Names and DBX
 @subsection File Names in DBX Format
 
Index: config/sparc/sol2.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sol2.h,v
retrieving revision 1.64
diff -u -p -r1.64 sol2.h
--- config/sparc/sol2.h	25 Jul 2004 18:10:04 -0000	1.64
+++ config/sparc/sol2.h	21 Sep 2004 10:22:30 -0000
@@ -108,6 +108,9 @@ Boston, MA 02111-1307, USA.  */
     }								\
   while (0)
 
+/* The Solaris assembler cannot grok .stabd directives.  */
+#undef NO_DBX_BNSYM_ENSYM
+#define NO_DBX_BNSYM_ENSYM 1
 
 
 #undef  ENDFILE_SPEC
--- /dev/null	Mon Sep  6 14:37:52 2004
+++ config/sparc/sol2-gas.h	Tue Sep 21 12:19:32 2004
@@ -0,0 +1,5 @@
+/* Definitions of target machine for GCC, for SPARC running Solaris 2
+   using the GNU assembler.  */
+
+/* Undefine this so that BNSYM/ENSYM pairs are emitted by STABS+.  */
+#undef NO_DBX_BNSYM_ENSYM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]