* monitor.c (monitor_load_srec monitor_make_srec): Move all
[binutils-gdb.git] / gdb / sh-tdep.c
index e09a6dd1423ed916289bef2fd2ad8d53e9fbf162..a56c826e9fb6798c1849262d60413caad9246182 100644 (file)
@@ -15,7 +15,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /*
  Contributed by Steve Chamberlain
@@ -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);
 }