/* 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)
}
}
-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.
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. */
}
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);
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--;
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);