* dwarf2-frame.c (dwarf2_frame_cache): Handle retaddr_column
authorRichard Henderson <rth@redhat.com>
Sun, 1 Jun 2003 16:04:50 +0000 (16:04 +0000)
committerRichard Henderson <rth@redhat.com>
Sun, 1 Jun 2003 16:04:50 +0000 (16:04 +0000)
        not overlapping PC_REGNUM.

gdb/ChangeLog
gdb/dwarf2-frame.c

index db2244b86553870084ab8be4ea599a90dfb322ec..121ba17acb2f267dadb0d2c25029ea4dfc48fc2e 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-01  Richard Henderson  <rth@redhat.com>
+
+        * dwarf2-frame.c (dwarf2_frame_cache): Handle retaddr_column
+        not overlapping PC_REGNUM.
+
 2003-06-01  Richard Henderson  <rth@redhat.com>
 
         * alpha-tdep.c (alpha_push_dummy_call): Transmography from
index 7694218b9048e70fb7544b0a39511c505d95cd68..f406e64ca31c2150cd4437af8c31a285343d37f8 100644 (file)
@@ -550,9 +550,21 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
        cache->reg[regnum] = fs->regs.reg[reg];
     }
 
-  /* Stored the location of the return addess.  */
-  if (fs->retaddr_column < fs->regs.num_regs)
+  /* Store the location of the return addess.  If the return address
+     column (adjusted) is not the same as gdb's PC_REGNUM, then this
+     implies a copy from the ra column register.  */
+  if (fs->retaddr_column < fs->regs.num_regs
+      && fs->regs.reg[fs->retaddr_column].how != REG_UNSAVED)
     cache->reg[PC_REGNUM] = fs->regs.reg[fs->retaddr_column];
+  else
+    {
+      reg = DWARF2_REG_TO_REGNUM (fs->retaddr_column);
+      if (reg != PC_REGNUM)
+       {
+         cache->reg[PC_REGNUM].loc.reg = reg;
+         cache->reg[PC_REGNUM].how = REG_SAVED_REG;
+       }
+    }
 
   do_cleanups (old_chain);