diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-02-02 20:31:43 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-02-02 20:31:43 +0000 |
commit | 5b181d62776936b5547a8d25db77b07517bfddea (patch) | |
tree | 265dd5003ea4f7e3775aa5c168eafb2687862e16 /gdb/d10v-tdep.c | |
parent | 5e0116d519c197dbd989e07c5e011e7a0dfd73c7 (diff) | |
download | gdb-5b181d62776936b5547a8d25db77b07517bfddea.zip gdb-5b181d62776936b5547a8d25db77b07517bfddea.tar.gz gdb-5b181d62776936b5547a8d25db77b07517bfddea.tar.bz2 |
2003-02-02 Andrew Cagney <ac131313@redhat.com>
* frame.c (frame_unwind_register): New function.
(frame_unwind_unsigned_register): Use.
(frame_unwind_signed_register): Use.
(frame_read_register): New function.
* frame.h (frame_unwind_register): Declare.
(frame_read_register): Declare.
* d10v-tdep.c (d10v_frame_pop): Rewrite. Use regcache_cooked_write
and frame_unwind_register instead of read_memory, write_register and
deprecated_write_register_bytes.
Diffstat (limited to 'gdb/d10v-tdep.c')
-rw-r--r-- | gdb/d10v-tdep.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 05bf475..c6b94bd 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -1552,27 +1552,24 @@ d10v_frame_pop (struct frame_info *fi, void **unwind_cache, /* now update the current registers with the old values */ for (regnum = A0_REGNUM; regnum < A0_REGNUM + NR_A_REGS; regnum++) { - if (info->saved_regs[regnum]) - { - read_memory (info->saved_regs[regnum], raw_buffer, REGISTER_RAW_SIZE (regnum)); - deprecated_write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, - REGISTER_RAW_SIZE (regnum)); - } + frame_unwind_register (fi, regnum, raw_buffer); + regcache_cooked_write (regcache, regnum, raw_buffer); } for (regnum = 0; regnum < SP_REGNUM; regnum++) { - if (info->saved_regs[regnum]) - { - write_register (regnum, read_memory_unsigned_integer (info->saved_regs[regnum], REGISTER_RAW_SIZE (regnum))); - } - } - if (info->saved_regs[PSW_REGNUM]) - { - write_register (PSW_REGNUM, read_memory_unsigned_integer (info->saved_regs[PSW_REGNUM], REGISTER_RAW_SIZE (PSW_REGNUM))); + frame_unwind_register (fi, regnum, raw_buffer); + regcache_cooked_write (regcache, regnum, raw_buffer); } + frame_unwind_register (fi, PSW_REGNUM, raw_buffer); + regcache_cooked_write (regcache, PSW_REGNUM, raw_buffer); + + frame_unwind_register (fi, LR_REGNUM, raw_buffer); + regcache_cooked_write (regcache, PC_REGNUM, raw_buffer); + + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (SP_REGNUM), + fp + info->size); + regcache_cooked_write (regcache, SP_REGNUM, raw_buffer); - write_register (PC_REGNUM, read_register (LR_REGNUM)); - write_register (SP_REGNUM, fp + info->size); target_store_registers (-1); flush_cached_frames (); } |