aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppcnbsd-nat.c
diff options
context:
space:
mode:
authorJ.T. Conklin <jtc@acorntoolworks.com>2000-10-27 19:17:57 +0000
committerJ.T. Conklin <jtc@acorntoolworks.com>2000-10-27 19:17:57 +0000
commitec3d358c9f7f313ecde095bcf1ea45a5706c6d71 (patch)
treef2610a607ff7bdf867f3241e8e343a82628ed870 /gdb/ppcnbsd-nat.c
parent6f6ef0faed469f8dc9d0257a9b23a7678311819f (diff)
downloadgdb-ec3d358c9f7f313ecde095bcf1ea45a5706c6d71.zip
gdb-ec3d358c9f7f313ecde095bcf1ea45a5706c6d71.tar.gz
gdb-ec3d358c9f7f313ecde095bcf1ea45a5706c6d71.tar.bz2
* arch-utils.c (set_architecture, set_architecture_from_arch_mach,
set_gdbarch_from_file): Fix spelling error. * v850-tdep.c (v850_target_architecture_hook): Likewise. * gdbarch.sh: Fix spelling errors in comment. * gdbarch.c, gdbarch.h: Regenerate. * ppcnbsd-nat.c (fetch_core_registers, fetch_inferior_registers, store_inferior_registers): Support older NetBSD/powerpc systems from before fp reg support was added. Adapt to register number changes caused when powerpc target was multi-arched.
Diffstat (limited to 'gdb/ppcnbsd-nat.c')
-rw-r--r--gdb/ppcnbsd-nat.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/gdb/ppcnbsd-nat.c b/gdb/ppcnbsd-nat.c
index 3fba397..044115b 100644
--- a/gdb/ppcnbsd-nat.c
+++ b/gdb/ppcnbsd-nat.c
@@ -26,6 +26,7 @@
#include "defs.h"
#include "inferior.h"
#include "gdbcore.h"
+#include "ppc-tdep.h"
#define RF(dst, src) \
memcpy(&registers[REGISTER_BYTE(dst)], &src, sizeof(src))
@@ -37,23 +38,27 @@ void
fetch_inferior_registers (int regno)
{
struct reg inferior_registers;
+#ifdef PT_GETFPREGS
struct fpreg inferior_fp_registers;
+#endif
int i;
ptrace (PT_GETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_registers, 0);
for (i = 0; i < 32; i++)
RF (i, inferior_registers.fixreg[i]);
- RF (LR_REGNUM, inferior_registers.lr);
- RF (CR_REGNUM, inferior_registers.cr);
- RF (XER_REGNUM, inferior_registers.xer);
- RF (CTR_REGNUM, inferior_registers.ctr);
+ RF (PPC_LR_REGNUM, inferior_registers.lr);
+ RF (PPC_CR_REGNUM, inferior_registers.cr);
+ RF (PPC_XER_REGNUM, inferior_registers.xer);
+ RF (PPC_CTR_REGNUM, inferior_registers.ctr);
RF (PC_REGNUM, inferior_registers.pc);
+#ifdef PT_GETFPREGS
ptrace (PT_GETFPREGS, inferior_pid,
- (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
for (i = 0; i < 32; i++)
RF (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]);
+#endif
registers_fetched ();
}
@@ -62,30 +67,36 @@ void
store_inferior_registers (int regno)
{
struct reg inferior_registers;
+#ifdef PT_SETFPREGS
struct fpreg inferior_fp_registers;
+#endif
int i;
for (i = 0; i < 32; i++)
RS (i, inferior_registers.fixreg[i]);
- RS (LR_REGNUM, inferior_registers.lr);
- RS (CR_REGNUM, inferior_registers.cr);
- RS (XER_REGNUM, inferior_registers.xer);
- RS (CTR_REGNUM, inferior_registers.ctr);
+ RS (PPC_LR_REGNUM, inferior_registers.lr);
+ RS (PPC_CR_REGNUM, inferior_registers.cr);
+ RS (PPC_XER_REGNUM, inferior_registers.xer);
+ RS (PPC_CTR_REGNUM, inferior_registers.ctr);
RS (PC_REGNUM, inferior_registers.pc);
ptrace (PT_SETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_registers, 0);
+#ifdef PT_SETFPREGS
for (i = 0; i < 32; i++)
RS (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]);
ptrace (PT_SETFPREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
+#endif
}
struct md_core
{
struct reg intreg;
+#ifdef PT_GETFPREGS
struct fpreg freg;
+#endif
};
void
@@ -98,15 +109,17 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
/* Integer registers */
for (i = 0; i < 32; i++)
RF (i, core_reg->intreg.fixreg[i]);
- RF (LR_REGNUM, core_reg->intreg.lr);
- RF (CR_REGNUM, core_reg->intreg.cr);
- RF (XER_REGNUM, core_reg->intreg.xer);
- RF (CTR_REGNUM, core_reg->intreg.ctr);
+ RF (PPC_LR_REGNUM, core_reg->intreg.lr);
+ RF (PPC_CR_REGNUM, core_reg->intreg.cr);
+ RF (PPC_XER_REGNUM, core_reg->intreg.xer);
+ RF (PPC_CTR_REGNUM, core_reg->intreg.ctr);
RF (PC_REGNUM, core_reg->intreg.pc);
+#ifdef PT_FPGETREGS
/* Floating point registers */
for (i = 0; i < 32; i++)
RF (FP0_REGNUM + i, core_reg->freg.r_regs[i]);
+#endif
registers_fetched ();
}