*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / hppa-hpux-tdep.c
index 7eba12344ad049bc41d6e5320f2bd3bda3d82426..ab44e954374db317ec14a40a432fd4b62ebde0a3 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for HP-UX on PA-RISC.
 
-   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "solib-som.h"
 #include "solib-pa64.h"
 #include "regset.h"
+#include "regcache.h"
 #include "exceptions.h"
 
 #include "gdb_string.h"
 
-#include <dl.h>
-#include <machine/save_state.h>
-
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
-#endif
-
 #define IS_32BIT_TARGET(_gdbarch) \
        ((gdbarch_tdep (_gdbarch))->bytes_per_address == 4)
 
@@ -548,8 +542,8 @@ hppa_hpux_skip_trampoline_code (CORE_ADDR pc)
     }
 }
 
-void
-hppa_skip_permanent_breakpoint (void)
+static void
+hppa_skip_permanent_breakpoint (struct regcache *regcache)
 {
   /* To step over a breakpoint instruction on the PA takes some
      fiddling with the instruction address queue.
@@ -565,10 +559,15 @@ hppa_skip_permanent_breakpoint (void)
      front to the back.  But what do we put in the back?  What
      instruction comes after that one?  Because of the branch delay
      slot, the next insn is always at the back + 4.  */
-  write_register (HPPA_PCOQ_HEAD_REGNUM, read_register (HPPA_PCOQ_TAIL_REGNUM));
-  write_register (HPPA_PCSQ_HEAD_REGNUM, read_register (HPPA_PCSQ_TAIL_REGNUM));
 
-  write_register (HPPA_PCOQ_TAIL_REGNUM, read_register (HPPA_PCOQ_TAIL_REGNUM) + 4);
+  ULONGEST pcoq_tail, pcsq_tail;
+  regcache_cooked_read_unsigned (regcache, HPPA_PCOQ_TAIL_REGNUM, &pcoq_tail);
+  regcache_cooked_read_unsigned (regcache, HPPA_PCSQ_TAIL_REGNUM, &pcsq_tail);
+
+  regcache_cooked_write_unsigned (regcache, HPPA_PCOQ_HEAD_REGNUM, pcoq_tail);
+  regcache_cooked_write_unsigned (regcache, HPPA_PCSQ_HEAD_REGNUM, pcsq_tail);
+
+  regcache_cooked_write_unsigned (regcache, HPPA_PCOQ_TAIL_REGNUM, pcoq_tail + 4);
   /* We can leave the tail's space the same, since there's no jump.  */
 }
 
@@ -715,7 +714,7 @@ find_stub_with_shl_get (struct minimal_symbol *function, CORE_ADDR handle)
   args[0] = value_from_longest (TYPE_FIELD_TYPE (ftype, 0), 12);
   args[1] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 1), SYMBOL_VALUE_ADDRESS (msymbol));
   args[2] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 2), endo_buff_addr);
-  args[3] = value_from_longest (TYPE_FIELD_TYPE (ftype, 3), TYPE_PROCEDURE);
+  args[3] = value_from_longest (TYPE_FIELD_TYPE (ftype, 3), 3 /* TYPE_PROCEDURE */);
   args[4] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 4), value_return_addr);
   args[5] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 5), errno_return_addr);
 
@@ -865,14 +864,14 @@ GDB will be unable to intercept exception events."),
            does the equivalent of shl_findsym()) to find the plabel.  */
 
         args_for_find_stub args;
-        static char message[] = _("Error while finding exception callback hook:\n");
 
         args.solib_handle = gdbarch_tdep (current_gdbarch)->solib_get_solib_by_pc (eh_notify_callback_addr);
         args.msym = msym;
         args.return_val = 0;
 
         recurse++;
-        catch_errors (cover_find_stub_with_shl_get, &args, message,
+        catch_errors (cover_find_stub_with_shl_get, &args,
+                     _("Error while finding exception callback hook:\n"),
                      RETURN_MASK_ALL);
         eh_notify_callback_addr = args.return_val;
         recurse--;
@@ -2037,6 +2036,8 @@ hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_read_pc (gdbarch, hppa_hpux_read_pc);
   set_gdbarch_write_pc (gdbarch, hppa_hpux_write_pc);
   set_gdbarch_unwind_pc (gdbarch, hppa_hpux_unwind_pc);
+  set_gdbarch_skip_permanent_breakpoint
+    (gdbarch, hppa_skip_permanent_breakpoint);
 
   set_gdbarch_regset_from_core_section
     (gdbarch, hppa_hpux_regset_from_core_section);
This page took 0.02497 seconds and 4 git commands to generate.