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

Obsolete mips*-*-mach3*.
	* NEWS: Mention that mips*-*-mach3* is obsolete.
	* m3-nat.c: Obsolete file.
	* config/nm-m3.h: Obsolete file.
	* config/mips/tm-mipsm3.h: Obsolete file.
	* config/mips/mipsm3.mt: Obsolete file.
	* config/mips/mipsm3.mh: Obsolete file.
	* config/mips/xm-mipsm3.h: Obsolete file.
	* mipsm3-nat.c: Obsolete file.
	* configure.host: Obsolete mips-dec-mach3*.
	* configure.tgt: Obsolete mips*-*-mach3*.
This commit is contained in:
Andrew Cagney 2003-04-09 16:10:06 +00:00
parent f190828974
commit 78c4394505
11 changed files with 5201 additions and 5186 deletions

@ -1,3 +1,17 @@
2003-04-09 Andrew Cagney <cagney@redhat.com>
Obsolete mips*-*-mach3*.
* NEWS: Mention that mips*-*-mach3* is obsolete.
* m3-nat.c: Obsolete file.
* config/nm-m3.h: Obsolete file.
* config/mips/tm-mipsm3.h: Obsolete file.
* config/mips/mipsm3.mt: Obsolete file.
* config/mips/mipsm3.mh: Obsolete file.
* config/mips/xm-mipsm3.h: Obsolete file.
* mipsm3-nat.c: Obsolete file.
* configure.host: Obsolete mips-dec-mach3*.
* configure.tgt: Obsolete mips*-*-mach3*.
2003-04-09 Andrew Cagney <cagney@redhat.com> 2003-04-09 Andrew Cagney <cagney@redhat.com>
* doublest.h: Update copyright. * doublest.h: Update copyright.

@ -44,6 +44,7 @@ H8/500 simulator h8500-hitachi-hms or h8500hms
HP/PA running BSD hppa*-*-bsd* HP/PA running BSD hppa*-*-bsd*
HP/PA running OSF/1 hppa*-*-osf* HP/PA running OSF/1 hppa*-*-osf*
HP/PA Pro target hppa*-*-pro* HP/PA Pro target hppa*-*-pro*
PMAX (MIPS) running Mach 3.0 mips*-*-mach3*
* REMOVED configurations and files * REMOVED configurations and files

@ -1,6 +1,6 @@
# Host: Little endian MIPS machine such as pmax # OBSOLETE # Host: Little endian MIPS machine such as pmax
# running Mach 3.0 operating system # OBSOLETE # running Mach 3.0 operating system
# OBSOLETE
NATDEPFILES= mipsm3-nat.o m3-nat.o core-aout.o # OBSOLETE NATDEPFILES= mipsm3-nat.o m3-nat.o core-aout.o
XM_FILE= xm-mipsm3.h # OBSOLETE XM_FILE= xm-mipsm3.h
NAT_FILE= ../nm-m3.h # OBSOLETE NAT_FILE= ../nm-m3.h

@ -1,4 +1,4 @@
# Target: Little-endian MIPS machine such as pmax # OBSOLETE # Target: Little-endian MIPS machine such as pmax
# running Mach 3.0 operating system # OBSOLETE # running Mach 3.0 operating system
TDEPFILES= mips-tdep.o # OBSOLETE TDEPFILES= mips-tdep.o
TM_FILE= tm-mipsm3.h # OBSOLETE TM_FILE= tm-mipsm3.h

@ -1,67 +1,67 @@
/* Definitions to make GDB run on a mips box under Mach 3.0 // OBSOLETE /* Definitions to make GDB run on a mips box under Mach 3.0
Copyright 1992, 1993, 1998 Free Software Foundation, Inc. // OBSOLETE Copyright 1992, 1993, 1998 Free Software Foundation, Inc.
// OBSOLETE
This file is part of GDB. // OBSOLETE This file is part of GDB.
// OBSOLETE
This program is free software; you can redistribute it and/or modify // OBSOLETE This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by // OBSOLETE it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or // OBSOLETE the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. // OBSOLETE (at your option) any later version.
// OBSOLETE
This program is distributed in the hope that it will be useful, // OBSOLETE This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of // OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. // OBSOLETE GNU General Public License for more details.
// OBSOLETE
You should have received a copy of the GNU General Public License // OBSOLETE You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software // OBSOLETE along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, // OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ // OBSOLETE Boston, MA 02111-1307, USA. */
// OBSOLETE
/* Mach specific definitions for little endian mips (e.g. pmax) // OBSOLETE /* Mach specific definitions for little endian mips (e.g. pmax)
* running Mach 3.0 // OBSOLETE * running Mach 3.0
* // OBSOLETE *
* Author: Jukka Virtanen <jtv@hut.fi> // OBSOLETE * Author: Jukka Virtanen <jtv@hut.fi>
*/ // OBSOLETE */
// OBSOLETE
/* Include common definitions for Mach3 systems */ // OBSOLETE /* Include common definitions for Mach3 systems */
#include "config/nm-m3.h" // OBSOLETE #include "config/nm-m3.h"
// OBSOLETE
/* Define offsets to access CPROC stack when it does not have // OBSOLETE /* Define offsets to access CPROC stack when it does not have
* a kernel thread. // OBSOLETE * a kernel thread.
*/ // OBSOLETE */
// OBSOLETE
/* From mk/user/threads/mips/csw.s */ // OBSOLETE /* From mk/user/threads/mips/csw.s */
#define SAVED_FP (12*4) // OBSOLETE #define SAVED_FP (12*4)
#define SAVED_PC (13*4) // OBSOLETE #define SAVED_PC (13*4)
#define SAVED_BYTES (14*4) // OBSOLETE #define SAVED_BYTES (14*4)
// OBSOLETE
/* Using these, define our offsets to items strored in // OBSOLETE /* Using these, define our offsets to items strored in
* cproc_switch in csw.s // OBSOLETE * cproc_switch in csw.s
*/ // OBSOLETE */
#define MACHINE_CPROC_SP_OFFSET SAVED_BYTES // OBSOLETE #define MACHINE_CPROC_SP_OFFSET SAVED_BYTES
#define MACHINE_CPROC_PC_OFFSET SAVED_PC // OBSOLETE #define MACHINE_CPROC_PC_OFFSET SAVED_PC
#define MACHINE_CPROC_FP_OFFSET SAVED_FP // OBSOLETE #define MACHINE_CPROC_FP_OFFSET SAVED_FP
// OBSOLETE
/* Thread flavors used in setting the Trace state. // OBSOLETE /* Thread flavors used in setting the Trace state.
// OBSOLETE
* In <mach/machine/thread_status.h> // OBSOLETE * In <mach/machine/thread_status.h>
*/ // OBSOLETE */
#define TRACE_FLAVOR MIPS_EXC_STATE // OBSOLETE #define TRACE_FLAVOR MIPS_EXC_STATE
#define TRACE_FLAVOR_SIZE MIPS_EXC_STATE_COUNT // OBSOLETE #define TRACE_FLAVOR_SIZE MIPS_EXC_STATE_COUNT
#define TRACE_SET(x,state) ((struct mips_exc_state *)state)->cause = EXC_SST; // OBSOLETE #define TRACE_SET(x,state) ((struct mips_exc_state *)state)->cause = EXC_SST;
#define TRACE_CLEAR(x,state) 0 // OBSOLETE #define TRACE_CLEAR(x,state) 0
// OBSOLETE
/* Mach supports attach/detach */ // OBSOLETE /* Mach supports attach/detach */
#define ATTACH_DETACH 1 // OBSOLETE #define ATTACH_DETACH 1
// OBSOLETE
#include "mips/tm-mips.h" // OBSOLETE #include "mips/tm-mips.h"
// OBSOLETE
/* Address of end of user stack space. // OBSOLETE /* Address of end of user stack space.
* for MACH, see <machine/vmparam.h> // OBSOLETE * for MACH, see <machine/vmparam.h>
*/ // OBSOLETE */
#undef STACK_END_ADDR // OBSOLETE #undef STACK_END_ADDR
#define STACK_END_ADDR USRSTACK // OBSOLETE #define STACK_END_ADDR USRSTACK
// OBSOLETE
/* Output registers in tabular format */ // OBSOLETE /* Output registers in tabular format */
#define TABULAR_REGISTER_OUTPUT // OBSOLETE #define TABULAR_REGISTER_OUTPUT

