* configure.tgt (*-*-vxworks): Match vxworks* instead.
[binutils-gdb.git] / gdb / ppcnbsd-nat.c
index 7fd84c0423b4e3623748513c1dd0d70b170b7300..064f6028ce1f862c2003a42dd66b10119e80d1fe 100644 (file)
@@ -35,6 +35,8 @@
 #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)
@@ -73,8 +75,8 @@ getfpregs_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))
     {
@@ -82,7 +84,7 @@ fetch_inferior_registers (int regno)
 
       if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
                  (PTRACE_TYPE_ARG3) &regs, 0) == -1)
-        perror_with_name ("Couldn't get registers");
+        perror_with_name (_("Couldn't get registers"));
 
       ppcnbsd_supply_reg ((char *) &regs, regno);
       if (regno != -1)
@@ -95,7 +97,7 @@ fetch_inferior_registers (int regno)
 
       if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
                  (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
-       perror_with_name ("Couldn't get FP registers");
+       perror_with_name (_("Couldn't get FP registers"));
 
       ppcnbsd_supply_fpreg ((char *) &fpregs, regno);
       if (regno != -1)
@@ -103,8 +105,8 @@ fetch_inferior_registers (int regno)
     }
 }
 
-void
-store_inferior_registers (int regno)
+static void
+ppcnbsd_store_inferior_registers (int regno)
 {
   if (regno == -1 || getregs_supplies (regno))
     {
@@ -112,13 +114,13 @@ store_inferior_registers (int regno)
 
       if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
                  (PTRACE_TYPE_ARG3) &regs, 0) == -1)
-       perror_with_name ("Couldn't get registers");
+       perror_with_name (_("Couldn't get registers"));
 
       ppcnbsd_fill_reg ((char *) &regs, regno);
 
       if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
                  (PTRACE_TYPE_ARG3) &regs, 0) == -1)
-       perror_with_name ("Couldn't write registers");
+       perror_with_name (_("Couldn't write registers"));
 
       if (regno != -1)
        return;
@@ -130,13 +132,13 @@ store_inferior_registers (int regno)
 
       if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
                  (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
-       perror_with_name ("Couldn't get FP registers");
+       perror_with_name (_("Couldn't get FP registers"));
 
       ppcnbsd_fill_fpreg ((char *) &fpregs, regno);
       
       if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
                  (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
-       perror_with_name ("Couldn't set FP registers");
+       perror_with_name (_("Couldn't set FP registers"));
     }
 }
 
@@ -177,6 +179,12 @@ void _initialize_ppcnbsd_nat (void);
 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);
 }