/* Native-dependent code for BSD Unix running on ARM's, for GDB.
- Copyright 1988, 1989, 1991, 1992, 1994, 1996, 1999, 2002
+
+ Copyright (C) 1988, 1989, 1991, 1992, 1994, 1996, 1999, 2002, 2004
Free Software Foundation, Inc.
This file is part of GDB.
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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
#include "defs.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "target.h"
-#ifndef FETCH_INFERIOR_REGISTERS
-#error Not FETCH_INFERIOR_REGISTERS
-#endif /* !FETCH_INFERIOR_REGISTERS */
-
-#include "arm-tdep.h"
-
+#include "gdb_string.h"
#include <sys/types.h>
#include <sys/ptrace.h>
#include <machine/reg.h>
#include <machine/frame.h>
-#include "inferior.h"
-#include "regcache.h"
-#include "gdbcore.h"
+
+#include "arm-tdep.h"
+#include "inf-ptrace.h"
extern int arm_apcs_32;
int ret;
ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ (PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
{
- warning ("unable to fetch general register");
+ warning (_("unable to fetch general register"));
return;
}
int regno;
ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ (PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
{
- warning ("unable to fetch general registers");
+ warning (_("unable to fetch general registers"));
return;
}
int ret;
ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+ (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
{
- warning ("unable to fetch floating-point register");
+ warning (_("unable to fetch floating-point register"));
return;
}
int regno;
ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+ (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
{
- warning ("unable to fetch general registers");
+ warning (_("unable to fetch general registers"));
return;
}
supply_fparegset (&inferior_fp_registers);
}
-void
-fetch_inferior_registers (int regno)
+static void
+armnbsd_fetch_registers (int regno)
{
if (regno >= 0)
{
int ret;
ret = ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ (PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
{
- warning ("unable to fetch general registers");
+ warning (_("unable to fetch general registers"));
return;
}
}
ret = ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ (PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
- warning ("unable to write register %d to inferior", regno);
+ warning (_("unable to write register %d to inferior"), regno);
}
static void
}
ret = ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+ (PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
- warning ("unable to store general registers");
+ warning (_("unable to store general registers"));
}
static void
int ret;
ret = ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+ (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
{
- warning ("unable to fetch floating-point registers");
+ warning (_("unable to fetch floating-point registers"));
return;
}
}
ret = ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+ (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
- warning ("unable to write register %d to inferior", regno);
+ warning (_("unable to write register %d to inferior"), regno);
}
static void
(char *) &inferior_fp_registers.fpr_fpsr);
ret = ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+ (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
- warning ("unable to store floating-point registers");
+ warning (_("unable to store floating-point registers"));
}
-void
-store_inferior_registers (int regno)
+static void
+armnbsd_store_registers (int regno)
{
if (regno >= 0)
{
{
case 0: /* Integer registers. */
if (core_reg_size != sizeof (struct reg))
- warning ("wrong size of register set in core file");
+ warning (_("wrong size of register set in core file"));
else
{
/* The memcpy may be unnecessary, but we can't really be sure
case 2:
if (core_reg_size != sizeof (struct fpreg))
- warning ("wrong size of FPA register set in core file");
+ warning (_("wrong size of FPA register set in core file"));
else
{
/* The memcpy may be unnecessary, but we can't really be sure
void
_initialize_arm_netbsd_nat (void)
{
+ struct target_ops *t;
+
+ t = inf_ptrace_target ();
+ t->to_fetch_registers = armnbsd_fetch_registers;
+ t->to_store_registers = armnbsd_store_registers;
+ add_target (t);
+
deprecated_add_core_fns (&arm_netbsd_core_fns);
deprecated_add_core_fns (&arm_netbsd_elfcore_fns);
}