/* Target-dependent code for OpenBSD/powerpc.
- Copyright 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 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 "arch-utils.h"
-#include "floatformat.h"
#include "frame.h"
#include "frame-unwind.h"
+#include "gdbtypes.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
/* Register offsets from <machine/reg.h>. */
struct ppc_reg_offsets ppcobsd_reg_offsets;
+struct ppc_reg_offsets ppcobsd_fpreg_offsets;
\f
/* Core file support. */
ppcobsd_supply_gregset
};
+struct regset ppcobsd_fpregset =
+{
+ &ppcobsd_fpreg_offsets,
+ ppc_supply_fpregset
+};
+
/* Return the appropriate register set for the core section identified
by SECT_NAME and SECT_SIZE. */
insn = extract_unsigned_integer (buf, PPC_INSN_SIZE);
sigcontext_offset = (0x10000 - (insn & 0x0000ffff)) + 8;
- base = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ base = frame_unwind_register_unsigned (next_frame,
+ gdbarch_sp_regnum (current_gdbarch));
addr = base + sigcontext_offset + 2 * tdep->wordsize;
for (i = 0; i < ppc_num_gprs; i++, addr += tdep->wordsize)
{
addr += tdep->wordsize;
trad_frame_set_reg_addr (cache, tdep->ppc_ctr_regnum, addr);
addr += tdep->wordsize;
- trad_frame_set_reg_addr (cache, PC_REGNUM, addr); /* SRR0? */
+ trad_frame_set_reg_addr (cache, gdbarch_pc_regnum (current_gdbarch), addr);
+ /* SRR0? */
addr += tdep->wordsize;
/* Construct the frame ID using the function start. */
{
/* OpenBSD doesn't support the 128-bit `long double' from the psABI. */
set_gdbarch_long_double_bit (gdbarch, 64);
- set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
+ set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
/* OpenBSD currently uses a broken GCC. */
set_gdbarch_return_value (gdbarch, ppc_sysv_abi_broken_return_value);
ppcobsd_reg_offsets.vscr_offset = 512;
ppcobsd_reg_offsets.vrsave_offset = 520;
}
+
+ if (ppcobsd_fpreg_offsets.fpscr_offset == 0)
+ {
+ /* Floating-point registers. */
+ ppcobsd_reg_offsets.f0_offset = 0;
+ ppcobsd_reg_offsets.fpscr_offset = 256;
+ }
}