This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: [patch, rfc] Simplify GDB_MULTI_ARCH selection logic


Hello,

The attached simplfies the logic used to set the multi-arch level. It's reduced to:

+/* Is GDB multi-arch?  If there's a "tm.h" file, it is not.  */
+#ifndef GDB_MULTI_ARCH
+#ifdef GDB_TM_FILE
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
+#else
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PURE
+#endif
+#endif

The #ifndef is so that a "tm.h" file can force the level to GDB_MULTI_ARCH_TM.

I'll look to commit this to mainline in a week.
Andrew

Re-building turned up one querk. Some of the pure multi-arch targets were specifying a long ago deleted tm.h file and that confused the configure. I've also deleted that with the attached,


committed,
Andrew

2003-09-03  Andrew Cagney  <cagney@redhat.com>

	* defs.h: Do not include "arch-utils.h".
	(GDB_MULTI_ARCH): If not defined, set to GDB_MULTI_ARCH_PARTIAL or
	GDB_MULTI_ARCH_PURE.
	* configure.in (GDB_MULTI_ARCH): Do not define.
	* configure, config.in: Regenerate.
	* configure.tgt: Do not set variable "gdb_multi_arch".
	* config/s390/s390x.mt (GDB_MULTI_ARCH): Delete.
	* config/s390/s390.mt (GDB_MULTI_ARCH): Delete.
	* config/i386/x86-64linux.mt (GDB_MULTI_ARCH): Delete.
	* config/v850/v850.mt (TM_FILE): Delete disabled definition.
	* config/m68hc11/m68hc11.mt (TM_FILE): Delete definition.
	* config/vax/tm-vax.h (GDB_MULTI_ARCH): Delete definition.
	* config/sparc/tm-sparc.h (GDB_MULTI_ARCH): Delete definition.
	* config/sparc/tm-sun4sol2.h (GDB_MULTI_ARCH): Delete definition.
	* config/sparc/tm-nbsd.h (GDB_MULTI_ARCH): Delete definition.
	* config/sparc/tm-linux.h (GDB_MULTI_ARCH): Delete definition.
	* config/sparc/tm-sp64.h (GDB_MULTI_ARCH): Delete definition.
	* config/pa/tm-hppa64.h (GDB_MULTI_ARCH): Delete definition.
	* config/ns32k/tm-ns32k.h (GDB_MULTI_ARCH): Delete definition.
	* config/m68k/tm-m68k.h (GDB_MULTI_ARCH): Delete definition.
	* config/i386/tm-i386.h (GDB_MULTI_ARCH): Delete definition.
	* config/h8300/tm-h8300.h (GDB_MULTI_ARCH): Delete definition.
	* config/frv/tm-frv.h (GDB_MULTI_ARCH): Delete definition.
	* config/alpha/tm-alpha.h (GDB_MULTI_ARCH): Delete definition.
	
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.131
diff -u -r1.131 configure.in
--- configure.in	30 Aug 2003 00:06:22 -0000	1.131
+++ configure.in	3 Sep 2003 14:59:43 -0000
@@ -1306,10 +1306,6 @@
 s/TM_FILE[ 	]*=[ 	]*\([^ 	]*\)/\1/p
 ' ${target_makefile_frag}`
 
-GDB_MULTI_ARCH=`sed -n '
-s/GDB_MULTI_ARCH[ 	]*=[ 	]*\([^ 	]*\)[ 	]*/\1/p
-' ${target_makefile_frag}`
-
 if test "${target}" = "${host}"; then
 # We pick this up from the host configuration file (.mh) because we
 # do not have a native configuration Makefile fragment.
@@ -1318,33 +1314,6 @@
 ' ${host_makefile_frag}`
 fi
 changequote([,])
-
-# New targets should just set gdb_multi_arch=yes in configure.tgt.
-# Old targets being converted can either do that or set GDB_MULTI_ARCH
-# in the target specific makefile frag.  Eventually gdb_multi_arch=yes
-# will be the default.
-if test x"${GDB_MULTI_ARCH}" = x ; then
-    case "${gdb_multi_arch}" in
-    yes ) GDB_MULTI_ARCH=GDB_MULTI_ARCH_PURE ;;
-    no ) GDB_MULTI_ARCH=0 ;;
-    0|1|2 ) GDB_MULTI_ARCH=${gdb_multi_arch} ;;
-    esac
-fi
-if test x"${GDB_MULTI_ARCH}" != x ; then
-    AC_DEFINE_UNQUOTED(GDB_MULTI_ARCH, ${GDB_MULTI_ARCH})
-fi
-# Warn the user when they use an old practice
-case "${GDB_MULTI_ARCH}" in
-    "" ) ;;
-    0 | GDB_MULTI_ARCH_PARTIAL | 1 | GDB_MULTI_ARCH_TM | 2 )
-	AC_MSG_WARN("GDB: Target is not pure multi-arch") ;;
-    GDB_MULTI_ARCH_PURE )
-	if test x"${targetfile}" != x ; then
-	    AC_MSG_WARN("GDB: Ignoring TM_FILE in ${target_makefile_frag}")
-	    targetfile=""
-	fi ;;
-    *)  AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");;
-esac
 
 if test x"${gdb_osabi}" != x ; then
     AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
