This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH: S/390: don't use saved_regs array unless it's set
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 20 Dec 2001 03:59:57 -0500 (EST)
- Subject: PATCH: S/390: don't use saved_regs array unless it's set
2001-12-20 Jim Blandy <jimb@redhat.com>
* s390-tdep.c (s390_pop_frame_regular): Make sure the saved_regs
array is actually set before we try to use it.
Index: gdb/s390-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/s390-tdep.c,v
retrieving revision 2.33
diff -c -r2.33 s390-tdep.c
*** gdb/s390-tdep.c 2001/12/20 03:25:51 2.33
--- gdb/s390-tdep.c 2001/12/20 07:41:37
***************
*** 1223,1242 ****
write_register (S390_PC_REGNUM, FRAME_SAVED_PC (frame));
/* Restore any saved registers. */
! for (regnum = 0; regnum < NUM_REGS; regnum++)
! if (frame->saved_regs[regnum] != 0)
! {
! ULONGEST value;
!
! value = read_memory_unsigned_integer (frame->saved_regs[regnum],
! REGISTER_RAW_SIZE (regnum));
! write_register (regnum, value);
! }
!
! /* 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 ();
--- 1225,1247 ----
write_register (S390_PC_REGNUM, FRAME_SAVED_PC (frame));
/* Restore any saved registers. */
! if (frame->saved_regs)
! {
! for (regnum = 0; regnum < NUM_REGS; regnum++)
! if (frame->saved_regs[regnum] != 0)
! {
! ULONGEST value;
!
! value = read_memory_unsigned_integer (frame->saved_regs[regnum],
! REGISTER_RAW_SIZE (regnum));
! write_register (regnum, value);
! }
!
! /* 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 ();