Remove deprecated_throw_reason.
[deliverable/binutils-gdb.git] / gdb / hppabsd-tdep.c
index a11243365491e45c3e883f0c46758929e4912c97..9b2a219ce929c56f955e4eea351c3e6b29c0c44c 100644 (file)
@@ -1,7 +1,6 @@
 /* Target-dependent code for HP PA-RISC BSD's.
 
-   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 2004-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 
 #include "hppa-tdep.h"
 #include "hppabsd-tdep.h"
+#include "dwarf2-frame.h"
 #include "solib-svr4.h"
 
 static CORE_ADDR
 hppabsd_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
 {
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR faddr = value_as_address (function);
   struct obj_section *faddr_sec;
   gdb_byte buf[4];
@@ -41,13 +42,13 @@ hppabsd_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
   if (faddr & 2)
     {
       if (target_read_memory ((faddr & ~3) + 4, buf, sizeof buf) == 0)
-       return extract_unsigned_integer (buf, sizeof buf);
+       return extract_unsigned_integer (buf, sizeof buf, byte_order);
     }
 
   /* If the address is in the .plt section, then the real function
      hasn't yet been fixed up by the linker so we cannot determine the
      Global Pointer for that function.  */
-  if (in_plt_section (faddr, NULL))
+  if (in_plt_section (faddr))
     return 0;
 
   faddr_sec = find_pc_section (faddr);
@@ -74,7 +75,7 @@ hppabsd_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
              if (target_read_memory (addr, buf, sizeof buf) != 0)
                break;
 
-             tag = extract_signed_integer (buf, sizeof buf);
+             tag = extract_signed_integer (buf, sizeof buf, byte_order);
              if (tag == DT_PLTGOT)
                {
                  CORE_ADDR pltgot;
@@ -84,7 +85,8 @@ hppabsd_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
 
                  /* The NetBSD/OpenBSD ld.so doesn't relocate DT_PLTGOT, so
                     we have to do it ourselves.  */
-                 pltgot = extract_unsigned_integer (buf, sizeof buf);
+                 pltgot = extract_unsigned_integer (buf, sizeof buf,
+                                                    byte_order);
                  pltgot += ANOFFSET (sec->objfile->section_offsets,
                                      SECT_OFF_TEXT (sec->objfile));
 
@@ -103,6 +105,17 @@ hppabsd_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
 }
 \f
 
+static void
+hppabsd_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
+                              struct dwarf2_frame_state_reg *reg,
+                              struct frame_info *this_frame)
+{
+  if (regnum == HPPA_PCOQ_HEAD_REGNUM)
+    reg->how = DWARF2_FRAME_REG_RA;
+  else if (regnum == HPPA_SP_REGNUM)
+    reg->how = DWARF2_FRAME_REG_CFA;
+}
+
 void
 hppabsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -121,4 +134,8 @@ hppabsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   /* OpenBSD and NetBSD use SVR4-style shared libraries.  */
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+
+  /* Hook in the DWARF CFI frame unwinder.  */
+  dwarf2_frame_set_init_reg (gdbarch, hppabsd_dwarf2_frame_init_reg);
+  dwarf2_append_unwinders (gdbarch);
 }
This page took 0.025388 seconds and 4 git commands to generate.