2002-09-25 Andrew Cagney <ac131313@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Wed, 25 Sep 2002 13:34:53 +0000 (13:34 +0000)
committerAndrew Cagney <cagney@redhat.com>
Wed, 25 Sep 2002 13:34:53 +0000 (13:34 +0000)
* rs6000-tdep.c (rs6000_frame_saved_pc): If the link register
wasn't saved, and the next innermost frame is a dummy, return the
dummy frame's link register.

gdb/ChangeLog
gdb/rs6000-tdep.c

index 7e9bf6f2822fde0b982a211d5f7b9aaaf111373f..4d02daace3b6c75b33d5f0b10b593be49f9ba63a 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-25  Andrew Cagney  <ac131313@redhat.com>
+
+       * rs6000-tdep.c (rs6000_frame_saved_pc): If the link register
+       wasn't saved, and the next innermost frame is a dummy, return the
+       dummy frame's link register.
+
 2002-09-24  Jim Blandy  <jimb@redhat.com>
 
        Fix from Paul Breed:
index 2df49e136fae00f316ffdd2bd742287041fb0ad0..a650f68ac92fcb8fc78ef80aed1c29002354e28a 100644 (file)
@@ -1527,6 +1527,16 @@ rs6000_frame_saved_pc (struct frame_info *fi)
       if (fi->next->signal_handler_caller)
        return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET,
                                 wordsize);
+      else if (PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0))
+       /* The link register wasn't saved by this frame and the next
+           (inner, newer) frame is a dummy.  Get the link register
+           value by unwinding it from that [dummy] frame.  */
+       {
+         ULONGEST lr;
+         frame_unwind_unsigned_register (get_next_frame (fi),
+                                         tdep->ppc_lr_regnum, &lr);
+         return lr;
+       }
       else
        return read_memory_addr (FRAME_CHAIN (fi) + tdep->lr_frame_offset,
                                 wordsize);