(Register and Memory Data): Break sections
[deliverable/binutils-gdb.git] / gdb / ppcobsd-tdep.c
index 4b752b86b0fc234be8708a7d0fbd2ebae9569971..3e82c6f0b1947254619cc8229df5e6b8e5cad4d1 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for OpenBSD/powerpc.
 
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,9 +21,9 @@
 
 #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"
@@ -39,6 +39,7 @@
 
 /* Register offsets from <machine/reg.h>.  */
 struct ppc_reg_offsets ppcobsd_reg_offsets;
+struct ppc_reg_offsets ppcobsd_fpreg_offsets;
 \f
 
 /* Core file support.  */
@@ -102,6 +103,12 @@ struct regset ppcobsd_gregset =
   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.  */
 
@@ -204,7 +211,8 @@ ppcobsd_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
   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)
     {
@@ -219,7 +227,8 @@ ppcobsd_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
   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.  */
@@ -273,7 +282,7 @@ ppcobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   /* 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);
@@ -341,4 +350,11 @@ _initialize_ppcobsd_tdep (void)
       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;
+    }
 }
This page took 0.025159 seconds and 4 git commands to generate.