]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-09-17 Andrew Cagney <ac131313@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Tue, 17 Sep 2002 21:18:54 +0000 (21:18 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 17 Sep 2002 21:18:54 +0000 (21:18 +0000)
* arch-utils.c (legacy_virtual_frame_pointer): If FP_REGNUM is
invalid, return SP_REGNUM.

gdb/ChangeLog
gdb/arch-utils.c

index b532ee1c927bbe3f39a082de3c031b179c06fdef..f951d80c9cbb97a18081e137dfac943ee4a1513c 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-17  Andrew Cagney  <ac131313@redhat.com>
+
+       * arch-utils.c (legacy_virtual_frame_pointer): If FP_REGNUM is
+       invalid, return SP_REGNUM.
+
 2002-09-17  Michael Snyder  <msnyder@redhat.com>
 
        * mips-tdep.c (mips_pop_frame): Read saved values of floating
index 3666bd55c0673d873b4228b9c2f780799b2b1212..a056177553ea9a9fe848d49d6b2ba535b9ac5c62 100644 (file)
@@ -423,8 +423,19 @@ legacy_virtual_frame_pointer (CORE_ADDR pc,
                              int *frame_regnum,
                              LONGEST *frame_offset)
 {
-  gdb_assert (FP_REGNUM >= 0);
-  *frame_regnum = FP_REGNUM;
+  /* FIXME: cagney/2002-09-13: This code is used when identifying the
+     frame pointer of the current PC.  It is assuming that a single
+     register and an offset can determine this.  I think it should
+     instead generate a byte code expression as that would work better
+     with things like Dwarf2's CFI.  */
+  if (FP_REGNUM >= 0 && FP_REGNUM < NUM_REGS)
+    *frame_regnum = FP_REGNUM;
+  else if (SP_REGNUM >= 0 && SP_REGNUM < NUM_REGS)
+    *frame_regnum = SP_REGNUM;
+  else
+    /* Should this be an internal error?  I guess so, it is reflecting
+       an architectural limitation in the current design.  */
+    internal_error (__FILE__, __LINE__, "No virtual frame pointer available");
   *frame_offset = 0;
 }