Index: configure.tgt
===================================================================
RCS file: /cvs/src/src/gdb/configure.tgt,v
retrieving revision 1.112
diff -u -r1.112 configure.tgt
--- configure.tgt	25 Aug 2003 22:56:09 -0000	1.112
+++ configure.tgt	3 Sep 2003 14:59:43 -0000
@@ -50,8 +50,7 @@
 arm*-*-linux*)		gdb_target=linux
 			build_gdbserver=yes
 			;;
-arm*-*-netbsd*)		gdb_target=nbsd
-			gdb_multi_arch=yes ;;
+arm*-*-netbsd*)		gdb_target=nbsd ;;
 arm-*-nto*)		gdb_target=nto ;;
 arm*-*-* | thumb*-*-* | strongarm*-*-*)
 			gdb_target=embed
@@ -61,9 +60,7 @@
                         configdirs="$configdirs rdi-share"
                         ;;
 
-avr-*-*)		gdb_target=avr
-			gdb_multi_arch=yes
-			;;
+avr-*-*)		gdb_target=avr ;;
 
 cris*)                  gdb_target=cris ;;
 
@@ -131,7 +128,6 @@
 m68*-*-coff*)		gdb_target=monitor ;;
 m68*-*-elf*)		gdb_target=monitor ;;
 m68*-*-linux*)		gdb_target=linux
-			gdb_multi_arch=1
 			build_gdbserver=yes
 			;;
 m68*-*-lynxos*)		gdb_target=m68klynx ;;
@@ -264,21 +260,6 @@
 
 # OBSOLETE z8k-*-coff*)		gdb_target=z8k ;;
 
-esac
-
-
-# map GDB target onto multi-arch support
-
-case "${gdb_target}" in
-d10v)		gdb_multi_arch=yes ;;
-fbsd64)		gdb_multi_arch=yes ;;
-m32r)		gdb_multi_arch=yes ;;
-m68hc11)	gdb_multi_arch=yes ;;
-mn10300)	gdb_multi_arch=yes ;;
-x86-64linux)    gdb_multi_arch=yes ;;
-v850)           gdb_multi_arch=yes ;;
-xstormy16)      gdb_multi_arch=yes ;;
-mcore)		gdb_multi_arch=yes ;;
 esac
 
 # map target onto default OS ABI
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.128
diff -u -r1.128 defs.h
--- defs.h	20 Aug 2003 17:39:18 -0000	1.128
+++ defs.h	3 Sep 2003 14:59:43 -0000
@@ -1086,14 +1086,17 @@
 #endif /* Not GNU C */
 #endif /* alloca not defined */
 
+/* Is GDB multi-arch?  If there's a "tm.h" file, it is not.  */
+#ifndef GDB_MULTI_ARCH
+#ifdef GDB_TM_FILE
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
+#else
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PURE
+#endif
+#endif
+
 /* Dynamic target-system-dependent parameters for GDB. */
 #include "gdbarch.h"
-#if (GDB_MULTI_ARCH == 0)
-/* Multi-arch targets _should_ be including "arch-utils.h" directly
-   into their *-tdep.c file.  This is a prop to help old non-
-   multi-arch targets to continue to compile. */
-#include "arch-utils.h"
-#endif
 
 /* Maximum size of a register.  Something small, but large enough for
    all known ISAs.  If it turns out to be too small, make it bigger.  */
Index: config/alpha/tm-alpha.h
===================================================================
RCS file: /cvs/src/src/gdb/config/alpha/tm-alpha.h,v
retrieving revision 1.27
diff -u -r1.27 tm-alpha.h
--- config/alpha/tm-alpha.h	29 May 2003 23:02:53 -0000	1.27
+++ config/alpha/tm-alpha.h	3 Sep 2003 14:59:43 -0000
@@ -24,8 +24,6 @@
 #ifndef TM_ALPHA_H
 #define TM_ALPHA_H
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 #include "bfd.h"
 #include "coff/sym.h"		/* Needed for PDR below.  */
 #include "coff/symconst.h"
Index: config/frv/tm-frv.h
===================================================================
RCS file: /cvs/src/src/gdb/config/frv/tm-frv.h,v
retrieving revision 1.2
diff -u -r1.2 tm-frv.h
--- config/frv/tm-frv.h	20 Aug 2003 20:22:41 -0000	1.2
+++ config/frv/tm-frv.h	3 Sep 2003 14:59:43 -0000
@@ -20,9 +20,6 @@
 
 /* This target uses an architecture vector for most architecture methods.  */
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
-
 #define TARGET_HW_BREAK_LIMIT 4
 #define TARGET_HW_WATCH_LIMIT 4
 
