summaryrefslogtreecommitdiff
path: root/gdb/dwarf2-frame.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-02-02 22:00:14 +0000
committerMark Kettenis <kettenis@gnu.org>2004-02-02 22:00:14 +0000
commitaa80f077c92becf324f3c07c2e2f570b603066e1 (patch)
tree90b4e02124dacadef40d17e55c3f090da00dd799 /gdb/dwarf2-frame.c
parent150ba233c648c5f129c09ea2078f47dde6e9a149 (diff)
downloadgdb-aa80f077c92becf324f3c07c2e2f570b603066e1.tar.gz
* dwarf2-frame.c (dwarf2_frame_cache): Deal with a return address
column that's "empty" or "same value" when eliminating REG_RA rules.
Diffstat (limited to 'gdb/dwarf2-frame.c')
-rw-r--r--gdb/dwarf2-frame.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 2c655d9793c..22e41071f86 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -661,14 +661,19 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
{
if (cache->reg[regnum].how == REG_RA)
{
- if (fs->retaddr_column < fs->regs.num_regs)
+ /* It seems rather bizarre to specify an "empty" column as
+ the return adress column. However, this is exactly
+ what GCC does on some targets. It turns out that GCC
+ assumes that the return address can be found in the
+ register corresponding to the return address column.
+ Incidentally, that's how should treat a return address
+ column specifying "same value" too. */
+ if (fs->retaddr_column < fs->regs.num_regs
+ && fs->regs.reg[fs->retaddr_column].how != REG_UNSPECIFIED
+ && fs->regs.reg[fs->retaddr_column].how != REG_SAME_VALUE)
cache->reg[regnum] = fs->regs.reg[fs->retaddr_column];
else
{
- /* It turns out that GCC assumes that if the return
- address column is "empty" the return address can be
- found in the register corresponding to the return
- address column. */
cache->reg[regnum].loc.reg = fs->retaddr_column;
cache->reg[regnum].how = REG_SAVED_REG;
}