summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2005-11-25 18:26:44 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2005-11-25 18:26:44 +0000
commit5203f49065e329cfa983ded2d47bd26c36db85b7 (patch)
tree3e38bb1aaaefb28458a02311e961be73871a6769 /gnu
parentf9c0fe14c8c120d5956cd51987745f6a8ee67d5a (diff)
Cut hppa over to inf-ptrace.c, making fork following work.
tested by miod@.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/binutils/gdb/config/pa/obsd.mh3
-rw-r--r--gnu/usr.bin/binutils/gdb/hppabsd-nat.c33
2 files changed, 26 insertions, 10 deletions
diff --git a/gnu/usr.bin/binutils/gdb/config/pa/obsd.mh b/gnu/usr.bin/binutils/gdb/config/pa/obsd.mh
index 2c3dba97f59..4e7683214fb 100644
--- a/gnu/usr.bin/binutils/gdb/config/pa/obsd.mh
+++ b/gnu/usr.bin/binutils/gdb/config/pa/obsd.mh
@@ -1,3 +1,2 @@
# Host: OpenBSD/hppa
-NATDEPFILES= fork-child.o infptrace.o inftarg.o hppabsd-nat.o
-NAT_FILE= config/nm-bsd.h
+NATDEPFILES= fork-child.o inf-ptrace.o hppabsd-nat.o
diff --git a/gnu/usr.bin/binutils/gdb/hppabsd-nat.c b/gnu/usr.bin/binutils/gdb/hppabsd-nat.c
index fb53c967558..98293a00440 100644
--- a/gnu/usr.bin/binutils/gdb/hppabsd-nat.c
+++ b/gnu/usr.bin/binutils/gdb/hppabsd-nat.c
@@ -1,6 +1,6 @@
/* Native-dependent code for HP PA-RISC BSD's.
- Copyright 2004 Free Software Foundation, Inc.
+ Copyright 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
@@ -22,12 +22,14 @@
#include "defs.h"
#include "inferior.h"
#include "regcache.h"
+#include "target.h"
#include <sys/types.h>
#include <sys/ptrace.h>
#include <machine/reg.h>
#include "hppa-tdep.h"
+#include "inf-ptrace.h"
static int
hppabsd_gregset_supplies_p (int regnum)
@@ -79,8 +81,8 @@ hppabsd_collect_gregset (const struct regcache *regcache,
/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this
for all registers (including the floating-point registers). */
-void
-fetch_inferior_registers (int regnum)
+static void
+hppabsd_fetch_registers (int regnum)
{
struct regcache *regcache = current_regcache;
@@ -90,7 +92,7 @@ fetch_inferior_registers (int regnum)
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"));
hppabsd_supply_gregset (regcache, &regs);
}
@@ -99,8 +101,8 @@ fetch_inferior_registers (int regnum)
/* Store register REGNUM back into the inferior. If REGNUM is -1, do
this for all registers (including the floating-point registers). */
-void
-store_inferior_registers (int regnum)
+static void
+hppabsd_store_registers (int regnum)
{
if (regnum == -1 || hppabsd_gregset_supplies_p (regnum))
{
@@ -108,12 +110,27 @@ store_inferior_registers (int regnum)
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"));
hppabsd_collect_gregset (current_regcache, &regs, regnum);
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"));
}
}
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_hppabsd_nat (void);
+
+void
+_initialize_hppabsd_nat (void)
+{
+ struct target_ops *t;
+
+ /* Add in local overrides. */
+ t = inf_ptrace_target ();
+ t->to_fetch_registers = hppabsd_fetch_registers;
+ t->to_store_registers = hppabsd_store_registers;
+ add_target (t);
+}