@ -1,29 +1,29 @@
/* Definitions to make GDB run on a mips box under 4.3bsd. // OBSOLETE /* Definitions to make GDB run on a mips box under 4.3bsd.
Copyright 1986, 1987, 1989, 1993 Free Software Foundation, Inc. // OBSOLETE Copyright 1986, 1987, 1989, 1993 Free Software Foundation, Inc.
Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin // OBSOLETE Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
and by Alessandro Forin(af@cs.cmu.edu) at CMU // OBSOLETE and by Alessandro Forin(af@cs.cmu.edu) at CMU
// OBSOLETE
This file is part of GDB. // OBSOLETE This file is part of GDB.
// OBSOLETE
This program is free software; you can redistribute it and/or modify // OBSOLETE This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by // OBSOLETE it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or // OBSOLETE the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. // OBSOLETE (at your option) any later version.
// OBSOLETE
This program is distributed in the hope that it will be useful, // OBSOLETE This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of // OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. // OBSOLETE GNU General Public License for more details.
// OBSOLETE
You should have received a copy of the GNU General Public License // OBSOLETE You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software // OBSOLETE along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, // OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ // OBSOLETE Boston, MA 02111-1307, USA. */
// OBSOLETE
#define KERNEL_U_ADDR 0 /* Not needed. */ // OBSOLETE #define KERNEL_U_ADDR 0 /* Not needed. */
// OBSOLETE
/* Only used for core files on DECstations. */ // OBSOLETE /* Only used for core files on DECstations. */
// OBSOLETE
#define REGISTER_U_ADDR(addr, blockend, regno) \ // OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \
if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\ // OBSOLETE if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\
else addr = 0; /* ..somewhere in the pcb */ // OBSOLETE else addr = 0; /* ..somewhere in the pcb */

