This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[patch/mips] always enable multi-arch
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [patch/mips] always enable multi-arch
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 08 Jun 2000 16:37:50 +1000
- Organization: Cygnus Solutions
FYI,
In theory, the last one for a while (I'll be spending the next 10 years
fixing yet another obscure MIPS target).
The MIPS is multi-arch, just not _pure_ multi-arch.
Andrew
Thu Jun 8 15:26:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
* config/mips/tm-mips.h (GDB_MULTI_ARCH): Define as 1.
(CALL_DUMMY, TARGET_BYTE_ORDER_SELECTABLE_P,
COERCE_FLOAT_TO_DOUBLE): Delete.
* config/mips/tm-vr5000el.h, config/mips/tm-vr5000.h,
config/mips/tm-vr4xxxel.h, config/mips/tm-vr4xxx.h,
config/mips/tm-vr4100.h, config/mips/tm-tx39l.h
config/mips/tm-tx39.h, config/mips/tm-irix5.h: Delete
GDB_MULTI_ARCH.
* config/mips/tm-mips64.h (TARGET_LONG_BIT, TARGET_LONG_LONG_BIT,
TARGET_PTR_BIT): Delete definitions.
* config/mips/tm-vr5000el.h, config/mips/tm-vr5000.h,
config/mips/tm-tx39l.h, config/mips/tm-vr4100.h,
config/mips/tm-tx39.h: Delete definition of MIPS_EABI.
* mips-tdep.c (mips_gdbarch_init): Use the ISA to determine the
ABI. If all else fails, assume O32.
* TODO, NEWS: Update. Mention MIPS is multi-arch.
Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.9
diff -p -r1.9 NEWS
*** NEWS 2000/05/31 23:27:44 1.9
--- NEWS 2000/06/08 06:32:57
***************
*** 8,14 ****
Alpha FreeBSD alpha*-*-freebsd*
x86 FreeBSD 3.x and 4.x i[3456]86*-freebsd[34]*
! FreeBSD versions before 2.2 are no longer supported.
*** Changes in GDB 5.0:
--- 8,27 ----
Alpha FreeBSD alpha*-*-freebsd*
x86 FreeBSD 3.x and 4.x i[3456]86*-freebsd[34]*
! * New targets
!
! * OBSOLETE configurations
!
! x86 FreeBSD before 2.2 i[3456]86*-freebsd{1,2.[01]}*,
!
! * Deleted configurations
!
! * Other news:
!
! * All MIPS configurations are multi-arched.
!
! Multi-arch support is enabled for all MIPS configurations.
!
*** Changes in GDB 5.0:
Index: TODO
===================================================================
RCS file: /cvs/src/src/gdb/TODO,v
retrieving revision 1.34
diff -p -r1.34 TODO
*** TODO 2000/06/08 04:00:56 1.34
--- TODO 2000/06/08 06:33:02
*************** See also ``Fix implementation of ``targ
*** 330,335 ****
--- 330,339 ----
--
+ IRIX 3.x support is probably broken.
+
+ --
+
New Features and Fixes
======================
*************** Select the initial multi-arch ISA / ABI
*** 968,973 ****
--- 972,983 ----
At present the default is based on what ever is first in the BFD
archures table. It should be determined based on the ``--target=...''
name.
+
+ --
+
+ Make MIPS pure multi-arch.
+
+ It is only at the multi-arch enabled stage.
--
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.13
diff -p -r1.13 mips-tdep.c
*** mips-tdep.c 2000/06/08 04:51:10 1.13
--- mips-tdep.c 2000/06/08 06:33:10
***************
*** 1,5 ****
/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
! Copyright 1988-1999, Free Software Foundation, Inc.
Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
--- 1,8 ----
/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
!
! Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
! 1997, 1998, 1999, 2000, Free Software Foundation, Inc.
!
Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
*************** mips_gdbarch_init (info, arches)
*** 3868,3877 ****
--- 3871,3898 ----
mips_abi = MIPS_ABI_UNKNOWN;
break;
}
+ /* Try the architecture for any hint of the corect ABI */
+ if (mips_abi == MIPS_ABI_UNKNOWN
+ && info.bfd_arch_info != NULL
+ && info.bfd_arch_info->arch == bfd_arch_mips)
+ {
+ switch (info.bfd_arch_info->mach)
+ {
+ case bfd_mach_mips3900:
+ mips_abi = MIPS_ABI_EABI32;
+ break;
+ case bfd_mach_mips4100:
+ case bfd_mach_mips5000:
+ mips_abi = MIPS_ABI_EABI64;
+ break;
+ }
+ }
#ifdef MIPS_DEFAULT_ABI
if (mips_abi == MIPS_ABI_UNKNOWN)
mips_abi = MIPS_DEFAULT_ABI;
#endif
+ if (mips_abi == MIPS_ABI_UNKNOWN)
+ mips_abi = MIPS_ABI_O32;
/* try to find a pre-existing architecture */
for (arches = gdbarch_list_lookup_by_info (arches, &info);
*************** mips_gdbarch_init (info, arches)
*** 4042,4047 ****
--- 4063,4071 ----
case bfd_mach_mips4100:
case bfd_mach_mips4111:
tdep->mips_fpu_type = MIPS_FPU_NONE;
+ break;
+ case bfd_mach_mips4650:
+ tdep->mips_fpu_type = MIPS_FPU_SINGLE;
break;
default:
tdep->mips_fpu_type = MIPS_FPU_DOUBLE;
Index: config/mips/tm-irix5.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-irix5.h,v
retrieving revision 1.4
diff -p -r1.4 tm-irix5.h
*** tm-irix5.h 2000/05/11 03:40:08 1.4
--- tm-irix5.h 2000/06/08 06:33:13
***************
*** 18,34 ****
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
- /* If we're being built for n32, enable multi-arch. */
- /* FIXME: cagney/2000-04-04: Testing the _MIPS_SIM_NABI32 and
- _MIPS_SIM in a tm-*.h file is simply wrong! Those are
- host-dependant macros (provided by /usr/include) and stop any
- chance of the target being cross compiled */
- #if 0 && defined (_MIPS_SIM_NABI32) && _MIPS_SIM == _MIPS_SIM_NABI32
- /* FIXME: Don't enable multi-arch for IRIX/n32. The test
- ``gdb.base/corefile.exp: up in corefile.exp'' fails. */
- #define GDB_MULTI_ARCH 1
- #endif
-
#include "mips/tm-irix3.h"
/* FIXME: cagney/2000-04-04: Testing the _MIPS_SIM_NABI32 and
--- 18,23 ----
Index: config/mips/tm-mips.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-mips.h,v
retrieving revision 1.11
diff -p -r1.11 tm-mips.h
*** tm-mips.h 2000/06/08 04:51:10 1.11
--- tm-mips.h 2000/06/08 06:33:15
***************
*** 24,29 ****
--- 24,31 ----
#ifndef TM_MIPS_H
#define TM_MIPS_H 1
+ #define GDB_MULTI_ARCH 1
+
struct frame_info;
struct symbol;
struct type;
*************** extern void mips_push_dummy_frame (void)
*** 407,416 ****
#define POP_FRAME mips_pop_frame()
extern void mips_pop_frame (void);
- #if !GDB_MULTI_ARCH
- #define CALL_DUMMY { 0 }
- #endif
-
#define CALL_DUMMY_START_OFFSET (0)
#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
--- 409,414 ----
*************** extern struct frame_info *setup_arbitrar
*** 487,508 ****
#define ECOFF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32)
- #if !GDB_MULTI_ARCH
- /* If the current gcc for for this target does not produce correct debugging
- information for float parameters, both prototyped and unprototyped, then
- define this macro. This forces gdb to always assume that floats are
- passed as doubles and then converted in the callee.
-
- For the mips chip, it appears that the debug info marks the parameters as
- floats regardless of whether the function is prototyped, but the actual
- values are passed as doubles for the non-prototyped case and floats for
- the prototyped case. Thus we choose to make the non-prototyped case work
- for C and break the prototyped case, since the non-prototyped case is
- probably much more common. (FIXME). */
-
- #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (current_language -> la_language == language_c)
- #endif
-
/* Select the default mips disassembler */
#define TM_PRINT_INSN_MACH 0
--- 485,490 ----
*************** extern void mips_set_processor_type_comm
*** 579,587 ****
/* MIPS sign extends addresses */
#define POINTER_TO_ADDRESS(TYPE,BUF) (signed_pointer_to_address (TYPE, BUF))
#define ADDRESS_TO_POINTER(TYPE,BUF,ADDR) (address_to_signed_pointer (TYPE, BUF, ADDR))
-
-
- /* MIPS is always bi-endian */
- #if !GDB_MULTI_ARCH
- #define TARGET_BYTE_ORDER_SELECTABLE_P 1
- #endif
--- 561,563 ----
Index: config/mips/tm-mips64.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-mips64.h,v
retrieving revision 1.1.1.2
diff -p -r1.1.1.2 tm-mips64.h
*** tm-mips64.h 1999/07/07 20:15:30 1.1.1.2
--- tm-mips64.h 2000/06/08 06:33:15
***************
*** 35,55 ****
#define OP_LDFPR 065 /* ldc1 */
#define OP_LDGPR 067 /* ld */
- #if defined(MIPS_EABI) && (MIPS_EABI != 0)
- /* Define sizes for 64-bit data types, allow specific targets to override
- these values. Doing so may violate the strict EABI, but it's necessary
- for some MIPS III and MIPS IV machines that want 64bit longs, but 32bit
- pointers. */
- #ifndef TARGET_LONG_BIT
- #define TARGET_LONG_BIT 64
- #endif
- #ifndef TARGET_LONG_LONG_BIT
- #define TARGET_LONG_LONG_BIT 64
- #endif
- #ifndef TARGET_PTR_BIT
- #define TARGET_PTR_BIT 64
- #endif
- #endif /* MIPS_EABI */
-
/* Get the basic MIPS definitions. */
#include "tm-mips.h"
--- 35,39 ----
Index: config/mips/tm-tx39.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-tx39.h,v
retrieving revision 1.3
diff -p -r1.3 tm-tx39.h
*** tm-tx39.h 2000/06/08 04:51:10 1.3
--- tm-tx39.h 2000/06/08 06:33:15
***************
*** 17,25 ****
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
- #define GDB_MULTI_ARCH 1
- #define MIPS_EABI 1
-
#include "mips/tm-bigmips.h"
#undef MIPS_REGISTER_NAMES
--- 17,22 ----
Index: config/mips/tm-tx39l.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-tx39l.h,v
retrieving revision 1.3
diff -p -r1.3 tm-tx39l.h
*** tm-tx39l.h 2000/06/08 04:51:10 1.3
--- tm-tx39l.h 2000/06/08 06:33:15
***************
*** 17,25 ****
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
- #define GDB_MULTI_ARCH 1
- #define MIPS_EABI 1
-
#include "mips/tm-mips.h"
#undef MIPS_REGISTER_NAMES
--- 17,22 ----
Index: config/mips/tm-vr4100.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-vr4100.h,v
retrieving revision 1.4
diff -p -r1.4 tm-vr4100.h
*** tm-vr4100.h 2000/06/08 04:51:10 1.4
--- tm-vr4100.h 2000/06/08 06:33:15
***************
*** 17,23 ****
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
- #define MIPS_EABI 1
- #define TARGET_PTR_BIT 64
-
#include "mips/tm-bigmips64.h"
--- 17,20 ----
Index: config/mips/tm-vr4xxx.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-vr4xxx.h,v
retrieving revision 1.4
diff -p -r1.4 tm-vr4xxx.h
*** tm-vr4xxx.h 2000/06/08 04:51:10 1.4
--- tm-vr4xxx.h 2000/06/08 06:33:15
***************
*** 17,22 ****
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
- #define GDB_MULTI_ARCH 1
-
#include "mips/tm-bigmips64.h"
--- 17,20 ----
Index: config/mips/tm-vr4xxxel.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-vr4xxxel.h,v
retrieving revision 1.4
diff -p -r1.4 tm-vr4xxxel.h
*** tm-vr4xxxel.h 2000/06/08 04:51:10 1.4
--- tm-vr4xxxel.h 2000/06/08 06:33:15
***************
*** 17,22 ****
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
- #define GDB_MULTI_ARCH 1
-
#include "mips/tm-mips64.h"
--- 17,20 ----
Index: config/mips/tm-vr5000.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-vr5000.h,v
retrieving revision 1.3
diff -p -r1.3 tm-vr5000.h
*** tm-vr5000.h 2000/06/06 07:00:45 1.3
--- tm-vr5000.h 2000/06/08 06:33:15
***************
*** 17,23 ****
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
- #define GDB_MULTI_ARCH 1
- #define MIPS_EABI 1
-
#include "mips/tm-bigmips64.h"
--- 17,20 ----
Index: config/mips/tm-vr5000el.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-vr5000el.h,v
retrieving revision 1.3
diff -p -r1.3 tm-vr5000el.h
*** tm-vr5000el.h 2000/06/06 07:00:45 1.3
--- tm-vr5000el.h 2000/06/08 06:33:15
***************
*** 17,23 ****
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
- #define GDB_MULTI_ARCH 1
- #define MIPS_EABI 1
-
#include "mips/tm-mips64.h"
--- 17,20 ----