This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Use gstab.h and gsyms.h unconditionally
- To: gcc-patches at gcc dot gnu dot org
- Subject: Use gstab.h and gsyms.h unconditionally
- From: "Zack Weinberg" <zackw at stanford dot edu>
- Date: Wed, 18 Apr 2001 18:09:47 -0700
In view of the trouble caused by vendor stab.h not existing or not
containing all the definitions we need, this patch causes us to use
our own header unconditionally. I did the same for our syms.h (used
by SDB debug format). A lot of ifdefs go away, including some of the
last remaining uses of #ifdef USG.
I've not bootstrapped this. I built a native i686-linux compiler,
stage1 only, and a cross-compiler to rs6000-ibm-aix, and looked at
their debug output; in both cases it seems to be sane.
The patch is against mainline. Dunno if it belongs on the branch.
zw
* dbxout.c, mips-tfile.c, config/mips/mips.c, xcoffout.c:
Always include gstab.h, not system stab.h. Don't provide
default definitions of N_CATCH or N_OPT. Always use the
gstab.h variant of STAB_CODE_TYPE.
* final.c: Don't include stab.h/gstab.h at all, or provide
defaults for N_SLINE and N_SOL.
* xcoffout.c: Can assume N_MAIN, N_DSLINE, N_BSLINE, N_BINCL,
N_EINCL, N_EXCL, N_M2C, N_SCOPE, N_CATCH, and N_OPT are
available.
* sdbout.c: Always include gsyms.h instead of system syms.h.
* configure.in: No need to check for stab.h.
* configure, config.in: Regenerate.
* Makefile.in (final.o): Don't depend on gstab.h.
===================================================================
Index: dbxout.c
--- dbxout.c 2001/04/18 06:15:38 1.79
+++ dbxout.c 2001/04/19 01:01:00
@@ -145,9 +145,6 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
-/* Typical USG systems don't have stab.h, and they also have
- no use for DBX-format debugging info. */
-
#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
static int flag_minimal_debug = MINIMAL_DEBUG;
@@ -170,31 +167,9 @@ static int source_label_number = 1;
#define FORCE_TEXT
#endif
-/* If there is a system stab.h, use it. Otherwise, use our own. */
-/* ??? This is supposed to describe the target's stab format, so using
- the host HAVE_STAB_H appears to be wrong. For now, we use our own file
- when cross compiling. */
-#if defined (USG) || !defined (HAVE_STAB_H) || defined (CROSS_COMPILE)
-#include "gstab.h" /* If doing DBX on sysV, use our own stab.h. */
-#else
-#include <stab.h>
+#include "gstab.h"
-/* This is a GNU extension we need to reference in this file. */
-#ifndef N_CATCH
-#define N_CATCH 0x54
-#endif
-
-/* This is a Solaris extension we need to reference in this file. */
-#ifndef N_OPT
-#define N_OPT 0x3c
-#endif
-#endif
-
-#ifdef __GNU_STAB__
#define STAB_CODE_TYPE enum __stab_debug_code
-#else
-#define STAB_CODE_TYPE int
-#endif
/* 1 if PARM is passed to this function in memory. */
===================================================================
Index: final.c
--- final.c 2001/04/03 15:05:21 1.169
+++ final.c 2001/04/19 01:01:00
@@ -66,15 +66,8 @@ Boston, MA 02111-1307, USA. */
#include "intl.h"
#include "basic-block.h"
-/* Get N_SLINE and N_SOL from stab.h if we can expect the file to exist. */
#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
#include "dbxout.h"
-#if defined (USG) || !defined (HAVE_STAB_H)
-#include "gstab.h" /* If doing DBX on sysV, use our own stab.h. */
-#else
-#include <stab.h>
-#endif
-
#endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
#ifdef XCOFF_DEBUGGING_INFO
@@ -91,16 +84,6 @@ Boston, MA 02111-1307, USA. */
#ifdef SDB_DEBUGGING_INFO
#include "sdbout.h"
-#endif
-
-/* .stabd code for line number. */
-#ifndef N_SLINE
-#define N_SLINE 0x44
-#endif
-
-/* .stabs code for included file name. */
-#ifndef N_SOL
-#define N_SOL 0x84
#endif
/* If we aren't using cc0, CC_STATUS_INIT shouldn't exist. So define a
===================================================================
Index: mips-tfile.c
--- mips-tfile.c 2001/03/12 02:37:56 1.36
+++ mips-tfile.c 2001/04/19 01:01:01
@@ -670,17 +670,9 @@ main ()
#include "mips/a.out.h"
#endif /* CROSS_COMPILE */
-#if defined (USG) || !defined (HAVE_STAB_H)
-#include "gstab.h" /* If doing DBX on sysV, use our own stab.h. */
-#else
-#include <stab.h> /* On BSD, use the system's stab.h. */
-#endif /* not USG */
+#include "gstab.h"
-#ifdef __GNU_STAB__
#define STAB_CODE_TYPE enum __stab_debug_code
-#else
-#define STAB_CODE_TYPE int
-#endif
#ifndef MALLOC_CHECK
#ifdef __SABER__
===================================================================
Index: sdbout.c
--- sdbout.c 2001/04/03 15:05:29 1.42
+++ sdbout.c 2001/04/19 01:01:01
@@ -56,22 +56,7 @@ AT&T C compiler. From the example below
#include "toplev.h"
#include "ggc.h"
#include "tm_p.h"
-
-/* Mips systems use the SDB functions to dump out symbols, but do not
- supply usable syms.h include files. Which syms.h file to use is a
- target parameter so don't use the native one if we're cross compiling. */
-
-#if defined(USG) && !defined(MIPS) && !defined (hpux) && !defined(_WIN32) && !defined(__linux__) && !defined(__INTERIX) && !defined(CROSS_COMPILE)
-#include <syms.h>
-/* Use T_INT if we don't have T_VOID. */
-#ifndef T_VOID
-#define T_VOID T_INT
-#endif
-#else
#include "gsyms.h"
-#endif
-
-/* #include <storclass.h> used to be this instead of syms.h. */
/* 1 if PARM is passed to this function in memory. */
===================================================================
Index: xcoffout.c
--- xcoffout.c 2001/04/18 06:15:38 1.22
+++ xcoffout.c 2001/04/19 01:01:01
@@ -36,16 +36,10 @@ Boston, MA 02111-1307, USA. */
#ifdef XCOFF_DEBUGGING_INFO
/* This defines the C_* storage classes. */
-#include <dbxstclass.h>
-
+#include "dbxstclass.h"
#include "xcoffout.h"
#include "dbxout.h"
-
-#if defined (USG) || !defined (HAVE_STAB_H)
#include "gstab.h"
-#else
-#include <stab.h>
-#endif
/* Line number of beginning of current function, minus one.
Negative means not in a function or not using xcoff. */
@@ -196,10 +190,8 @@ stab_to_sclass (stab)
case N_LCSYM:
return C_STSYM;
-#ifdef N_MAIN
case N_MAIN:
UNKNOWN_STAB ("N_MAIN");
-#endif
case N_RSYM:
return C_RSYM;
@@ -228,30 +220,20 @@ stab_to_sclass (stab)
case N_SLINE:
UNKNOWN_STAB ("N_SLINE");
-#ifdef N_DSLINE
case N_DSLINE:
UNKNOWN_STAB ("N_DSLINE");
-#endif
-#ifdef N_BSLINE
case N_BSLINE:
UNKNOWN_STAB ("N_BSLINE");
-#endif
-#ifdef N_BINCL
case N_BINCL:
UNKNOWN_STAB ("N_BINCL");
-#endif
-#ifdef N_EINCL
case N_EINCL:
UNKNOWN_STAB ("N_EINCL");
-#endif
-#ifdef N_EXCL
case N_EXCL:
UNKNOWN_STAB ("N_EXCL");
-#endif
case N_LBRAC:
UNKNOWN_STAB ("N_LBRAC");
@@ -272,25 +254,17 @@ stab_to_sclass (stab)
case N_PC:
UNKNOWN_STAB ("N_PC");
-#ifdef N_M2C
case N_M2C:
UNKNOWN_STAB ("N_M2C");
-#endif
-#ifdef N_SCOPE
case N_SCOPE:
UNKNOWN_STAB ("N_SCOPE");
-#endif
-#ifdef N_CATCH
case N_CATCH:
UNKNOWN_STAB ("N_CATCH");
-#endif
-#ifdef N_OPT
case N_OPT:
UNKNOWN_STAB ("N_OPT");
-#endif
default:
UNKNOWN_STAB ("?");
===================================================================
Index: config/mips/mips.c
--- config/mips/mips.c 2001/04/03 15:06:00 1.114
+++ config/mips/mips.c 2001/04/19 01:01:02
@@ -50,11 +50,7 @@ Boston, MA 02111-1307, USA. */
#include "tm_p.h"
#include "ggc.h"
-#if defined(USG) || !defined(HAVE_STAB_H)
-#include "gstab.h" /* If doing DBX on sysV, use our own stab.h. */
-#else
-#include <stab.h> /* On BSD, use the system's stab.h. */
-#endif /* not USG */
+#include "gstab.h"
#ifdef __GNU_STAB__
#define STAB_CODE_TYPE enum __stab_debug_code
===================================================================
Index: configure.in
--- configure.in 2001/04/12 15:36:24 1.515
+++ configure.in 2001/04/19 01:01:00
@@ -453,7 +453,7 @@ AC_HEADER_TIME
gcc_AC_HEADER_STRING
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \
- fcntl.h unistd.h stab.h sys/file.h sys/time.h \
+ fcntl.h unistd.h sys/file.h sys/time.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h \
direct.h malloc.h langinfo.h iconv.h stdbool.h)
===================================================================
Index: Makefile.in
--- Makefile.in 2001/04/13 21:10:14 1.648
+++ Makefile.in 2001/04/19 01:08:35
@@ -1550,7 +1550,7 @@ sched-vis.o : sched-vis.c $(CONFIG_H) $(
hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H)
final.o : final.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h intl.h \
$(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \
- real.h output.h hard-reg-set.h gstab.h except.h \
+ real.h output.h hard-reg-set.h except.h \
xcoffout.h toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h \
dbxout.h $(BASIC_BLOCK_H) $(TM_P_H)
recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) function.h $(BASIC_BLOCK_H) \