From: Martin Hunt Date: Mon, 23 Sep 1996 23:18:50 +0000 (+0000) Subject: Mon Sep 23 16:13:50 1996 Martin M. Hunt X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b70b03b0e81eee2b02ebb34b043406627cfd9a55;p=binutils-gdb.git Mon Sep 23 16:13:50 1996 Martin M. Hunt * config/d10v/tm-d10v.h (SAVED_PC_AFTER_CALL): Fixed. Now single-steps correctly. * d10v-tdep.c (d10v_pop_frame): Fixed. --- diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 464aec6bd73..7189bc1ca9e 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -36,20 +36,17 @@ void d10v_pop_frame () { struct frame_info *frame = get_current_frame (); - int fp, r13; + CORE_ADDR fp; int regnum; struct frame_saved_regs fsr; char raw_buffer[8]; - fp = (int)FRAME_FP (frame); + fp = FRAME_FP (frame); /* fill out fsr with the address of where each */ /* register was stored in the frame */ get_frame_saved_regs (frame, &fsr); - /* r13 contains the old PC. save it. */ - r13 = (int)read_register (13); - /* now update the current registers with the old values */ for (regnum = A0_REGNUM; regnum < A0_REGNUM+2 ; regnum++) { @@ -71,9 +68,9 @@ d10v_pop_frame () write_register (PSW_REGNUM, read_memory_unsigned_integer (fsr.regs[PSW_REGNUM], 2)); } - /* PC is set to r13 */ - write_register (PC_REGNUM, (LONGEST)r13); - write_register (SP_REGNUM, fp - frame->size); + write_register (PC_REGNUM, read_register(13)); + write_register (SP_REGNUM, fp + frame->size); + target_store_registers (-1); flush_cached_frames (); } @@ -301,6 +298,9 @@ d10v_frame_find_saved_regs (fi, fsr) fi->return_pc = (read_memory_unsigned_integer(fsr->regs[13],2)-1) << 2; else fi->return_pc = (read_register(13) - 1) << 2; + + if (!fsr->regs[SP_REGNUM]) + fsr->regs[SP_REGNUM] = read_register(FP_REGNUM) + fi->size; } void