diff options
Diffstat (limited to 'gdb/s390-tdep.c')
-rw-r--r-- | gdb/s390-tdep.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 081a8b6..047ee08 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -482,8 +482,19 @@ static void s390_displaced_step_fixup (struct gdbarch *gdbarch, displaced_step_copy_insn_closure *closure_, CORE_ADDR from, CORE_ADDR to, - struct regcache *regs) + struct regcache *regs, bool completed_p) { + CORE_ADDR pc = regcache_read_pc (regs); + + /* If the displaced instruction didn't complete successfully then all we + need to do is restore the program counter. */ + if (!completed_p) + { + pc = from + (pc - to); + regcache_write_pc (regs, pc); + return; + } + /* Our closure is a copy of the instruction. */ s390_displaced_step_copy_insn_closure *closure = (s390_displaced_step_copy_insn_closure *) closure_; @@ -495,10 +506,8 @@ s390_displaced_step_fixup (struct gdbarch *gdbarch, unsigned int b2, r1, r2, x2, r3; int i2, d2; - /* Get current PC and addressing mode bit. */ - CORE_ADDR pc = regcache_read_pc (regs); + /* Get addressing mode bit. */ ULONGEST amode = 0; - if (register_size (gdbarch, S390_PSWA_REGNUM) == 4) { regcache_cooked_read_unsigned (regs, S390_PSWA_REGNUM, &amode); |