pointer and the SP are often the same, so we can't pop the frame
by setting the SP to the FP; we need to get the old SP from
saved_regs.
2001-11-14 Jim Blandy <jimb@redhat.com>
+ * s390-tdep.c (s390_pop_frame_regular): On the S/390, the frame
+ pointer and the SP are often the same, so we can't pop the frame
+ by setting the SP to the FP; we need to get the old SP from
+ saved_regs.
+
* s390-tdep.c (s390_extract_return_value): Returned `float' values
can simply be copied bitwise from the registers into the value
object's buffer.
write_register (regnum, value);
}
- /* Actually cut back the stack. */
- write_register (S390_SP_REGNUM, FRAME_FP (frame));
+ /* Actually cut back the stack. Remember that the SP's element of
+ saved_regs is the old SP itself, not the address at which it is
+ saved. */
+ write_register (S390_SP_REGNUM, frame->saved_regs[S390_SP_REGNUM]);
/* Throw away any cached frame information. */
flush_cached_frames ();