This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[COMMIT] Target vector inheritance for OpenBSD/powerpc
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sourceware dot org
- Date: Sun, 17 Apr 2005 00:12:36 +0200 (CEST)
- Subject: [COMMIT] Target vector inheritance for OpenBSD/powerpc
Even more inftarg/infptrace shit bites the dust.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* ppcobsd-nat.c: Update copyright year. Include "inf-ptrace.h".
(ppcobsd_fetch_registers): Renamed from fetch_inferior_registers;
made static.
(ppcobsd_store_registers): Renamed from store_inferior_registers;
made static.
(_initialize_ppcobsd_nat): Construct and add target vector.
* config/powerpc/obsd.mh (NATDEPFILES): Remove infptrace.o and
inftarg.o. Add inf-ptrace.o.
(NAT_FILE): Remove.
* Makefile.in (ppcobsd-nat.o): Update dependencies.
Index: ppcobsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/ppcobsd-nat.c,v
retrieving revision 1.4
diff -u -p -r1.4 ppcobsd-nat.c
--- ppcobsd-nat.c 11 Feb 2005 18:13:52 -0000 1.4
+++ ppcobsd-nat.c 16 Apr 2005 22:11:16 -0000
@@ -1,6 +1,6 @@
/* Native-dependent code for OpenBSD/powerpc.
- Copyright 2004 Free Software Foundation, Inc.
+ Copyright 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
@@ -30,6 +30,7 @@
#include "ppc-tdep.h"
#include "ppcobsd-tdep.h"
+#include "inf-ptrace.h"
/* OpenBSD/powerpc doesn't have PT_GETFPREGS/PT_SETFPREGS like
NetBSD/powerpc and FreeBSD/powerpc. */
@@ -37,8 +38,8 @@
/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this
for all registers. */
-void
-fetch_inferior_registers (int regnum)
+static void
+ppcobsd_fetch_registers (int regnum)
{
struct reg regs;
@@ -53,8 +54,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
+ppcobsd_store_registers (int regnum)
{
struct reg regs;
@@ -77,6 +78,14 @@ void _initialize_ppcobsd_nat (void);
void
_initialize_ppcobsd_nat (void)
{
+ struct target_ops *t;
+
+ /* Add in local overrides. */
+ t = inf_ptrace_target ();
+ t->to_fetch_registers = ppcobsd_fetch_registers;
+ t->to_store_registers = ppcobsd_store_registers;
+ add_target (t);
+
/* General-purpose registers. */
ppcobsd_reg_offsets.r0_offset = offsetof (struct reg, gpr);
ppcobsd_reg_offsets.pc_offset = offsetof (struct reg, pc);
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.713
diff -u -p -r1.713 Makefile.in
--- Makefile.in 16 Apr 2005 21:37:02 -0000 1.713
+++ Makefile.in 16 Apr 2005 22:11:19 -0000
@@ -2371,7 +2371,7 @@ ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h)
$(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(tramp_frame_h) $(trad_frame_h) \
$(gdb_assert_h) $(solib_svr4_h)
ppcobsd-nat.o: ppcobsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
- $(ppc_tdep_h) $(ppcobsd_tdep_h)
+ $(ppc_tdep_h) $(ppcobsd_tdep_h) $(inf_ptrace_h)
ppcobsd-tdep.o: ppcobsd-tdep.c $(defs_h) $(arch_utils_h) $(floatformat_h) \
$(osabi_h) $(regcache_h) $(regset_h) $(trad_frame_h) \
$(tramp_frame_h) $(gdb_assert_h) $(gdb_string_h) $(ppc_tdep_h) \
Index: config/powerpc/obsd.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/powerpc/obsd.mh,v
retrieving revision 1.2
diff -u -p -r1.2 obsd.mh
--- config/powerpc/obsd.mh 3 Sep 2004 19:08:20 -0000 1.2
+++ config/powerpc/obsd.mh 16 Apr 2005 22:11:19 -0000
@@ -1,3 +1,2 @@
# Host: OpenBSD/powerpc
-NATDEPFILES= ppcobsd-nat.o fork-child.o infptrace.o inftarg.o
-NAT_FILE= config/nm-bsd.h
+NATDEPFILES= fork-child.o inf-ptrace.o ppcobsd-nat.o