aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-09-17 21:18:54 +0000
committerAndrew Cagney <cagney@redhat.com>2002-09-17 21:18:54 +0000
commit20bcf01c7a5c7ef1d08eb640b4ec3135dd8dffc8 (patch)
tree2696e6b0747cf2f66ea46e146d2c02618428bdd9 /gdb
parent009a99714263b76709c28980440f34f998db7c9e (diff)
downloadgdb-20bcf01c7a5c7ef1d08eb640b4ec3135dd8dffc8.zip
gdb-20bcf01c7a5c7ef1d08eb640b4ec3135dd8dffc8.tar.gz
gdb-20bcf01c7a5c7ef1d08eb640b4ec3135dd8dffc8.tar.bz2
2002-09-17 Andrew Cagney <ac131313@redhat.com>
* arch-utils.c (legacy_virtual_frame_pointer): If FP_REGNUM is invalid, return SP_REGNUM.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/arch-utils.c15
2 files changed, 18 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b532ee1..f951d80 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 3666bd5..a056177 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -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;
}