aboutsummaryrefslogtreecommitdiff
path: root/gdb/sh-tdep.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1995-11-14 23:24:10 +0000
committerStu Grossman <grossman@cygnus>1995-11-14 23:24:10 +0000
commit5c8ba01776c033aafffbfa0dc972cb29a22a5113 (patch)
treea81b0a3291ff437ccc14c4e6889b60e31c4b2e10 /gdb/sh-tdep.c
parent1c1a4269dd2fc1e95de5cc070390425c8f8a3ed6 (diff)
downloadgdb-5c8ba01776c033aafffbfa0dc972cb29a22a5113.zip
gdb-5c8ba01776c033aafffbfa0dc972cb29a22a5113.tar.gz
gdb-5c8ba01776c033aafffbfa0dc972cb29a22a5113.tar.bz2
* monitor.c (monitor_load_srec monitor_make_srec): Move all
S-record download code into srec.c. * srec.c srec.h: New files. Contain S-record loading routines formerly in monitor.c. * serial.c serial.h: New routine just like fprintf, but uses serial_t instead of FILE *. * sh-tdep.c (frame_find_saved_regs init_extra_frame_info): Don't add four to saved pc (makes things match manual). Also, fix bug where we didn't get pc from stack frame correctly. * config/sh/tm-sh.h (SAVED_PC_AFTER_CALL): Don't add four to saved pc. Real hardware does this for you. * sh3-rom.c (sh3_load): New routine. Sets up for download then calls generic S-record loader. * config/h8300/h8300.mt, config/h8500/h8500.mt, config/m68k/monitor.mt, config/pa/hppapro.mt, config/sh/sh.mt: Add srec.o to TDEPFILES.
Diffstat (limited to 'gdb/sh-tdep.c')
-rw-r--r--gdb/sh-tdep.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 95a3f19..a56c826 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -213,23 +213,11 @@ frame_find_saved_regs (fi, fsr)
fi->f_offset = depth - where[FP_REGNUM] - 4;
/* Work out the return pc - either from the saved pr or the pr
value */
- /* Just called, so dig out the real return */
- if (fi->return_pc == 0)
- {
- fi->return_pc = read_register (PR_REGNUM) + 4;
- }
- else
- {
- if (fsr->regs[PR_REGNUM])
- {
- fi->return_pc = read_memory_integer (fsr->regs[PR_REGNUM], 4) + 4;
- }
- else
- {
- fi->return_pc = read_register (PR_REGNUM) + 4;
- }
- }
+ if (fsr->regs[PR_REGNUM])
+ fi->return_pc = read_memory_integer (fsr->regs[PR_REGNUM], 4);
+ else
+ fi->return_pc = read_register (PR_REGNUM);
}
/* initialize the extra info saved in a FRAME */
@@ -241,6 +229,9 @@ init_extra_frame_info (fromleaf, fi)
{
struct frame_saved_regs dummy;
+ if (fi->next)
+ fi->pc = fi->next->return_pc;
+
frame_find_saved_regs (fi, &dummy);
}