Index: config/h8300/tm-h8300.h
===================================================================
RCS file: /cvs/src/src/gdb/config/h8300/tm-h8300.h,v
retrieving revision 1.17
diff -u -r1.17 tm-h8300.h
--- config/h8300/tm-h8300.h	8 Jun 2003 22:51:49 -0000	1.17
+++ config/h8300/tm-h8300.h	3 Sep 2003 14:59:43 -0000
@@ -20,8 +20,6 @@
    Boston, MA 02111-1307, USA.  */
 /* Contributed by Steve Chamberlain sac@cygnus.com */
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 /* NOTE: ezannoni 2000-07-18: these variables are part of sim, defined
    in sim/h8300/compile.c.  They really should not be used this
    way. Because of this we cannot get rid of the macro
Index: config/i386/tm-i386.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-i386.h,v
retrieving revision 1.46
diff -u -r1.46 tm-i386.h
--- config/i386/tm-i386.h	15 Jun 2003 00:27:54 -0000	1.46
+++ config/i386/tm-i386.h	3 Sep 2003 14:59:43 -0000
@@ -22,6 +22,4 @@
 #ifndef TM_I386_H
 #define TM_I386_H 1
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 #endif /* ifndef TM_I386_H */
Index: config/i386/x86-64linux.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/x86-64linux.mt,v
retrieving revision 1.8
diff -u -r1.8 x86-64linux.mt
--- config/i386/x86-64linux.mt	15 Jul 2003 11:33:59 -0000	1.8
+++ config/i386/x86-64linux.mt	3 Sep 2003 14:59:43 -0000
@@ -3,6 +3,4 @@
 	i386-tdep.o i387-tdep.o i386-linux-tdep.o \
 	solib.o solib-svr4.o solib-legacy.o corelow.o
 
-GDB_MULTI_ARCH=GDB_MULTI_ARCH_TM
-
 TM_FILE=tm-x86-64linux.h
Index: config/m68hc11/m68hc11.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/m68hc11/m68hc11.mt,v
retrieving revision 1.1
diff -u -r1.1 m68hc11.mt
--- config/m68hc11/m68hc11.mt	27 Jul 2000 07:18:32 -0000	1.1
+++ config/m68hc11/m68hc11.mt	3 Sep 2003 14:59:43 -0000
@@ -1,6 +1,5 @@
 # Target: Motorola 68HC11 processor
 TDEPFILES= m68hc11-tdep.o
-TM_FILE= tm-m68hc11.h
 SIM_OBS= remote-sim.o
 SIM= ../sim/m68hc11/libsim.a -lm
 
Index: config/m68k/tm-m68k.h
===================================================================
RCS file: /cvs/src/src/gdb/config/m68k/tm-m68k.h,v
retrieving revision 1.22
diff -u -r1.22 tm-m68k.h
--- config/m68k/tm-m68k.h	25 May 2003 18:50:55 -0000	1.22
+++ config/m68k/tm-m68k.h	3 Sep 2003 14:59:43 -0000
@@ -19,6 +19,4 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 extern int m68k_get_longjmp_target (CORE_ADDR *);
Index: config/ns32k/tm-ns32k.h
===================================================================
RCS file: /cvs/src/src/gdb/config/ns32k/tm-ns32k.h,v
retrieving revision 1.1
diff -u -r1.1 tm-ns32k.h
--- config/ns32k/tm-ns32k.h	27 May 2002 01:05:16 -0000	1.1
+++ config/ns32k/tm-ns32k.h	3 Sep 2003 14:59:43 -0000
@@ -22,8 +22,6 @@
 #ifndef TM_NS32K_H
 #define TM_NS32K_H
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 /* Need to get function ends by adding this to epilogue address from .bf
    record, not using x_fsize field.  */
 #define FUNCTION_EPILOGUE_SIZE 4
Index: config/pa/tm-hppa64.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppa64.h,v
retrieving revision 1.28
diff -u -r1.28 tm-hppa64.h
--- config/pa/tm-hppa64.h	15 Aug 2003 23:02:05 -0000	1.28
+++ config/pa/tm-hppa64.h	3 Sep 2003 14:59:43 -0000
@@ -35,7 +35,6 @@
    causing GDB to lose line number information.  Since prior to this
    switch and a other recent tweaks, 64 bit PA hadn't been building
    for some months, this is probably the lesser of several evils.  */
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
 
 #include "pa/tm-hppah.h"
 