@ -1,126 +1,126 @@
/* Mach 3.0 common definitions and global vars. // OBSOLETE /* Mach 3.0 common definitions and global vars.
// OBSOLETE
Copyright 1992, 1993, 1994, 1996 Free Software Foundation, Inc. // OBSOLETE Copyright 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
// OBSOLETE
This file is part of GDB. // OBSOLETE This file is part of GDB.
// OBSOLETE
This program is free software; you can redistribute it and/or modify // OBSOLETE This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by // OBSOLETE it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or // OBSOLETE the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. // OBSOLETE (at your option) any later version.
// OBSOLETE
This program is distributed in the hope that it will be useful, // OBSOLETE This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of // OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. // OBSOLETE GNU General Public License for more details.
// OBSOLETE
You should have received a copy of the GNU General Public License // OBSOLETE You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software // OBSOLETE along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, // OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ // OBSOLETE Boston, MA 02111-1307, USA. */
// OBSOLETE
#ifndef NM_M3_H // OBSOLETE #ifndef NM_M3_H
#define NM_M3_H // OBSOLETE #define NM_M3_H
// OBSOLETE
#include <mach.h> // OBSOLETE #include <mach.h>
#include "regcache.h" // OBSOLETE #include "regcache.h"
// OBSOLETE
/* Mach3 doesn't declare errno in <errno.h>. */ // OBSOLETE /* Mach3 doesn't declare errno in <errno.h>. */
extern int errno; // OBSOLETE extern int errno;
// OBSOLETE
/* Task port of our debugged inferior. */ // OBSOLETE /* Task port of our debugged inferior. */
// OBSOLETE
extern task_t inferior_task; // OBSOLETE extern task_t inferior_task;
// OBSOLETE
/* Thread port of the current thread in the inferior. */ // OBSOLETE /* Thread port of the current thread in the inferior. */
// OBSOLETE
extern thread_t current_thread; // OBSOLETE extern thread_t current_thread;
// OBSOLETE
/* If nonzero, we must suspend/abort && resume threads // OBSOLETE /* If nonzero, we must suspend/abort && resume threads
* when setting or getting the state. // OBSOLETE * when setting or getting the state.
*/ // OBSOLETE */
extern int must_suspend_thread; // OBSOLETE extern int must_suspend_thread;
// OBSOLETE
#define PREPARE_TO_PROCEED(select_it) mach3_prepare_to_proceed(select_it) // OBSOLETE #define PREPARE_TO_PROCEED(select_it) mach3_prepare_to_proceed(select_it)
// OBSOLETE
/* Try to get the privileged host port for authentication to machid // OBSOLETE /* Try to get the privileged host port for authentication to machid
// OBSOLETE
* If you can get this, you may debug anything on this host. // OBSOLETE * If you can get this, you may debug anything on this host.
* // OBSOLETE *
* If you can't, gdb gives it's own task port as the // OBSOLETE * If you can't, gdb gives it's own task port as the
* authentication port // OBSOLETE * authentication port
*/ // OBSOLETE */
#define mach_privileged_host_port() task_by_pid(-1) // OBSOLETE #define mach_privileged_host_port() task_by_pid(-1)
// OBSOLETE
/* // OBSOLETE /*
* This is the MIG ID number of the emulator/server bsd_execve() RPC call. // OBSOLETE * This is the MIG ID number of the emulator/server bsd_execve() RPC call.
* // OBSOLETE *
* It SHOULD never change, but if it does, gdb `run' // OBSOLETE * It SHOULD never change, but if it does, gdb `run'
* command won't work until you fix this define. // OBSOLETE * command won't work until you fix this define.
* // OBSOLETE *
*/ // OBSOLETE */
#define MIG_EXEC_SYSCALL_ID 101000 // OBSOLETE #define MIG_EXEC_SYSCALL_ID 101000
// OBSOLETE
/* If our_message_port gets a msg with this ID, // OBSOLETE /* If our_message_port gets a msg with this ID,
* GDB suspends it's inferior and enters command level. // OBSOLETE * GDB suspends it's inferior and enters command level.
* (Useful at least if ^C does not work) // OBSOLETE * (Useful at least if ^C does not work)
*/ // OBSOLETE */
#define GDB_MESSAGE_ID_STOP 0x41151 // OBSOLETE #define GDB_MESSAGE_ID_STOP 0x41151
// OBSOLETE
/* wait3 WNOHANG is defined in <sys/wait.h> but // OBSOLETE /* wait3 WNOHANG is defined in <sys/wait.h> but
* for some reason gdb does not want to include // OBSOLETE * for some reason gdb does not want to include
* that file. // OBSOLETE * that file.
* // OBSOLETE *
* If your system defines WNOHANG differently, this has to be changed. // OBSOLETE * If your system defines WNOHANG differently, this has to be changed.
*/ // OBSOLETE */
#define WNOHANG 1 // OBSOLETE #define WNOHANG 1
// OBSOLETE
/* Before storing, we need to read all the registers. */ // OBSOLETE /* Before storing, we need to read all the registers. */
// OBSOLETE
#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES) // OBSOLETE #define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
// OBSOLETE
/* Check if the inferior exists */ // OBSOLETE /* Check if the inferior exists */
#define MACH_ERROR_NO_INFERIOR \ // OBSOLETE #define MACH_ERROR_NO_INFERIOR \
do if (!MACH_PORT_VALID (inferior_task)) \ // OBSOLETE do if (!MACH_PORT_VALID (inferior_task)) \
error ("Inferior task does not exist."); while(0) // OBSOLETE error ("Inferior task does not exist."); while(0)
// OBSOLETE
/* Error handler for mach calls */ // OBSOLETE /* Error handler for mach calls */
#define CHK(str,ret) \ // OBSOLETE #define CHK(str,ret) \
do if (ret != KERN_SUCCESS) \ // OBSOLETE do if (ret != KERN_SUCCESS) \
error ("Gdb %s [%d] %s : %s\n",__FILE__,__LINE__,str, \ // OBSOLETE error ("Gdb %s [%d] %s : %s\n",__FILE__,__LINE__,str, \
mach_error_string(ret)); while(0) // OBSOLETE mach_error_string(ret)); while(0)
// OBSOLETE
/* This is from POE9 emulator/emul_stack.h // OBSOLETE /* This is from POE9 emulator/emul_stack.h
*/ // OBSOLETE */
/* // OBSOLETE /*
* Top of emulator stack holds link and reply port. // OBSOLETE * Top of emulator stack holds link and reply port.
*/ // OBSOLETE */
struct emul_stack_top // OBSOLETE struct emul_stack_top
{ // OBSOLETE {
struct emul_stack_top *link; // OBSOLETE struct emul_stack_top *link;
mach_port_t reply_port; // OBSOLETE mach_port_t reply_port;
}; // OBSOLETE };
// OBSOLETE
#define EMULATOR_STACK_SIZE (4096*4) // OBSOLETE #define EMULATOR_STACK_SIZE (4096*4)
// OBSOLETE
#define THREAD_ALLOWED_TO_BREAK(mid) mach_thread_for_breakpoint (mid) // OBSOLETE #define THREAD_ALLOWED_TO_BREAK(mid) mach_thread_for_breakpoint (mid)
// OBSOLETE
#define THREAD_PARSE_ID(arg) mach_thread_parse_id (arg) // OBSOLETE #define THREAD_PARSE_ID(arg) mach_thread_parse_id (arg)
// OBSOLETE
#define THREAD_OUTPUT_ID(mid) mach_thread_output_id (mid) // OBSOLETE #define THREAD_OUTPUT_ID(mid) mach_thread_output_id (mid)
// OBSOLETE
#define ATTACH_TO_THREAD attach_to_thread // OBSOLETE #define ATTACH_TO_THREAD attach_to_thread
// OBSOLETE
/* Don't do wait_for_inferior on attach. */ // OBSOLETE /* Don't do wait_for_inferior on attach. */
#define ATTACH_NO_WAIT // OBSOLETE #define ATTACH_NO_WAIT
// OBSOLETE
/* Do Mach 3 dependent operations when ^C or a STOP is requested */ // OBSOLETE /* Do Mach 3 dependent operations when ^C or a STOP is requested */
#define DO_QUIT() mach3_quit () // OBSOLETE #define DO_QUIT() mach3_quit ()
// OBSOLETE
#if 0 // OBSOLETE #if 0
/* This is bogus. It is NOT OK to quit out of target_wait. */ // OBSOLETE /* This is bogus. It is NOT OK to quit out of target_wait. */
/* If in mach_msg() and ^C is typed set immediate_quit */ // OBSOLETE /* If in mach_msg() and ^C is typed set immediate_quit */
#define REQUEST_QUIT() mach3_request_quit () // OBSOLETE #define REQUEST_QUIT() mach3_request_quit ()
#endif // OBSOLETE #endif
// OBSOLETE
#endif /* NM_M3_H */ // OBSOLETE #endif /* NM_M3_H */

@ -94,7 +94,7 @@ m68*-sun-sunos3*) gdb_host=sun3os3 ;;
m68*-sun-sunos4*) gdb_host=sun3os4 ;; m68*-sun-sunos4*) gdb_host=sun3os4 ;;
m68*-sun-*) gdb_host=sun3os4 ;; m68*-sun-*) gdb_host=sun3os4 ;;
mips-dec-mach3*) gdb_host=mipsm3 ;; # OBSOLETE mips-dec-mach3*) gdb_host=mipsm3 ;;
mips-dec-*) gdb_host=decstation ;; mips-dec-*) gdb_host=decstation ;;
mips-little-*) gdb_host=littlemips ;; mips-little-*) gdb_host=littlemips ;;
mips-sgi-irix3*) gdb_host=irix3 ;; mips-sgi-irix3*) gdb_host=irix3 ;;

