summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorphil <phil@NetBSD.org>1995-09-26 20:23:36 +0000
committerphil <phil@NetBSD.org>1995-09-26 20:23:36 +0000
commitf9d6b3823a778aaa78bcf780a159fa3d5835fb29 (patch)
treee88bf0e1dc21789201207a1f06c68b0873c8df7e /gnu
parent03fa08025bdc2bdc71969f467c12c5e5adb3f105 (diff)
Improvements by Matthias Pfaller (fpu regs ...)
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gdb/gdb/arch/ns32k/Makefile.inc4
-rw-r--r--gnu/usr.bin/gdb/gdb/arch/ns32k/ns32k-nat.c83
-rw-r--r--gnu/usr.bin/gdb/gdb/arch/ns32k/ns32k-tdep.c39
-rw-r--r--gnu/usr.bin/gdb/gdb/arch/ns32k/tm-umax.h15
4 files changed, 79 insertions, 62 deletions
diff --git a/gnu/usr.bin/gdb/gdb/arch/ns32k/Makefile.inc b/gnu/usr.bin/gdb/gdb/arch/ns32k/Makefile.inc
index 067fa7bb90e..7f9388d6364 100644
--- a/gnu/usr.bin/gdb/gdb/arch/ns32k/Makefile.inc
+++ b/gnu/usr.bin/gdb/gdb/arch/ns32k/Makefile.inc
@@ -1,4 +1,4 @@
-# $Id: Makefile.inc,v 1.2 1994/06/09 14:46:17 phil Exp $
+# $Id: Makefile.inc,v 1.3 1995/09/26 20:23:36 phil Exp $
-SRCS+= coredep.c ns32k-pinsn.c ns32k-tdep.c ns32k-nat.c
+SRCS+= ns32k-pinsn.c ns32k-tdep.c ns32k-nat.c
diff --git a/gnu/usr.bin/gdb/gdb/arch/ns32k/ns32k-nat.c b/gnu/usr.bin/gdb/gdb/arch/ns32k/ns32k-nat.c
index d83f7a6857a..046ff544fba 100644
--- a/gnu/usr.bin/gdb/gdb/arch/ns32k/ns32k-nat.c
+++ b/gnu/usr.bin/gdb/gdb/arch/ns32k/ns32k-nat.c
@@ -17,16 +17,16 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: ns32k-nat.c,v 1.3 1995/08/29 08:03:29 phil Exp $
+ $Id: ns32k-nat.c,v 1.4 1995/09/26 20:23:38 phil Exp $
*/
#include <sys/types.h>
#include <sys/param.h>
#include <signal.h>
+#include <sys/ptrace.h>
#include <sys/user.h>
#include <machine/reg.h>
#include <machine/frame.h>
-#include <sys/ptrace.h>
#include "defs.h"
#include "inferior.h"
@@ -47,9 +47,9 @@ fetch_inferior_registers (regno)
struct fpreg inferior_fpregisters;
ptrace (PT_GETREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ (PTRACE_ARG3_TYPE) &inferior_registers, 0);
ptrace (PT_GETFPREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
+ (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
RF(R0_REGNUM + 0, inferior_registers.r_r0);
RF(R0_REGNUM + 1, inferior_registers.r_r1);
@@ -106,16 +106,87 @@ store_inferior_registers (regno)
(PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
}
+/* XXX - Add this to machine/regs.h instead? */
+struct coreregs {
+ struct reg intreg;
+ struct fpreg freg;
+};
+
+/* Get registers from a core file. */
+void
+fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
+ char *core_reg_sect;
+ unsigned core_reg_size;
+ int which;
+ unsigned int ignore; /* reg addr, unused in this version */
+{
+ struct coreregs *core_reg;
+
+ core_reg = (struct coreregs *)core_reg_sect;
+
+ /*
+ * We have *all* registers
+ * in the first core section.
+ * Ignore which.
+ */
+
+ /* Integer registers */
+ RF(R0_REGNUM + 0, core_reg->intreg.r_r0);
+ RF(R0_REGNUM + 1, core_reg->intreg.r_r1);
+ RF(R0_REGNUM + 2, core_reg->intreg.r_r2);
+ RF(R0_REGNUM + 3, core_reg->intreg.r_r3);
+ RF(R0_REGNUM + 4, core_reg->intreg.r_r4);
+ RF(R0_REGNUM + 5, core_reg->intreg.r_r5);
+ RF(R0_REGNUM + 6, core_reg->intreg.r_r6);
+ RF(R0_REGNUM + 7, core_reg->intreg.r_r7);
+
+ RF(SP_REGNUM , core_reg->intreg.r_sp);
+ RF(FP_REGNUM , core_reg->intreg.r_fp);
+ RF(PC_REGNUM , core_reg->intreg.r_pc);
+ RF(PS_REGNUM , core_reg->intreg.r_psr);
+
+ /* Floating point registers */
+ RF(FPS_REGNUM , core_reg->freg.r_fsr);
+ RF(FP0_REGNUM +0, core_reg->freg.r_freg[0]);
+ RF(FP0_REGNUM +2, core_reg->freg.r_freg[2]);
+ RF(FP0_REGNUM +4, core_reg->freg.r_freg[4]);
+ RF(FP0_REGNUM +6, core_reg->freg.r_freg[6]);
+}
+
void
fetch_kcore_registers (pcb)
struct pcb *pcb;
{
- return;
+ return;
}
void
clear_regs()
{
- return;
+ double zero = 0.0;
+ int null = 0;
+
+ /* Integer registers */
+ RF(R0_REGNUM + 0, null);
+ RF(R0_REGNUM + 1, null);
+ RF(R0_REGNUM + 2, null);
+ RF(R0_REGNUM + 3, null);
+ RF(R0_REGNUM + 4, null);
+ RF(R0_REGNUM + 5, null);
+ RF(R0_REGNUM + 6, null);
+ RF(R0_REGNUM + 7, null);
+
+ RF(SP_REGNUM , null);
+ RF(FP_REGNUM , null);
+ RF(PC_REGNUM , null);
+ RF(PS_REGNUM , null);
+
+ /* Floating point registers */
+ RF(FPS_REGNUM , zero);
+ RF(FP0_REGNUM +0, zero);
+ RF(FP0_REGNUM +2, zero);
+ RF(FP0_REGNUM +4, zero);
+ RF(FP0_REGNUM +6, zero);
+ return;
}
diff --git a/gnu/usr.bin/gdb/gdb/arch/ns32k/ns32k-tdep.c b/gnu/usr.bin/gdb/gdb/arch/ns32k/ns32k-tdep.c
index aea0eda64df..18f41e28e85 100644
--- a/gnu/usr.bin/gdb/gdb/arch/ns32k/ns32k-tdep.c
+++ b/gnu/usr.bin/gdb/gdb/arch/ns32k/ns32k-tdep.c
@@ -17,24 +17,6 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-/*
- * HISTORY
- * $Log: ns32k-tdep.c,v $
- * Revision 1.3 1995/08/29 08:03:31 phil
- * Changes from Matthias Pfaller to get gdb to work.
- *
- * Revision 1.2 1994/05/24 23:58:24 phil
- * Follow changes to sys/arch/pc532/include/reg.h.
- *
- * Revision 1.1 1994/04/28 17:11:31 phil
- * Adding ns32k support.
- *
- * Revision 2.1.1.1 93/04/16 16:35:44 pds
- * Added copyright notice and whist markers.
- * [93/04/16 pds]
- *
- */
-
/* @@@ isa_NAN should be in ieee generic float routines file */
/* Check for bad floats/doubles in P
@@ -81,24 +63,3 @@ isa_NAN(p, len)
}
else return 1;
}
-
-/* this table must line up with REGISTER_NAMES in tm-ns32k.h */
-static int regmap[] =
-{
- REG_R0, REG_R1, REG_R2, REG_R3, REG_R4, REG_R5, REG_R6, REG_R7,
- 0, 0, 0, 0, 0, 0, 0, 0,
- REG_SP, REG_FP, REG_PC, REG_PSR,
- 0, 0, 0, 0, 0
-};
-
-/* blockend is the value of u.u_ar0, and points to the
- place where r7 is stored. */
-
-int
-ns32k_register_u_addr (blockend, regnum)
- int blockend;
- int regnum;
-{
- return (blockend + 4 * regmap[regnum]);
-}
-
diff --git a/gnu/usr.bin/gdb/gdb/arch/ns32k/tm-umax.h b/gnu/usr.bin/gdb/gdb/arch/ns32k/tm-umax.h
index f50bd290828..45a4f61c195 100644
--- a/gnu/usr.bin/gdb/gdb/arch/ns32k/tm-umax.h
+++ b/gnu/usr.bin/gdb/gdb/arch/ns32k/tm-umax.h
@@ -17,21 +17,6 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-/*
- * HISTORY
- * $Log: tm-umax.h,v $
- * Revision 1.2 1995/08/29 08:03:32 phil
- * Changes from Matthias Pfaller to get gdb to work.
- *
- * Revision 1.1 1994/04/28 17:11:32 phil
- * Adding ns32k support.
- *
- * Revision 4.8.1.1 93/04/16 15:38:43 pds
- * Mach 3.0 fixes. (jtv@hut.fi)
- * [93/02/09 14:36:37 pds]
- *
- * [93/02/09 pds]
- */
#define TARGET_BYTE_ORDER LITTLE_ENDIAN