#include "ppc-tdep.h"
#include "ppcnbsd-tdep.h"
+#include "inf-ptrace.h"
+
/* Returns true if PT_GETREGS fetches this register. */
static int
getregs_supplies (int regno)
|| regno == tdep->ppc_fpscr_regnum);
}
-void
-fetch_inferior_registers (int regno)
+static void
+ppcnbsd_fetch_inferior_registers (int regno)
{
if (regno == -1 || getregs_supplies (regno))
{
struct reg regs;
if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) ®s, 0) == -1)
- perror_with_name ("Couldn't get registers");
+ (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ perror_with_name (_("Couldn't get registers"));
ppcnbsd_supply_reg ((char *) ®s, regno);
if (regno != -1)
struct fpreg fpregs;
if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
- perror_with_name ("Couldn't get FP registers");
+ (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ perror_with_name (_("Couldn't get FP registers"));
ppcnbsd_supply_fpreg ((char *) &fpregs, regno);
if (regno != -1)
}
}
-void
-store_inferior_registers (int regno)
+static void
+ppcnbsd_store_inferior_registers (int regno)
{
if (regno == -1 || getregs_supplies (regno))
{
struct reg regs;
if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) ®s, 0) == -1)
- perror_with_name ("Couldn't get registers");
+ (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ perror_with_name (_("Couldn't get registers"));
ppcnbsd_fill_reg ((char *) ®s, regno);
if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) ®s, 0) == -1)
- perror_with_name ("Couldn't write registers");
+ (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ perror_with_name (_("Couldn't write registers"));
if (regno != -1)
return;
struct fpreg fpregs;
if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
- perror_with_name ("Couldn't get FP registers");
+ (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ perror_with_name (_("Couldn't get FP registers"));
ppcnbsd_fill_fpreg ((char *) &fpregs, regno);
if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
- perror_with_name ("Couldn't set FP registers");
+ (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ perror_with_name (_("Couldn't set FP registers"));
}
}
void
_initialize_ppcnbsd_nat (void)
{
+ struct target_ops *t;
/* Support debugging kernel virtual memory images. */
bsd_kvm_add_target (ppcnbsd_supply_pcb);
+ /* Add in local overrides. */
+ t = inf_ptrace_target ();
+ t->to_fetch_registers = ppcnbsd_fetch_inferior_registers;
+ t->to_store_registers = ppcnbsd_store_inferior_registers;
+ add_target (t);
}