Fix PR gdb/20948: --write option to GDB causes segmentation fault
[deliverable/binutils-gdb.git] / gdb / s390-tdep.c
index 77e64af58399d5bd50894b17e8f761b57f5e814b..e962824ca0471b3279d0dcc2fac82068a0f0d401 100644 (file)
@@ -492,6 +492,9 @@ s390_displaced_step_fixup (struct gdbarch *gdbarch,
       /* Recompute saved return address in R1.  */
       regcache_cooked_write_unsigned (regs, S390_R0_REGNUM + r1,
                                      amode | (from + insnlen));
+      /* Update PC iff the instruction doesn't actually branch.  */
+      if (insn[0] == op_basr && r2 == 0)
+       regcache_write_pc (regs, from + insnlen);
     }
 
   /* Handle absolute branch instructions.  */
This page took 0.030817 seconds and 4 git commands to generate.