From 6d350bb576b5a3495c99f1f6e6bc5e199851d36e Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Mon, 7 May 2007 18:20:21 +0000 Subject: * gdbarch.sh: Add skip_permanent_breakpoint callback. * gdbarch.h, gdbarch.c: Regenerate. * infrun.c (SKIP_PERMANENT_BREAKPOINT): Remove default definition. (resume): Call gdbarch_skip_permanent_breakpoint instead of SKIP_PERMANENT_BREAKPOINT. Inline default case. * hppa-hpux-tdep.c (hppa_skip_permanent_breakpoint): Make static. Add REGCACHE argument. Use it instead of read/write_register. (hppa_hpux_init_abi): Install hppa_skip_permanent_breakpoint. * config/pa/tm-hppah.h: Delete file. * config/pa/hppa64.mt (DEPRECATED_TM_FILE): Set to tm-hppa.h. * config/pa/hppahpux.mt (DEPRECATED_TM_FILE): Likewise. --- gdb/hppa-hpux-tdep.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gdb/hppa-hpux-tdep.c') diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c index b5a9bd6..ea4319e 100644 --- a/gdb/hppa-hpux-tdep.c +++ b/gdb/hppa-hpux-tdep.c @@ -548,8 +548,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 +565,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. */ } @@ -2037,6 +2042,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); -- cgit v1.1