Index: config/s390/s390.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/s390/s390.mt,v
retrieving revision 1.4
diff -u -r1.4 s390.mt
--- config/s390/s390.mt	4 May 2002 15:52:42 -0000	1.4
+++ config/s390/s390.mt	3 Sep 2003 14:59:43 -0000
@@ -3,4 +3,3 @@
 TDEPFILES=s390-tdep.o solib.o
 # Post 5.0 tdep-files
 TDEPFILES+=solib-svr4.o solib-legacy.o
-GDB_MULTI_ARCH=GDB_MULTI_ARCH_PARTIAL
Index: config/s390/s390x.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/s390/s390x.mt,v
retrieving revision 1.4
diff -u -r1.4 s390x.mt
--- config/s390/s390x.mt	4 May 2002 15:52:42 -0000	1.4
+++ config/s390/s390x.mt	3 Sep 2003 14:59:43 -0000
@@ -3,7 +3,6 @@
 TDEPFILES=s390-tdep.o solib.o
 # Post 5.0 tdep-files
 TDEPFILES+=solib-svr4.o solib-legacy.o
-GDB_MULTI_ARCH=GDB_MULTI_ARCH_PARTIAL
 
 # needed for gdbserver.
 MT_CFLAGS= -DCONFIG_ARCH_S390X
Index: config/sparc/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-linux.h,v
retrieving revision 1.5
diff -u -r1.5 tm-linux.h
--- config/sparc/tm-linux.h	5 Jun 2002 19:18:29 -0000	1.5
+++ config/sparc/tm-linux.h	3 Sep 2003 14:59:43 -0000
@@ -23,8 +23,6 @@
 #ifndef TM_SPARCLINUX_H
 #define TM_SPARCLINUX_H
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 #include "sparc/tm-sparc.h"
 
 #define SIGCONTEXT_PC_OFFSET 12
Index: config/sparc/tm-nbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-nbsd.h,v
retrieving revision 1.3
diff -u -r1.3 tm-nbsd.h
--- config/sparc/tm-nbsd.h	31 May 2002 00:59:15 -0000	1.3
+++ config/sparc/tm-nbsd.h	3 Sep 2003 14:59:43 -0000
@@ -21,8 +21,6 @@
 #ifndef TM_NBSD_H
 #define TM_NBSD_H
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 #include "sparc/tm-sparc.h"
 #include "solib.h"
 
Index: config/sparc/tm-sp64.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sp64.h,v
retrieving revision 1.24
diff -u -r1.24 tm-sp64.h
--- config/sparc/tm-sp64.h	22 Aug 2003 00:35:32 -0000	1.24
+++ config/sparc/tm-sp64.h	3 Sep 2003 14:59:43 -0000
@@ -25,8 +25,6 @@
 
 struct type;
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 #ifndef GDB_TARGET_IS_SPARC64
 #define GDB_TARGET_IS_SPARC64 1
 #endif
Index: config/sparc/tm-sparc.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sparc.h,v
retrieving revision 1.58
diff -u -r1.58 tm-sparc.h
--- config/sparc/tm-sparc.h	22 Aug 2003 00:35:32 -0000	1.58
+++ config/sparc/tm-sparc.h	3 Sep 2003 14:59:44 -0000
@@ -22,8 +22,6 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 #include "regcache.h"
 
 struct type;
Index: config/sparc/tm-sun4sol2.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sun4sol2.h,v
retrieving revision 1.10
diff -u -r1.10 tm-sun4sol2.h
--- config/sparc/tm-sun4sol2.h	5 Jun 2002 19:18:29 -0000	1.10
+++ config/sparc/tm-sun4sol2.h	3 Sep 2003 14:59:44 -0000
@@ -19,8 +19,6 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 #include "sparc/tm-sparc.h"
 #include "config/tm-sysv4.h"
 
Index: config/v850/v850.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/v850/v850.mt,v
retrieving revision 1.2
diff -u -r1.2 v850.mt
--- config/v850/v850.mt	16 May 2002 12:11:38 -0000	1.2
+++ config/v850/v850.mt	3 Sep 2003 14:59:44 -0000
@@ -1,5 +1,4 @@
 # Target: NEC V850 processor
 TDEPFILES= v850-tdep.o
-# TM_FILE= tm-v850.h
 SIM_OBS = remote-sim.o
 SIM = ../sim/v850/libsim.a
Index: config/vax/tm-vax.h
===================================================================
RCS file: /cvs/src/src/gdb/config/vax/tm-vax.h,v
retrieving revision 1.17
diff -u -r1.17 tm-vax.h
--- config/vax/tm-vax.h	9 Jun 2003 02:10:35 -0000	1.17
+++ config/vax/tm-vax.h	3 Sep 2003 14:59:44 -0000
@@ -22,6 +22,4 @@
 #ifndef TM_VAX_H
 #define TM_VAX_H
 
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
 #endif /* TM_VAX_H */

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