This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[COMMIT] Convert OpenBSD/m88k to use target vector inheritance
- From: Mark Kettenis <kettenis at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 30 Sep 2004 22:53:03 +0200 (CEST)
- Subject: [COMMIT] Convert OpenBSD/m88k to use target vector inheritance
Subject says it all.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* m88kbsd-nat.c: Include "target.h" and "inf-ptrace.h".
(m88kbsd_fetch_inferior_registers): Rename from
fetch_inferior_registers. Make static.
(m88kbsd_store_inferior_registers): Rename from
store_inferior_registers. Make static.
(_initialize_m88kbsd_nat): New prototype and function.
* config/m88k/obsd.mh (NATDEPFILES): Remove infptrace.o and
inftarg.o. Add inf-child.o and inf-ptrace.o.
(NAT_FILE): Remove.
* Makefile.in (m88kbsd-nat.o): Update dependencies.
Index: m88kbsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/m88kbsd-nat.c,v
retrieving revision 1.2
diff -u -p -r1.2 m88kbsd-nat.c
--- m88kbsd-nat.c 14 Aug 2004 23:37:04 -0000 1.2
+++ m88kbsd-nat.c 30 Sep 2004 20:51:31 -0000
@@ -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 "m88k-tdep.h"
+#include "inf-ptrace.h"
/* Supply the general-purpose registers stored in GREGS to REGCACHE. */
@@ -62,8 +64,8 @@ m88kbsd_collect_gregset (const struct re
/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this
for all registers. */
-void
-fetch_inferior_registers (int regnum)
+static void
+m88kbsd_fetch_inferior_registers (int regnum)
{
struct reg regs;
@@ -77,8 +79,8 @@ fetch_inferior_registers (int regnum)
/* Store register REGNUM back into the inferior. If REGNUM is -1, do
this for all registers. */
-void
-store_inferior_registers (int regnum)
+static void
+m88kbsd_store_inferior_registers (int regnum)
{
struct reg regs;
@@ -92,3 +94,18 @@ store_inferior_registers (int regnum)
(PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name ("Couldn't write registers");
}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_m88kbsd_nat (void);
+
+void
+_initialize_m88kbsd_nat (void)
+{
+ struct target_ops *t;
+
+ t = inf_ptrace_target ();
+ t->to_fetch_registers = m88kbsd_fetch_inferior_registers;
+ t->to_store_registers = m88kbsd_store_inferior_registers;
+ add_target (t);
+}
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.631
diff -u -p -r1.631 Makefile.in
--- Makefile.in 28 Sep 2004 19:00:52 -0000 1.631
+++ Makefile.in 30 Sep 2004 20:51:35 -0000
@@ -2166,7 +2166,7 @@ m68k-tdep.o: m68k-tdep.c $(defs_h) $(dwa
$(inferior_h) $(regcache_h) $(arch_utils_h) $(osabi_h) $(dis_asm_h) \
$(m68k_tdep_h) $(gregset_h)
m88kbsd-nat.o: m88kbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
- $(m88k_tdep_h)
+ $(target_h) $(m88k_tdep_h) $(inf_ptrace.h)
m88k-tdep.o: m88k-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) $(frame_h) \
$(frame_base_h) $(frame_unwind_h) $(gdbcore_h) $(gdbtypes_h) \
$(regcache_h) $(regset_h) $(symtab_h) $(trad_frame_h) $(value_h) \
Index: config/m88k/obsd.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/m88k/obsd.mh,v
retrieving revision 1.2
diff -u -p -r1.2 obsd.mh
--- config/m88k/obsd.mh 3 Sep 2004 19:08:19 -0000 1.2
+++ config/m88k/obsd.mh 30 Sep 2004 20:51:35 -0000
@@ -1,3 +1,2 @@
# Host: OpenBSD/m88k
-NATDEPFILES= m88kbsd-nat.o fork-child.o infptrace.o inftarg.o
-NAT_FILE= config/nm-bsd.h
+NATDEPFILES= fork-child.o inf-child.o inf-ptrace.o m88kbsd-nat.o