aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-11-07 17:08:34 +0000
committerMark Kettenis <kettenis@gnu.org>2004-11-07 17:08:34 +0000
commit366e93e85b19be7a78481925fc84a6cf3459e7bf (patch)
treed98ba555d43d12b66e7f1c8857a0238805c05ad5 /gdb/mips64obsd-nat.c
parent* mips64obsd-tdep.c: Include "trad-frame.h", "tramp-frame.h" and (diff)
downloadbinutils-gdb-366e93e85b19be7a78481925fc84a6cf3459e7bf.tar.gz
binutils-gdb-366e93e85b19be7a78481925fc84a6cf3459e7bf.tar.bz2
binutils-gdb-366e93e85b19be7a78481925fc84a6cf3459e7bf.zip
* mips64obsd-nat.c: Include "mips-tdep.h".
(MIPS64OBSD_NUM_REGS): Remove define. (MIPS_PC_REGNUM, MIPS_FP0_REGNUM, MIPS_FSR_REGNUM): New defines. (mips64obsd_supply_gregset, mips64obsd_collect_gregset): Handle floating-point registers correctly. * Makefile.in (mips64obsd-nat.o): Update dependencies.
Diffstat (limited to 'gdb/mips64obsd-nat.c')
-rw-r--r--gdb/mips64obsd-nat.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gdb/mips64obsd-nat.c b/gdb/mips64obsd-nat.c
index eee3e5ea66c..d3f1d690f2e 100644
--- a/gdb/mips64obsd-nat.c
+++ b/gdb/mips64obsd-nat.c
@@ -28,9 +28,13 @@
#include <sys/ptrace.h>
#include <machine/reg.h>
+#include "mips-tdep.h"
#include "inf-ptrace.h"
-#define MIPS64OBSD_NUM_REGS 73
+/* Shorthand for some register numbers used below. */
+#define MIPS_PC_REGNUM MIPS_EMBED_PC_REGNUM
+#define MIPS_FP0_REGNUM MIPS_EMBED_FP0_REGNUM
+#define MIPS_FSR_REGNUM MIPS_EMBED_FP0_REGNUM + 32
/* Supply the general-purpose registers stored in GREGS to REGCACHE. */
@@ -40,8 +44,11 @@ mips64obsd_supply_gregset (struct regcache *regcache, const void *gregs)
const char *regs = gregs;
int regnum;
- for (regnum = 0; regnum < MIPS64OBSD_NUM_REGS; regnum++)
+ for (regnum = MIPS_ZERO_REGNUM; regnum <= MIPS_PC_REGNUM; regnum++)
regcache_raw_supply (regcache, regnum, regs + regnum * 8);
+
+ for (regnum = MIPS_FP0_REGNUM; regnum <= MIPS_FSR_REGNUM; regnum++)
+ regcache_raw_supply (regcache, regnum, regs + (regnum + 2) * 8);
}
/* Collect the general-purpose registers from REGCACHE and store them
@@ -54,11 +61,17 @@ mips64obsd_collect_gregset (const struct regcache *regcache,
char *regs = gregs;
int i;
- for (i = 0; i <= MIPS64OBSD_NUM_REGS; i++)
+ for (i = MIPS_ZERO_REGNUM; i <= MIPS_PC_REGNUM; i++)
{
if (regnum == -1 || regnum == i)
regcache_raw_collect (regcache, i, regs + i * 8);
}
+
+ for (i = MIPS_FP0_REGNUM; i <= MIPS_FSR_REGNUM; i++)
+ {
+ if (regnum == -1 || regnum == i)
+ regcache_raw_collect (regcache, i, regs + (i + 2) * 8);
+ }
}