@ -172,7 +172,7 @@ mips*-*-linux*) gdb_target=linux
build_gdbserver=yes build_gdbserver=yes
;; ;;
mips*-*-netbsd*) gdb_target=nbsd ;; mips*-*-netbsd*) gdb_target=nbsd ;;
mips*-*-mach3*) gdb_target=mipsm3 ;; # OBSOLETE mips*-*-mach3*) gdb_target=mipsm3 ;;
mips*-*-sysv4*) gdb_target=mipsv4 ;; mips*-*-sysv4*) gdb_target=mipsv4 ;;
mips*-*-sysv*) gdb_target=bigmips ;; mips*-*-sysv*) gdb_target=bigmips ;;
mips*-*-riscos*) gdb_target=bigmips ;; mips*-*-riscos*) gdb_target=bigmips ;;

File diff suppressed because it is too large Load Diff

@ -1,386 +1,386 @@
/* Definitions to make GDB run on a mips box under Mach 3.0 // OBSOLETE /* Definitions to make GDB run on a mips box under Mach 3.0
Copyright 1992, 1993, 1998, 2000, 2001 Free Software Foundation, Inc. // OBSOLETE Copyright 1992, 1993, 1998, 2000, 2001 Free Software Foundation, Inc.
// OBSOLETE
This file is part of GDB. // OBSOLETE This file is part of GDB.
// OBSOLETE
This program is free software; you can redistribute it and/or modify // OBSOLETE This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by // OBSOLETE it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or // OBSOLETE the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. // OBSOLETE (at your option) any later version.
// OBSOLETE
This program is distributed in the hope that it will be useful, // OBSOLETE This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of // OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. // OBSOLETE GNU General Public License for more details.
// OBSOLETE
You should have received a copy of the GNU General Public License // OBSOLETE You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software // OBSOLETE along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, // OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ // OBSOLETE Boston, MA 02111-1307, USA. */
// OBSOLETE
/* Mach specific routines for little endian mips (e.g. pmax) // OBSOLETE /* Mach specific routines for little endian mips (e.g. pmax)
* running Mach 3.0 // OBSOLETE * running Mach 3.0
* // OBSOLETE *
* Author: Jukka Virtanen <jtv@hut.fi> // OBSOLETE * Author: Jukka Virtanen <jtv@hut.fi>
*/ // OBSOLETE */
// OBSOLETE
#include "defs.h" // OBSOLETE #include "defs.h"
#include "inferior.h" // OBSOLETE #include "inferior.h"
#include "regcache.h" // OBSOLETE #include "regcache.h"
// OBSOLETE
#include <stdio.h> // OBSOLETE #include <stdio.h>
// OBSOLETE
#include <mach.h> // OBSOLETE #include <mach.h>
#include <mach/message.h> // OBSOLETE #include <mach/message.h>
#include <mach/exception.h> // OBSOLETE #include <mach/exception.h>
#include <mach_error.h> // OBSOLETE #include <mach_error.h>
// OBSOLETE
/* Find offsets to thread states at compile time. // OBSOLETE /* Find offsets to thread states at compile time.
* If your compiler does not grok this, check the hand coded // OBSOLETE * If your compiler does not grok this, check the hand coded
* offsets and use them. // OBSOLETE * offsets and use them.
*/ // OBSOLETE */
// OBSOLETE
#if 1 // OBSOLETE #if 1
// OBSOLETE
#define REG_OFFSET(reg) (int)(&((struct mips_thread_state *)0)->reg) // OBSOLETE #define REG_OFFSET(reg) (int)(&((struct mips_thread_state *)0)->reg)
#define CREG_OFFSET(reg) (int)(&((struct mips_float_state *)0)->reg) // OBSOLETE #define CREG_OFFSET(reg) (int)(&((struct mips_float_state *)0)->reg)
#define EREG_OFFSET(reg) (int)(&((struct mips_exc_state *)0)->reg) // OBSOLETE #define EREG_OFFSET(reg) (int)(&((struct mips_exc_state *)0)->reg)
// OBSOLETE
/* at reg_offset[i] is the offset to the mips_thread_state // OBSOLETE /* at reg_offset[i] is the offset to the mips_thread_state
* location where the gdb registers[i] is stored. // OBSOLETE * location where the gdb registers[i] is stored.
* // OBSOLETE *
* -1 means mach does not save it anywhere. // OBSOLETE * -1 means mach does not save it anywhere.
*/ // OBSOLETE */
static int reg_offset[] = // OBSOLETE static int reg_offset[] =
{ // OBSOLETE {
/* zero at v0 v1 */ // OBSOLETE /* zero at v0 v1 */
-1, REG_OFFSET (r1), REG_OFFSET (r2), REG_OFFSET (r3), // OBSOLETE -1, REG_OFFSET (r1), REG_OFFSET (r2), REG_OFFSET (r3),
// OBSOLETE
/* a0 a1 a2 a3 */ // OBSOLETE /* a0 a1 a2 a3 */
REG_OFFSET (r4), REG_OFFSET (r5), REG_OFFSET (r6), REG_OFFSET (r7), // OBSOLETE REG_OFFSET (r4), REG_OFFSET (r5), REG_OFFSET (r6), REG_OFFSET (r7),
// OBSOLETE
/* t0 t1 t2 t3 */ // OBSOLETE /* t0 t1 t2 t3 */
REG_OFFSET (r8), REG_OFFSET (r9), REG_OFFSET (r10), REG_OFFSET (r11), // OBSOLETE REG_OFFSET (r8), REG_OFFSET (r9), REG_OFFSET (r10), REG_OFFSET (r11),
// OBSOLETE
/* t4 t5 t6 t7 */ // OBSOLETE /* t4 t5 t6 t7 */
REG_OFFSET (r12), REG_OFFSET (r13), REG_OFFSET (r14), REG_OFFSET (r15), // OBSOLETE REG_OFFSET (r12), REG_OFFSET (r13), REG_OFFSET (r14), REG_OFFSET (r15),
// OBSOLETE
/* s0 s1 s2 s3 */ // OBSOLETE /* s0 s1 s2 s3 */
REG_OFFSET (r16), REG_OFFSET (r17), REG_OFFSET (r18), REG_OFFSET (r19), // OBSOLETE REG_OFFSET (r16), REG_OFFSET (r17), REG_OFFSET (r18), REG_OFFSET (r19),
// OBSOLETE
/* s4 s5 s6 s7 */ // OBSOLETE /* s4 s5 s6 s7 */
REG_OFFSET (r20), REG_OFFSET (r21), REG_OFFSET (r22), REG_OFFSET (r23), // OBSOLETE REG_OFFSET (r20), REG_OFFSET (r21), REG_OFFSET (r22), REG_OFFSET (r23),
// OBSOLETE
/* t8 t9 k0 k1 */ // OBSOLETE /* t8 t9 k0 k1 */
REG_OFFSET (r24), REG_OFFSET (r25), REG_OFFSET (r26), REG_OFFSET (r27), // OBSOLETE REG_OFFSET (r24), REG_OFFSET (r25), REG_OFFSET (r26), REG_OFFSET (r27),
// OBSOLETE
/* gp sp s8(30) == fp(72) ra */ // OBSOLETE /* gp sp s8(30) == fp(72) ra */
REG_OFFSET (r28), REG_OFFSET (r29), REG_OFFSET (r30), REG_OFFSET (r31), // OBSOLETE REG_OFFSET (r28), REG_OFFSET (r29), REG_OFFSET (r30), REG_OFFSET (r31),
// OBSOLETE
/* sr(32) PS_REGNUM */ // OBSOLETE /* sr(32) PS_REGNUM */
EREG_OFFSET (coproc_state), // OBSOLETE EREG_OFFSET (coproc_state),
// OBSOLETE
/* lo(33) hi(34) */ // OBSOLETE /* lo(33) hi(34) */
REG_OFFSET (mdlo), REG_OFFSET (mdhi), // OBSOLETE REG_OFFSET (mdlo), REG_OFFSET (mdhi),
// OBSOLETE
/* bad(35) cause(36) pc(37) */ // OBSOLETE /* bad(35) cause(36) pc(37) */
EREG_OFFSET (address), EREG_OFFSET (cause), REG_OFFSET (pc), // OBSOLETE EREG_OFFSET (address), EREG_OFFSET (cause), REG_OFFSET (pc),
// OBSOLETE
/* f0(38) f1(39) f2(40) f3(41) */ // OBSOLETE /* f0(38) f1(39) f2(40) f3(41) */
CREG_OFFSET (r0), CREG_OFFSET (r1), CREG_OFFSET (r2), CREG_OFFSET (r3), // OBSOLETE CREG_OFFSET (r0), CREG_OFFSET (r1), CREG_OFFSET (r2), CREG_OFFSET (r3),
CREG_OFFSET (r4), CREG_OFFSET (r5), CREG_OFFSET (r6), CREG_OFFSET (r7), // OBSOLETE CREG_OFFSET (r4), CREG_OFFSET (r5), CREG_OFFSET (r6), CREG_OFFSET (r7),
CREG_OFFSET (r8), CREG_OFFSET (r9), CREG_OFFSET (r10), CREG_OFFSET (r11), // OBSOLETE CREG_OFFSET (r8), CREG_OFFSET (r9), CREG_OFFSET (r10), CREG_OFFSET (r11),
CREG_OFFSET (r12), CREG_OFFSET (r13), CREG_OFFSET (r14), CREG_OFFSET (r15), // OBSOLETE CREG_OFFSET (r12), CREG_OFFSET (r13), CREG_OFFSET (r14), CREG_OFFSET (r15),
CREG_OFFSET (r16), CREG_OFFSET (r17), CREG_OFFSET (r18), CREG_OFFSET (r19), // OBSOLETE CREG_OFFSET (r16), CREG_OFFSET (r17), CREG_OFFSET (r18), CREG_OFFSET (r19),
CREG_OFFSET (r20), CREG_OFFSET (r21), CREG_OFFSET (r22), CREG_OFFSET (r23), // OBSOLETE CREG_OFFSET (r20), CREG_OFFSET (r21), CREG_OFFSET (r22), CREG_OFFSET (r23),
CREG_OFFSET (r24), CREG_OFFSET (r25), CREG_OFFSET (r26), CREG_OFFSET (r27), // OBSOLETE CREG_OFFSET (r24), CREG_OFFSET (r25), CREG_OFFSET (r26), CREG_OFFSET (r27),
CREG_OFFSET (r28), CREG_OFFSET (r29), CREG_OFFSET (r30), CREG_OFFSET (r31), // OBSOLETE CREG_OFFSET (r28), CREG_OFFSET (r29), CREG_OFFSET (r30), CREG_OFFSET (r31),
// OBSOLETE
/* fsr(70) fir(71) fp(72) == s8(30) */ // OBSOLETE /* fsr(70) fir(71) fp(72) == s8(30) */
CREG_OFFSET (csr), CREG_OFFSET (esr), REG_OFFSET (r30) // OBSOLETE CREG_OFFSET (csr), CREG_OFFSET (esr), REG_OFFSET (r30)
}; // OBSOLETE };
#else // OBSOLETE #else
/* If the compiler does not grok the above defines */ // OBSOLETE /* If the compiler does not grok the above defines */
static int reg_offset[] = // OBSOLETE static int reg_offset[] =
{ // OBSOLETE {
/* mach_thread_state offsets: */ // OBSOLETE /* mach_thread_state offsets: */
-1, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, // OBSOLETE -1, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, // OBSOLETE 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120,
/*sr, lo, hi,addr,cause,pc */ // OBSOLETE /*sr, lo, hi,addr,cause,pc */
8, 124, 128, 4, 0, 132, // OBSOLETE 8, 124, 128, 4, 0, 132,
/* mach_float_state offsets: */ // OBSOLETE /* mach_float_state offsets: */
0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, // OBSOLETE 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60,
64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, // OBSOLETE 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124,
/*fsr,fir */ // OBSOLETE /*fsr,fir */
128, 132, // OBSOLETE 128, 132,
/* FP_REGNUM pseudo maps to s8==r30 in mach_thread_state */ // OBSOLETE /* FP_REGNUM pseudo maps to s8==r30 in mach_thread_state */
116 // OBSOLETE 116
}; // OBSOLETE };
#endif // OBSOLETE #endif
// OBSOLETE
/* Fetch COUNT contiguous registers from thread STATE starting from REGNUM // OBSOLETE /* Fetch COUNT contiguous registers from thread STATE starting from REGNUM
* Caller knows that the regs handled in one transaction are of same size. // OBSOLETE * Caller knows that the regs handled in one transaction are of same size.
*/ // OBSOLETE */
#define FETCH_REGS(state, regnum, count) \ // OBSOLETE #define FETCH_REGS(state, regnum, count) \
memcpy (&deprecated_registers[REGISTER_BYTE (regnum)], \ // OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (regnum)], \
(char *)state+reg_offset[ regnum ], \ // OBSOLETE (char *)state+reg_offset[ regnum ], \
count*REGISTER_SIZE) // OBSOLETE count*REGISTER_SIZE)
// OBSOLETE
/* Store COUNT contiguous registers to thread STATE starting from REGNUM */ // OBSOLETE /* Store COUNT contiguous registers to thread STATE starting from REGNUM */
#define STORE_REGS(state, regnum, count) \ // OBSOLETE #define STORE_REGS(state, regnum, count) \
memcpy ((char *)state+reg_offset[ regnum ], \ // OBSOLETE memcpy ((char *)state+reg_offset[ regnum ], \
&deprecated_registers[REGISTER_BYTE (regnum)], \ // OBSOLETE &deprecated_registers[REGISTER_BYTE (regnum)], \
count*REGISTER_SIZE) // OBSOLETE count*REGISTER_SIZE)
// OBSOLETE
#define REGS_ALL -1 // OBSOLETE #define REGS_ALL -1
#define REGS_NORMAL 1 // OBSOLETE #define REGS_NORMAL 1
#define REGS_EXC 2 // OBSOLETE #define REGS_EXC 2
#define REGS_COP1 4 // OBSOLETE #define REGS_COP1 4
// OBSOLETE
/* Hardware regs that matches FP_REGNUM */ // OBSOLETE /* Hardware regs that matches FP_REGNUM */
#define MACH_FP_REGNUM 30 // OBSOLETE #define MACH_FP_REGNUM 30
// OBSOLETE
/* Fech thread's registers. if regno == -1, fetch all regs */ // OBSOLETE /* Fech thread's registers. if regno == -1, fetch all regs */
void // OBSOLETE void
fetch_inferior_registers (int regno) // OBSOLETE fetch_inferior_registers (int regno)
{ // OBSOLETE {
kern_return_t ret; // OBSOLETE kern_return_t ret;
// OBSOLETE
thread_state_data_t state; // OBSOLETE thread_state_data_t state;
struct mips_exc_state exc_state; // OBSOLETE struct mips_exc_state exc_state;
// OBSOLETE
int stateCnt = MIPS_THREAD_STATE_COUNT; // OBSOLETE int stateCnt = MIPS_THREAD_STATE_COUNT;
// OBSOLETE
int which_regs = 0; /* A bit mask */ // OBSOLETE int which_regs = 0; /* A bit mask */
// OBSOLETE
if (!MACH_PORT_VALID (current_thread)) // OBSOLETE if (!MACH_PORT_VALID (current_thread))
error ("fetch inferior registers: Invalid thread"); // OBSOLETE error ("fetch inferior registers: Invalid thread");
// OBSOLETE
if (regno < -1 || regno >= NUM_REGS) // OBSOLETE if (regno < -1 || regno >= NUM_REGS)
error ("invalid register %d supplied to fetch_inferior_registers", regno); // OBSOLETE error ("invalid register %d supplied to fetch_inferior_registers", regno);
// OBSOLETE
if (regno == -1) // OBSOLETE if (regno == -1)
which_regs = REGS_ALL; // OBSOLETE which_regs = REGS_ALL;
else if (regno == ZERO_REGNUM) // OBSOLETE else if (regno == ZERO_REGNUM)
{ // OBSOLETE {
int zero = 0; // OBSOLETE int zero = 0;
supply_register (ZERO_REGNUM, &zero); // OBSOLETE supply_register (ZERO_REGNUM, &zero);
return; // OBSOLETE return;
} // OBSOLETE }
else if ((ZERO_REGNUM < regno && regno < PS_REGNUM) // OBSOLETE else if ((ZERO_REGNUM < regno && regno < PS_REGNUM)
|| regno == FP_REGNUM // OBSOLETE || regno == FP_REGNUM
|| regno == LO_REGNUM // OBSOLETE || regno == LO_REGNUM
|| regno == HI_REGNUM // OBSOLETE || regno == HI_REGNUM
|| regno == PC_REGNUM) // OBSOLETE || regno == PC_REGNUM)
which_regs = REGS_NORMAL; // OBSOLETE which_regs = REGS_NORMAL;
else if (FP0_REGNUM <= regno && regno <= FCRIR_REGNUM) // OBSOLETE else if (FP0_REGNUM <= regno && regno <= FCRIR_REGNUM)
which_regs = REGS_COP1 | REGS_EXC; // OBSOLETE which_regs = REGS_COP1 | REGS_EXC;
else // OBSOLETE else
which_regs = REGS_EXC; // OBSOLETE which_regs = REGS_EXC;
// OBSOLETE
/* fetch regs saved to mips_thread_state */ // OBSOLETE /* fetch regs saved to mips_thread_state */
if (which_regs & REGS_NORMAL) // OBSOLETE if (which_regs & REGS_NORMAL)
{ // OBSOLETE {
ret = thread_get_state (current_thread, // OBSOLETE ret = thread_get_state (current_thread,
MIPS_THREAD_STATE, // OBSOLETE MIPS_THREAD_STATE,
state, // OBSOLETE state,
&stateCnt); // OBSOLETE &stateCnt);
CHK ("fetch inferior registers: thread_get_state", ret); // OBSOLETE CHK ("fetch inferior registers: thread_get_state", ret);
// OBSOLETE
if (which_regs == REGS_NORMAL) // OBSOLETE if (which_regs == REGS_NORMAL)
{ // OBSOLETE {
/* Fetch also FP_REGNUM if fetching MACH_FP_REGNUM and vice versa */ // OBSOLETE /* Fetch also FP_REGNUM if fetching MACH_FP_REGNUM and vice versa */
if (regno == MACH_FP_REGNUM || regno == FP_REGNUM) // OBSOLETE if (regno == MACH_FP_REGNUM || regno == FP_REGNUM)
{ // OBSOLETE {
supply_register (FP_REGNUM, // OBSOLETE supply_register (FP_REGNUM,
(char *) state + reg_offset[MACH_FP_REGNUM]); // OBSOLETE (char *) state + reg_offset[MACH_FP_REGNUM]);
supply_register (MACH_FP_REGNUM, // OBSOLETE supply_register (MACH_FP_REGNUM,
(char *) state + reg_offset[MACH_FP_REGNUM]); // OBSOLETE (char *) state + reg_offset[MACH_FP_REGNUM]);
} // OBSOLETE }
else // OBSOLETE else
supply_register (regno, // OBSOLETE supply_register (regno,
(char *) state + reg_offset[regno]); // OBSOLETE (char *) state + reg_offset[regno]);
return; // OBSOLETE return;
} // OBSOLETE }
// OBSOLETE
/* ZERO_REGNUM is always zero */ // OBSOLETE /* ZERO_REGNUM is always zero */
*(int *) deprecated_registers = 0; // OBSOLETE *(int *) deprecated_registers = 0;
// OBSOLETE
/* Copy thread saved regs 1..31 to gdb's reg value array // OBSOLETE /* Copy thread saved regs 1..31 to gdb's reg value array
* Luckily, they are contiquous // OBSOLETE * Luckily, they are contiquous
*/ // OBSOLETE */
FETCH_REGS (state, 1, 31); // OBSOLETE FETCH_REGS (state, 1, 31);
// OBSOLETE
/* Copy mdlo and mdhi */ // OBSOLETE /* Copy mdlo and mdhi */
FETCH_REGS (state, LO_REGNUM, 2); // OBSOLETE FETCH_REGS (state, LO_REGNUM, 2);
// OBSOLETE
/* Copy PC */ // OBSOLETE /* Copy PC */
FETCH_REGS (state, PC_REGNUM, 1); // OBSOLETE FETCH_REGS (state, PC_REGNUM, 1);
// OBSOLETE
/* Mach 3.0 saves FP to MACH_FP_REGNUM. // OBSOLETE /* Mach 3.0 saves FP to MACH_FP_REGNUM.
* For some reason gdb wants to assign a pseudo register for it. // OBSOLETE * For some reason gdb wants to assign a pseudo register for it.
*/ // OBSOLETE */
FETCH_REGS (state, FP_REGNUM, 1); // OBSOLETE FETCH_REGS (state, FP_REGNUM, 1);
} // OBSOLETE }
// OBSOLETE
/* Read exc state. Also read if need to fetch floats */ // OBSOLETE /* Read exc state. Also read if need to fetch floats */
if (which_regs & REGS_EXC) // OBSOLETE if (which_regs & REGS_EXC)
{ // OBSOLETE {
stateCnt = MIPS_EXC_STATE_COUNT; // OBSOLETE stateCnt = MIPS_EXC_STATE_COUNT;
ret = thread_get_state (current_thread, // OBSOLETE ret = thread_get_state (current_thread,
MIPS_EXC_STATE, // OBSOLETE MIPS_EXC_STATE,
(thread_state_t) & exc_state, // OBSOLETE (thread_state_t) & exc_state,
&stateCnt); // OBSOLETE &stateCnt);
CHK ("fetch inferior regs (exc): thread_get_state", ret); // OBSOLETE CHK ("fetch inferior regs (exc): thread_get_state", ret);
// OBSOLETE
/* We need to fetch exc_state to see if the floating // OBSOLETE /* We need to fetch exc_state to see if the floating
* state is valid for the thread. // OBSOLETE * state is valid for the thread.
*/ // OBSOLETE */
// OBSOLETE
/* cproc_state: Which coprocessors the thread uses */ // OBSOLETE /* cproc_state: Which coprocessors the thread uses */
supply_register (PS_REGNUM, // OBSOLETE supply_register (PS_REGNUM,
(char *) &exc_state + reg_offset[PS_REGNUM]); // OBSOLETE (char *) &exc_state + reg_offset[PS_REGNUM]);
// OBSOLETE
if (which_regs == REGS_EXC || which_regs == REGS_ALL) // OBSOLETE if (which_regs == REGS_EXC || which_regs == REGS_ALL)
{ // OBSOLETE {
supply_register (BADVADDR_REGNUM, // OBSOLETE supply_register (BADVADDR_REGNUM,
(char *) &exc_state + reg_offset[BADVADDR_REGNUM]); // OBSOLETE (char *) &exc_state + reg_offset[BADVADDR_REGNUM]);
// OBSOLETE
supply_register (CAUSE_REGNUM, // OBSOLETE supply_register (CAUSE_REGNUM,
(char *) &exc_state + reg_offset[CAUSE_REGNUM]); // OBSOLETE (char *) &exc_state + reg_offset[CAUSE_REGNUM]);
if (which_regs == REGS_EXC) // OBSOLETE if (which_regs == REGS_EXC)
return; // OBSOLETE return;
} // OBSOLETE }
} // OBSOLETE }
// OBSOLETE
// OBSOLETE
if (which_regs & REGS_COP1) // OBSOLETE if (which_regs & REGS_COP1)
{ // OBSOLETE {
/* If the thread does not have saved COPROC1, set regs to zero */ // OBSOLETE /* If the thread does not have saved COPROC1, set regs to zero */
// OBSOLETE
if (!(exc_state.coproc_state & MIPS_STATUS_USE_COP1)) // OBSOLETE if (!(exc_state.coproc_state & MIPS_STATUS_USE_COP1))
bzero (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)], // OBSOLETE bzero (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
sizeof (struct mips_float_state)); // OBSOLETE sizeof (struct mips_float_state));
else // OBSOLETE else
{ // OBSOLETE {
stateCnt = MIPS_FLOAT_STATE_COUNT; // OBSOLETE stateCnt = MIPS_FLOAT_STATE_COUNT;
ret = thread_get_state (current_thread, // OBSOLETE ret = thread_get_state (current_thread,
MIPS_FLOAT_STATE, // OBSOLETE MIPS_FLOAT_STATE,
state, // OBSOLETE state,
&stateCnt); // OBSOLETE &stateCnt);
CHK ("fetch inferior regs (floats): thread_get_state", ret); // OBSOLETE CHK ("fetch inferior regs (floats): thread_get_state", ret);
// OBSOLETE
if (regno != -1) // OBSOLETE if (regno != -1)
{ // OBSOLETE {
supply_register (regno, // OBSOLETE supply_register (regno,
(char *) state + reg_offset[regno]); // OBSOLETE (char *) state + reg_offset[regno]);
return; // OBSOLETE return;
} // OBSOLETE }
// OBSOLETE
FETCH_REGS (state, FP0_REGNUM, 34); // OBSOLETE FETCH_REGS (state, FP0_REGNUM, 34);
} // OBSOLETE }
} // OBSOLETE }
// OBSOLETE
/* All registers are valid, if not returned yet */ // OBSOLETE /* All registers are valid, if not returned yet */
deprecated_registers_fetched (); // OBSOLETE deprecated_registers_fetched ();
} // OBSOLETE }
// OBSOLETE
/* Store gdb's view of registers to the thread. // OBSOLETE /* Store gdb's view of registers to the thread.
* All registers are always valid when entering here. // OBSOLETE * All registers are always valid when entering here.
* @@ ahem, maybe that is too strict, we could validate the necessary ones // OBSOLETE * @@ ahem, maybe that is too strict, we could validate the necessary ones
* here. // OBSOLETE * here.
* // OBSOLETE *
* Hmm. It seems that gdb set $reg=value command first reads everything, // OBSOLETE * Hmm. It seems that gdb set $reg=value command first reads everything,
* then sets the reg and then stores everything. -> we must make sure // OBSOLETE * then sets the reg and then stores everything. -> we must make sure
* that the immutable registers are not changed by reading them first. // OBSOLETE * that the immutable registers are not changed by reading them first.
*/ // OBSOLETE */
// OBSOLETE
void // OBSOLETE void
store_inferior_registers (register int regno) // OBSOLETE store_inferior_registers (register int regno)
{ // OBSOLETE {
thread_state_data_t state; // OBSOLETE thread_state_data_t state;
kern_return_t ret; // OBSOLETE kern_return_t ret;
// OBSOLETE
if (!MACH_PORT_VALID (current_thread)) // OBSOLETE if (!MACH_PORT_VALID (current_thread))
error ("store inferior registers: Invalid thread"); // OBSOLETE error ("store inferior registers: Invalid thread");
// OBSOLETE
/* Check for read only regs. // OBSOLETE /* Check for read only regs.
* @@ If some of these is can be changed, fix this // OBSOLETE * @@ If some of these is can be changed, fix this
*/ // OBSOLETE */
if (regno == ZERO_REGNUM || // OBSOLETE if (regno == ZERO_REGNUM ||
regno == PS_REGNUM || // OBSOLETE regno == PS_REGNUM ||
regno == BADVADDR_REGNUM || // OBSOLETE regno == BADVADDR_REGNUM ||
regno == CAUSE_REGNUM || // OBSOLETE regno == CAUSE_REGNUM ||
regno == FCRIR_REGNUM) // OBSOLETE regno == FCRIR_REGNUM)
{ // OBSOLETE {
message ("You can not alter read-only register `%s'", // OBSOLETE message ("You can not alter read-only register `%s'",
REGISTER_NAME (regno)); // OBSOLETE REGISTER_NAME (regno));
fetch_inferior_registers (regno); // OBSOLETE fetch_inferior_registers (regno);
return; // OBSOLETE return;
} // OBSOLETE }
// OBSOLETE
if (regno == -1) // OBSOLETE if (regno == -1)
{ // OBSOLETE {
/* Don't allow these to change */ // OBSOLETE /* Don't allow these to change */
// OBSOLETE
/* ZERO_REGNUM */ // OBSOLETE /* ZERO_REGNUM */
*(int *) deprecated_registers = 0; // OBSOLETE *(int *) deprecated_registers = 0;
// OBSOLETE
fetch_inferior_registers (PS_REGNUM); // OBSOLETE fetch_inferior_registers (PS_REGNUM);
fetch_inferior_registers (BADVADDR_REGNUM); // OBSOLETE fetch_inferior_registers (BADVADDR_REGNUM);
fetch_inferior_registers (CAUSE_REGNUM); // OBSOLETE fetch_inferior_registers (CAUSE_REGNUM);
fetch_inferior_registers (FCRIR_REGNUM); // OBSOLETE fetch_inferior_registers (FCRIR_REGNUM);
} // OBSOLETE }
// OBSOLETE
if (regno == -1 || (ZERO_REGNUM < regno && regno <= PC_REGNUM)) // OBSOLETE if (regno == -1 || (ZERO_REGNUM < regno && regno <= PC_REGNUM))
{ // OBSOLETE {
#if 1 // OBSOLETE #if 1
/* Mach 3.0 saves thread's FP to MACH_FP_REGNUM. // OBSOLETE /* Mach 3.0 saves thread's FP to MACH_FP_REGNUM.
* GDB wants assigns a pseudo register FP_REGNUM for frame pointer. // OBSOLETE * GDB wants assigns a pseudo register FP_REGNUM for frame pointer.
* // OBSOLETE *
* @@@ Here I assume (!) that gdb's FP has the value that // OBSOLETE * @@@ Here I assume (!) that gdb's FP has the value that
* should go to threads frame pointer. If not true, this // OBSOLETE * should go to threads frame pointer. If not true, this
* fails badly!!!!! // OBSOLETE * fails badly!!!!!
*/ // OBSOLETE */
memcpy (&deprecated_registers[REGISTER_BYTE (MACH_FP_REGNUM)], // OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (MACH_FP_REGNUM)],
&deprecated_registers[REGISTER_BYTE (FP_REGNUM)], // OBSOLETE &deprecated_registers[REGISTER_BYTE (FP_REGNUM)],
REGISTER_RAW_SIZE (FP_REGNUM)); // OBSOLETE REGISTER_RAW_SIZE (FP_REGNUM));
#endif // OBSOLETE #endif
// OBSOLETE
/* Save gdb's regs 1..31 to thread saved regs 1..31 // OBSOLETE /* Save gdb's regs 1..31 to thread saved regs 1..31
* Luckily, they are contiquous // OBSOLETE * Luckily, they are contiquous
*/ // OBSOLETE */
STORE_REGS (state, 1, 31); // OBSOLETE STORE_REGS (state, 1, 31);
// OBSOLETE
/* Save mdlo, mdhi */ // OBSOLETE /* Save mdlo, mdhi */
STORE_REGS (state, LO_REGNUM, 2); // OBSOLETE STORE_REGS (state, LO_REGNUM, 2);
// OBSOLETE
/* Save PC */ // OBSOLETE /* Save PC */
STORE_REGS (state, PC_REGNUM, 1); // OBSOLETE STORE_REGS (state, PC_REGNUM, 1);
// OBSOLETE
ret = thread_set_state (current_thread, // OBSOLETE ret = thread_set_state (current_thread,
MIPS_THREAD_STATE, // OBSOLETE MIPS_THREAD_STATE,
state, // OBSOLETE state,
MIPS_FLOAT_STATE_COUNT); // OBSOLETE MIPS_FLOAT_STATE_COUNT);
CHK ("store inferior regs : thread_set_state", ret); // OBSOLETE CHK ("store inferior regs : thread_set_state", ret);
} // OBSOLETE }
// OBSOLETE
if (regno == -1 || regno >= FP0_REGNUM) // OBSOLETE if (regno == -1 || regno >= FP0_REGNUM)
{ // OBSOLETE {
/* If thread has floating state, save it */ // OBSOLETE /* If thread has floating state, save it */
if (read_register (PS_REGNUM) & MIPS_STATUS_USE_COP1) // OBSOLETE if (read_register (PS_REGNUM) & MIPS_STATUS_USE_COP1)
{ // OBSOLETE {
/* Do NOT save FCRIR_REGNUM */ // OBSOLETE /* Do NOT save FCRIR_REGNUM */
STORE_REGS (state, FP0_REGNUM, 33); // OBSOLETE STORE_REGS (state, FP0_REGNUM, 33);
// OBSOLETE
ret = thread_set_state (current_thread, // OBSOLETE ret = thread_set_state (current_thread,
MIPS_FLOAT_STATE, // OBSOLETE MIPS_FLOAT_STATE,
state, // OBSOLETE state,
MIPS_FLOAT_STATE_COUNT); // OBSOLETE MIPS_FLOAT_STATE_COUNT);
CHK ("store inferior registers (floats): thread_set_state", ret); // OBSOLETE CHK ("store inferior registers (floats): thread_set_state", ret);
} // OBSOLETE }
else if (regno != -1) // OBSOLETE else if (regno != -1)
message // OBSOLETE message
("Thread does not use floating point unit, floating regs not saved"); // OBSOLETE ("Thread does not use floating point unit, floating regs not saved");
} // OBSOLETE }
} // OBSOLETE }