2004-03-18 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Thu, 18 Mar 2004 20:30:08 +0000 (20:30 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 18 Mar 2004 20:30:08 +0000 (20:30 +0000)
* rs6000-tdep.c (skip_prologue): Record only the first LR save.

gdb/ChangeLog
gdb/rs6000-tdep.c

index 8fd841b8d7243ff53518cd0aec296a9cb991e2cf..43ad2f89acc8afed1f6994d92502ca36a96fb169 100644 (file)
@@ -1,3 +1,7 @@
+2004-03-18  Andrew Cagney  <cagney@redhat.com>
+
+       * rs6000-tdep.c (skip_prologue): Record only the first LR save.
+
 2004-03-18  Andrew Cagney  <cagney@redhat.com>
 
        * config/mips/tm-nbsd.h: Replace IN_SIGTRAMP with
index 7c847ef18308757f41eb75626382af079d7d1800..934b5d303b3675eca522c74369a6709e8a77f99a 100644 (file)
@@ -551,9 +551,26 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
 
       if ((op & 0xfc1fffff) == 0x7c0802a6)
        {                       /* mflr Rx */
-         lr_reg = (op & 0x03e00000);
+         /* Since shared library / PIC code, which needs to get its
+            address at runtime, can appear to save more than one link
+            register vis:
+
+            *INDENT-OFF*
+            stwu r1,-304(r1)
+            mflr r3
+            bl 0xff570d0 (blrl)
+            stw r30,296(r1)
+            mflr r30
+            stw r31,300(r1)
+            stw r3,308(r1);
+            ...
+            *INDENT-ON*
+
+            remember just the first one, but skip over additional
+            ones.  */
+         if (lr_reg < 0)
+           lr_reg = (op & 0x03e00000);
          continue;
-
        }
       else if ((op & 0xfc1fffff) == 0x7c000026)
        {                       /* mfcr Rx */