This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/RFA] OpenBSD/powerpc support


   Date: Tue, 20 Apr 2004 15:37:13 -0700
   From: Kevin Buettner <kevinb@redhat.com>

   > For now I've added these functions to ppcobsd-tdep.c (and the
   > definition of `struct pcc_reg_offsets' to ppcobsd-tdep.h.  But they
   > should probably be moved to rs6000-tdep.c (and ppc-tdep.h).

   I'm willing for these functions to be added to rs6000-tdep.c and ppc-tdep.h
   at the outset.  (Consider such a patch to be preapproved.)

The attached is what I actually checked in.

Cheers,

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	Add OpenBSD/powerpc support.
	* NEWS (New native configurations): Mention OpenBSD/powerpc.
	* ppc-tdep.h (struct ppc_reg_offsets): New structure.
	(ppc_supply_gregset, ppc_supply_fpregset, ppc_collect_gregset)
	(ppc_collect_fpregset): New prototypes.
	* ppcobsd-nat.c: New file.
	* ppcobsd-tdep.c: New file.
	* ppcobsd-tdep.h: New file.
	* rs6000-tdep.c: Include "regset.h".
	(ppc_supply_reg, ppc_collect_reg, ppc_supply_gregset)
	(ppc_supply_fpregset, ppc_collect_gregset, ppc_collect_fpregset):
	New functions.
	* Makefile.in (ALLDEPFILES): Add pccobsd-nat.c and ppcobsd-tdep.c.
	(ppcobsd-nat.o, ppcobsd-tdep.o): New dependencies.
	(rs6000-tdep.o): Update dependencies.
	* configure.host: Add powerpc-*-openbsd.
	* configure.tgt: Add powerpc-*-openbsd.
	* config/powerpc/obsd.mh: New file.
	* config/powerpc/nm-obsd.h: New file.
	* config/powerpc/obsd.mt: New file.

Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.143
diff -u -p -r1.143 NEWS
--- NEWS 15 Apr 2004 15:10:01 -0000 1.143
+++ NEWS 22 Apr 2004 21:10:38 -0000
@@ -5,6 +5,7 @@
 
 * New native configurations
 
+OpenBSD/powerpc					powerpc-*-openbsd*
 NetBSD/vax					vax-*-netbsd*
 OpenBSD/vax					vax-*-openbsd*
 
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.192
diff -u -p -r1.192 rs6000-tdep.c
--- rs6000-tdep.c 21 Apr 2004 16:38:07 -0000 1.192
+++ rs6000-tdep.c 22 Apr 2004 21:10:38 -0000
@@ -31,6 +31,7 @@
 #include "objfiles.h"
 #include "arch-utils.h"
 #include "regcache.h"
+#include "regset.h"
 #include "doublest.h"
 #include "value.h"
 #include "parser-defs.h"
@@ -150,6 +151,166 @@ ppc_floating_point_unit_p (struct gdbarc
     return 1;
   return 0;
 }
+
+
+/* Register set support functions.  */
+
+static void
+ppc_supply_reg (struct regcache *regcache, int regnum, 
+		const char *regs, size_t offset)
+{
+  if (regnum != -1 && offset != -1)
+    regcache_raw_supply (regcache, regnum, regs + offset);
+}
+
+static void
+ppc_collect_reg (const struct regcache *regcache, int regnum,
+		 char *regs, size_t offset)
+{
+  if (regnum != -1 && offset != -1)
+    regcache_raw_collect (regcache, regnum, regs + offset);
+}
+    
+/* Supply register REGNUM in the general-purpose register set REGSET
+   from the buffer specified by GREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+void
+ppc_supply_gregset (const struct regset *regset, struct regcache *regcache,
+		    int regnum, const void *gregs, size_t len)
+{
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  const struct ppc_reg_offsets *offsets = regset->descr;
+  size_t offset;
+  int i;
+
+  for (i = 0, offset = offsets->r0_offset; i < 32; i++, offset += 4)
+    {
+      if (regnum == -1 || regnum == i)
+	ppc_supply_reg (regcache, i, gregs, offset);
+    }
+
+  if (regnum == -1 || regnum == PC_REGNUM)
+    ppc_supply_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset);
+  if (regnum == -1 || regnum == tdep->ppc_ps_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_ps_regnum,
+		    gregs, offsets->ps_offset);
+  if (regnum == -1 || regnum == tdep->ppc_cr_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_cr_regnum,
+		    gregs, offsets->cr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_lr_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_lr_regnum,
+		    gregs, offsets->lr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_ctr_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_ctr_regnum,
+		    gregs, offsets->ctr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_xer_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_xer_regnum,
+		    gregs, offsets->cr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_mq_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_mq_regnum, gregs, offsets->mq_offset);
+}
+
+/* Supply register REGNUM in the floating-point register set REGSET
+   from the buffer specified by FPREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+void
+ppc_supply_fpregset (const struct regset *regset, struct regcache *regcache,
+		     int regnum, const void *fpregs, size_t len)
+{
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  const struct ppc_reg_offsets *offsets = regset->descr;
+  size_t offset;
+  int i;
+
+  offset = offsets->f0_offset;
+  for (i = FP0_REGNUM; i < FP0_REGNUM + 32; i++, offset += 4)
+    {
+      if (regnum == -1 || regnum == i)
+	ppc_supply_reg (regcache, i, fpregs, offset);
+    }
+
+  if (regnum == -1 || regnum == tdep->ppc_fpscr_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_fpscr_regnum,
+		    fpregs, offsets->fpscr_offset);
+}
+
+/* Collect register REGNUM in the general-purpose register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   GREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+void
+ppc_collect_gregset (const struct regset *regset,
+		     const struct regcache *regcache,
+		     int regnum, void *gregs, size_t len)
+{
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  const struct ppc_reg_offsets *offsets = regset->descr;
+  size_t offset;
+  int i;
+
+  offset = offsets->r0_offset;
+  for (i = 0; i <= 32; i++, offset += 4)
+    {
+      if (regnum == -1 || regnum == i)
+	ppc_collect_reg (regcache, regnum, gregs, offset);
+    }
+
+  if (regnum == -1 || regnum == PC_REGNUM)
+    ppc_collect_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset);
+  if (regnum == -1 || regnum == tdep->ppc_ps_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_ps_regnum,
+		     gregs, offsets->ps_offset);
+  if (regnum == -1 || regnum == tdep->ppc_cr_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_cr_regnum,
+		     gregs, offsets->cr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_lr_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_lr_regnum,
+		     gregs, offsets->lr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_ctr_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_ctr_regnum,
+		     gregs, offsets->ctr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_xer_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_xer_regnum,
+		     gregs, offsets->xer_offset);
+  if (regnum == -1 || regnum == tdep->ppc_mq_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_mq_regnum,
+		     gregs, offsets->mq_offset);
+}
+
+/* Collect register REGNUM in the floating-point register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   FPREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+void
+ppc_collect_fpregset (const struct regset *regset,
+		      const struct regcache *regcache,
+		      int regnum, void *fpregs, size_t len)
+{
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  const struct ppc_reg_offsets *offsets = regset->descr;
+  size_t offset;
+  int i;
+
+  offset = offsets->f0_offset;
+  for (i = FP0_REGNUM; i <= FP0_REGNUM + 32; i++, offset += 4)
+    {
+      if (regnum == -1 || regnum == i)
+	ppc_collect_reg (regcache, regnum, fpregs, offset);
+    }
+
+  if (regnum == -1 || regnum == tdep->ppc_fpscr_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_fpscr_regnum,
+		     fpregs, offsets->fpscr_offset);
+}
+
 
 /* Read a LEN-byte address from debugged memory address MEMADDR. */
 
Index: ppc-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/ppc-tdep.h,v
retrieving revision 1.27
diff -u -p -r1.27 ppc-tdep.h
--- ppc-tdep.h 20 Mar 2004 04:58:12 -0000 1.27
+++ ppc-tdep.h 22 Apr 2004 21:10:38 -0000
@@ -74,10 +74,67 @@ enum return_value_convention ppc64_sysv_
 /* From rs6000-tdep.c... */
 int altivec_register_p (int regno);
 
-
 /* Return non-zero when the architecture has an FPU (or at least when
    the ABI is using the FPU).  */
 int ppc_floating_point_unit_p (struct gdbarch *gdbarch);
+
+/* Register set description.  */
+
+struct ppc_reg_offsets
+{
+  /* General-purpose registers.  */
+  int r0_offset;
+  int pc_offset;
+  int ps_offset;
+  int cr_offset;
+  int lr_offset;
+  int ctr_offset;
+  int xer_offset;
+  int mq_offset;
+
+  /* Floating-point registers.  */
+  int f0_offset;
+  int fpscr_offset;
+
+  /* AltiVec registers.  */
+  int vr0_offset;
+  int vscr_offset;
+  int vrsave_offset;
+};
+
+/* Supply register REGNUM in the general-purpose register set REGSET
+   from the buffer specified by GREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+extern void ppc_supply_gregset (const struct regset *regset,
+				struct regcache *regcache,
+				int regnum, const void *gregs, size_t len);
+
+/* Supply register REGNUM in the floating-point register set REGSET
+   from the buffer specified by FPREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+extern void ppc_supply_fpregset (const struct regset *regset,
+				 struct regcache *regcache,
+				 int regnum, const void *fpregs, size_t len);
+
+/* Collect register REGNUM in the general-purpose register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   GREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+extern void ppc_collect_gregset (const struct regset *regset,
+				 const struct regcache *regcache,
+				 int regnum, void *gregs, size_t len);
+
+/* Collect register REGNUM in the floating-point register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   FPREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+extern void ppc_collect_fpregset (const struct regset *regset,
+				  const struct regcache *regcache,
+				  int regnum, void *fpregs, size_t len);
 
 /* Private data that this module attaches to struct gdbarch. */
 
Index: ppcobsd-nat.c
===================================================================
RCS file: ppcobsd-nat.c
diff -N ppcobsd-nat.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ppcobsd-nat.c 22 Apr 2004 21:10:39 -0000
@@ -0,0 +1,97 @@
+/* Native-dependent code for OpenBSD/powerpc.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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.  */
+
+#include "defs.h"
+#include "inferior.h"
+#include "regcache.h"
+
+#include <stddef.h>
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+
+#include "ppcobsd-tdep.h"
+
+/* OpenBSD/powerpc doesn't have PT_GETFPREGS/PT_SETFPREGS like
+   NetBSD/powerpc and FreeBSD/powerpc.  */
+
+/* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
+   for all registers.  */
+
+void
+fetch_inferior_registers (int regnum)
+{
+  struct reg regs;
+
+  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't get registers");
+
+  ppcobsd_supply_gregset (&ppcobsd_gregset, current_regcache, -1,
+			  &regs, sizeof regs);
+}
+
+/* Store register REGNUM back into the inferior.  If REGNUM is -1, do
+   this for all registers.  */
+
+void
+store_inferior_registers (int regnum)
+{
+  struct reg regs;
+
+  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't get registers");
+
+  ppcobsd_collect_gregset (&ppcobsd_gregset, current_regcache,
+			   regnum, &regs, sizeof regs);
+
+  if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't write registers");
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_ppcobsd_nat (void);
+
+void
+_initialize_ppcobsd_nat (void)
+{
+  /* General-purpose registers.  */
+  ppcobsd_reg_offsets.r0_offset = offsetof (struct reg, gpr);
+  ppcobsd_reg_offsets.pc_offset = offsetof (struct reg, pc);
+  ppcobsd_reg_offsets.ps_offset = offsetof (struct reg, ps);
+  ppcobsd_reg_offsets.cr_offset = offsetof (struct reg, cnd);
+  ppcobsd_reg_offsets.lr_offset = offsetof (struct reg, lr);
+  ppcobsd_reg_offsets.ctr_offset = offsetof (struct reg, cnt);
+  ppcobsd_reg_offsets.xer_offset = offsetof (struct reg, xer);
+  ppcobsd_reg_offsets.mq_offset = offsetof (struct reg, mq);
+
+  /* Floating-point registers.  */
+  ppcobsd_reg_offsets.f0_offset = offsetof (struct reg, fpr);
+  ppcobsd_reg_offsets.fpscr_offset = -1;
+
+  /* AltiVec registers.  */
+  ppcobsd_reg_offsets.vr0_offset = offsetof (struct vreg, vreg);
+  ppcobsd_reg_offsets.vscr_offset = offsetof (struct vreg, vscr);
+  ppcobsd_reg_offsets.vrsave_offset = offsetof (struct vreg, vrsave);
+}
Index: ppcobsd-tdep.c
===================================================================
RCS file: ppcobsd-tdep.c
diff -N ppcobsd-tdep.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ppcobsd-tdep.c 22 Apr 2004 21:10:39 -0000
@@ -0,0 +1,153 @@
+/* Target-dependent code for OpenBSD/powerpc.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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.  */
+
+#include "defs.h"
+#include "arch-utils.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
+
+#include "gdb_string.h"
+
+#include "ppc-tdep.h"
+#include "ppcobsd-tdep.h"
+#include "solib-svr4.h"
+
+/* Register offsets from <machine/reg.h>.  */
+struct ppc_reg_offsets ppcobsd_reg_offsets;
+
+
+/* Core file support.  */
+
+/* Supply register REGNUM in the general-purpose register set REGSET
+   from the buffer specified by GREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+void
+ppcobsd_supply_gregset (const struct regset *regset,
+			struct regcache *regcache, int regnum,
+			const void *gregs, size_t len)
+{
+  ppc_supply_gregset (regset, regcache, regnum, gregs, len);
+  ppc_supply_fpregset (regset, regcache, regnum, gregs, len);
+}
+
+/* Collect register REGNUM in the general-purpose register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   GREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+void
+ppcobsd_collect_gregset (const struct regset *regset,
+			 const struct regcache *regcache, int regnum,
+			 void *gregs, size_t len)
+{
+  ppc_collect_gregset (regset, regcache, regnum, gregs, len);
+  ppc_collect_fpregset (regset, regcache, regnum, gregs, len);
+}
+
+/* OpenBS/powerpc register set.  */
+
+struct regset ppcobsd_gregset =
+{
+  &ppcobsd_reg_offsets,
+  ppcobsd_supply_gregset
+};
+
+/* Return the appropriate register set for the core section identified
+   by SECT_NAME and SECT_SIZE.  */
+
+static const struct regset *
+ppcobsd_regset_from_core_section (struct gdbarch *gdbarch,
+				  const char *sect_name, size_t sect_size)
+{
+  if (strcmp (sect_name, ".reg") == 0 && sect_size >= 412)
+    return &ppcobsd_gregset;
+
+  return NULL;
+}
+
+
+static void
+ppcobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  /* OpenBSD uses SVR4-style shared libraries.  */
+  set_gdbarch_in_solib_call_trampoline
+    (gdbarch, generic_in_solib_call_trampoline);
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+
+  set_gdbarch_regset_from_core_section
+    (gdbarch, ppcobsd_regset_from_core_section);
+}
+
+
+/* OpenBSD uses uses the traditional NetBSD core file format, even for
+   ports that use ELF.  */
+#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF
+
+static enum gdb_osabi
+ppcobsd_core_osabi_sniffer (bfd *abfd)
+{
+  if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
+    return GDB_OSABI_NETBSD_CORE;
+
+  return GDB_OSABI_UNKNOWN;
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_ppcobsd_tdep (void);
+
+void
+_initialize_ppcobsd_tdep (void)
+{
+  /* BFD doesn't set a flavour for NetBSD style a.out core files.  */
+  gdbarch_register_osabi_sniffer (bfd_arch_powerpc, bfd_target_unknown_flavour,
+                                  ppcobsd_core_osabi_sniffer);
+
+  gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_OPENBSD_ELF,
+			  ppcobsd_init_abi);
+
+  /* Avoid initializing the register offsets again if they were
+     already initailized by ppcobsd-nat.c.  */
+  if (ppcobsd_reg_offsets.pc_offset == 0)
+    {
+      /* General-purpose registers.  */
+      ppcobsd_reg_offsets.r0_offset = 0;
+      ppcobsd_reg_offsets.pc_offset = 384;
+      ppcobsd_reg_offsets.ps_offset = 388;
+      ppcobsd_reg_offsets.cr_offset = 392;
+      ppcobsd_reg_offsets.lr_offset = 396;
+      ppcobsd_reg_offsets.ctr_offset = 400;
+      ppcobsd_reg_offsets.xer_offset = 404;
+      ppcobsd_reg_offsets.mq_offset = 408;
+
+      /* Floating-point registers.  */
+      ppcobsd_reg_offsets.f0_offset = 128;
+      ppcobsd_reg_offsets.fpscr_offset = -1;
+
+      /* AltiVec registers.  */
+      ppcobsd_reg_offsets.vr0_offset = 0;
+      ppcobsd_reg_offsets.vscr_offset = 512;
+      ppcobsd_reg_offsets.vrsave_offset = 520;
+    }
+}
Index: ppcobsd-tdep.h
===================================================================
RCS file: ppcobsd-tdep.h
diff -N ppcobsd-tdep.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ppcobsd-tdep.h 22 Apr 2004 21:10:39 -0000
@@ -0,0 +1,54 @@
+/* Target-dependent code for OpenBSD/powerpc.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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.  */
+
+#ifndef PPCOBSD_TDEP_H
+#define PPCOBSD_TDEP_H
+
+#include <stddef.h>
+
+struct regset;
+struct regcache;
+
+/* Register offsets for OpenBSD/powerpc.  */
+extern struct ppc_reg_offsets ppcobsd_reg_offsets;
+
+/* Register sets for OpenBSD/powerpc.  */
+extern struct regset ppcobsd_gregset;
+
+
+/* Supply register REGNUM in the general-purpose register set REGSET
+   from the buffer specified by GREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+extern void ppcobsd_supply_gregset (const struct regset *regset,
+				    struct regcache *regcache, int regnum,
+				    const void *gregs, size_t len);
+
+/* Collect register REGNUM in the general-purpose register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   GREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+extern void ppcobsd_collect_gregset (const struct regset *regset,
+				     const struct regcache *regcache,
+				     int regnum, void *gregs, size_t len);
+
+#endif /* ppcobsd-tdep.h */
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.547
diff -u -p -r1.547 Makefile.in
--- Makefile.in 21 Apr 2004 23:27:02 -0000 1.547
+++ Makefile.in 22 Apr 2004 21:10:39 -0000
@@ -1352,6 +1352,7 @@ ALLDEPFILES = \
 	somread.c somsolib.c $(HPREAD_SOURCE) \
 	ppc-sysv-tdep.c ppc-linux-nat.c ppc-linux-tdep.c \
 	ppcnbsd-nat.c ppcnbsd-tdep.c \
+	ppcobsd-nat.c ppcobsd-tdep.c \
 	procfs.c \
 	remote-e7000.c \
 	remote-hms.c remote-m32r-sdi.c remote-mips.c \
@@ -2157,6 +2158,11 @@ ppcnbsd-nat.o: ppcnbsd-nat.c $(defs_h) $
 ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
 	$(target_h) $(breakpoint_h) $(value_h) $(osabi_h) $(ppc_tdep_h) \
 	$(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h)
+ppcobsd-nat.o: ppcobsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+	$(ppcobsd_tdep_h)
+ppcobsd-tdep.o: ppcobsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \
+	$(regcache_h) $(regset_h) $(gdb_string_h) $(ppc_tdep_h) \
+	$(ppcobsd_tdep_h) $(solib_svr4_h)
 ppc-sysv-tdep.o: ppc-sysv-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
 	$(regcache_h) $(value_h) $(gdb_string_h) $(gdb_assert_h) \
 	$(ppc_tdep_h) $(target_h) $(objfiles_h)
@@ -2254,11 +2260,11 @@ rs6000-nat.o: rs6000-nat.c $(defs_h) $(i
 	$(ppc_tdep_h) $(exec_h) $(gdb_stat_h)
 rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \
 	$(target_h) $(gdbcore_h) $(gdbcmd_h) $(objfiles_h) $(arch_utils_h) \
-	$(regcache_h) $(doublest_h) $(value_h) $(parser_defs_h) $(osabi_h) \
-	$(libbfd_h) $(coff_internal_h) $(libcoff_h) $(coff_xcoff_h) \
-	$(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) $(ppc_tdep_h) \
-	$(gdb_assert_h) $(dis_asm_h) $(trad_frame_h) $(frame_unwind_h) \
-	$(frame_base_h)
+	$(regcache_h) $(regset_g) $(doublest_h) $(value_h) $(parser_defs_h) \
+	$(osabi_h) $(libbfd_h) $(coff_internal_h) $(libcoff_h) \
+	$(coff_xcoff_h) $(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) \
+	$(ppc_tdep_h) $(gdb_assert_h) $(dis_asm_h) $(trad_frame_h) \
+	$(frame_unwind_h) $(frame_base_h)
 s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) $(inferior_h) \
 	$(s390_tdep_h)
 s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
Index: configure.host
===================================================================
RCS file: /cvs/src/src/gdb/configure.host,v
retrieving revision 1.74
diff -u -p -r1.74 configure.host
--- configure.host 15 Apr 2004 15:10:01 -0000 1.74
+++ configure.host 22 Apr 2004 21:10:39 -0000
@@ -98,6 +98,7 @@ powerpc-*-aix4.3.[0-1]*)	gdb_host=aix ;;
 powerpc-*-aix*)		gdb_host=aix432 ;;
 powerpc-*-linux*)	gdb_host=linux ;;
 powerpc-*-netbsd*)	gdb_host=nbsd ;;
+powerpc-*-openbsd*)	gdb_host=obsd ;;
 
 powerpc64-*-linux*)     gdb_host=ppc64-linux ;;
 
Index: configure.tgt
===================================================================
RCS file: /cvs/src/src/gdb/configure.tgt,v
retrieving revision 1.138
diff -u -p -r1.138 configure.tgt
--- configure.tgt 14 Apr 2004 18:02:44 -0000 1.138
+++ configure.tgt 22 Apr 2004 21:10:39 -0000
@@ -134,6 +134,7 @@ mn10300-*-*)		gdb_target=mn10300 ;;
 ns32k-*-netbsd*)	gdb_target=nbsdaout ;;
 
 powerpc-*-netbsd*)	gdb_target=nbsd ;;
+powerpc-*-openbsd*)	gdb_target=obsd ;;
 powerpc-*-aix*)		gdb_target=aix ;;
 powerpc-*-linux*)	gdb_target=linux
 			build_gdbserver=yes
Index: config/powerpc/nm-obsd.h
===================================================================
RCS file: config/powerpc/nm-obsd.h
diff -N config/powerpc/nm-obsd.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ config/powerpc/nm-obsd.h 22 Apr 2004 21:10:39 -0000
@@ -0,0 +1,28 @@
+/* Native-dependent definitions for OpenBSD/powerpc.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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.  */
+
+#ifndef NM_OBSD_H
+#define NM_OBSD_H
+
+/* Get generic BSD native definitions.  */
+#include "config/nm-bsd.h"
+
+#endif /* nm-obsd.h */
Index: config/powerpc/obsd.mh
===================================================================
RCS file: config/powerpc/obsd.mh
diff -N config/powerpc/obsd.mh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ config/powerpc/obsd.mh 22 Apr 2004 21:10:39 -0000
@@ -0,0 +1,3 @@
+# Host: OpenBSD/powerpc
+NATDEPFILES= ppcobsd-nat.o fork-child.o infptrace.o inftarg.o
+NAT_FILE= nm-obsd.h
Index: config/powerpc/obsd.mt
===================================================================
RCS file: config/powerpc/obsd.mt
diff -N config/powerpc/obsd.mt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ config/powerpc/obsd.mt 22 Apr 2004 21:10:39 -0000
@@ -0,0 +1,4 @@
+# Target: OpenBSD/powerpc
+TDEPFILES= rs6000-tdep.o ppc-sysv-tdep.o ppcobsd-tdep.o \
+	corelow.o solib.o solib-svr4.o
+TM_FILE= tm-nbsd.h


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]