diff options
author | Jim Blandy <jimb@codesourcery.com> | 2001-12-20 08:55:31 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2001-12-20 08:55:31 +0000 |
commit | 1a889ea5ea0f3e73998937aa5396c27aed6335f0 (patch) | |
tree | ee8e39a894c411f86a628e3ff90f3bf6462c42fe /gdb | |
parent | 529765f487cef2bbe14d54fd65752d95e288d441 (diff) | |
download | gdb-1a889ea5ea0f3e73998937aa5396c27aed6335f0.zip gdb-1a889ea5ea0f3e73998937aa5396c27aed6335f0.tar.gz gdb-1a889ea5ea0f3e73998937aa5396c27aed6335f0.tar.bz2 |
* s390-tdep.c (s390_pop_frame_regular): Make sure the saved_regs
array is actually set before we try to use it.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 3 | ||||
-rw-r--r-- | gdb/s390-tdep.c | 29 |
2 files changed, 19 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 432c507..b382389 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2001-12-19 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. + * s390-tdep.c (s390_frame_saved_pc_nofix): If we get the saved PC out of the return address register, cache that in the frame's extra info, just as if we'd gotten it from the saved regs array; diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index c524657..7b4972b 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1225,20 +1225,23 @@ s390_pop_frame_regular (struct frame_info *frame) 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); - } + 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]); + /* 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 (); |