diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-03-10 14:43:15 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-03-10 14:43:15 +0000 |
commit | ef840a371b64685d1d79784d36a8d100d8d0364f (patch) | |
tree | 106d5a6bd9802f731da334c49a6017c3bce0d69b | |
parent | 1f63c74a92eea00db3af00e4bbaa6b6e5a35bc14 (diff) | |
download | gdb-ef840a371b64685d1d79784d36a8d100d8d0364f.zip gdb-ef840a371b64685d1d79784d36a8d100d8d0364f.tar.gz gdb-ef840a371b64685d1d79784d36a8d100d8d0364f.tar.bz2 |
2003-03-10 Andrew Cagney <cagney@redhat.com>
* d10v-tdep.c (d10v_frame_register_unwind): Correctly unwind the
PC.
(d10v_frame_pop): Unwind the PC, and not the LR, when restoring
the PC register.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/d10v-tdep.c | 17 |
2 files changed, 21 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a1caeba..1d3a5cb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2003-03-10 Andrew Cagney <cagney@redhat.com> + + * d10v-tdep.c (d10v_frame_register_unwind): Correctly unwind the + PC. + (d10v_frame_pop): Unwind the PC, and not the LR, when restoring + the PC register. + 2003-03-08 Mark Kettenis <kettenis@gnu.org> * gdbarch.sh (save_dummy_frame_tos): Add comment. diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 5f334e6..b50cfa7 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -1557,8 +1557,19 @@ d10v_frame_register_unwind (struct frame_info *frame, int *realnump, void *bufferp) { struct d10v_unwind_cache *info = d10v_frame_unwind_cache (frame, cache); - saved_regs_unwinder (frame, info->saved_regs, regnum, optimizedp, - lvalp, addrp, realnump, bufferp); + if (regnum == PC_REGNUM) + { + /* The call instruction saves the caller's PC in LR. The + function prologue of the callee may then save the LR on the + stack. Find that possibly saved LR value and return it. */ + saved_regs_unwinder (frame, info->saved_regs, LR_REGNUM, optimizedp, + lvalp, addrp, realnump, bufferp); + } + else + { + saved_regs_unwinder (frame, info->saved_regs, regnum, optimizedp, + lvalp, addrp, realnump, bufferp); + } } @@ -1587,7 +1598,7 @@ d10v_frame_pop (struct frame_info *fi, void **unwind_cache, frame_unwind_register (fi, PSW_REGNUM, raw_buffer); regcache_cooked_write (regcache, PSW_REGNUM, raw_buffer); - frame_unwind_register (fi, LR_REGNUM, raw_buffer); + frame_unwind_register (fi, PC_REGNUM, raw_buffer); regcache_cooked_write (regcache, PC_REGNUM, raw_buffer); store_unsigned_integer (raw_buffer, |