[commit/mips] Terminate MIPS backtraces
Daniel Jacobowitz
drow@false.org
Fri Nov 13 22:50:00 GMT 2009
The MIPS prologue analyzer did not check for frame pointer == 0, which
marks the end of the stack frame. So we constructed frame IDs with
stack_addr == 0 and claimed they were valid, which they aren't.
Tested on mips-sde-elf. Checked in.
2009-11-13 Maciej W. Rozycki <macro@codesourcery.com>
* mips-tdep.c (mips_insn16_frame_this_id): Mark the outermost
frame.
(mips_insn32_frame_this_id): Likewise.
---
gdb/mips-tdep.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: gdb/mips-tdep.c
===================================================================
--- gdb/mips-tdep.c.orig 2009-10-20 00:17:12.000000000 -0700
+++ gdb/mips-tdep.c 2009-11-13 09:26:20.000000000 -0800
@@ -1814,6 +1814,9 @@ mips_insn16_frame_this_id (struct frame_
{
struct mips_frame_cache *info = mips_insn16_frame_cache (this_frame,
this_cache);
+ /* This marks the outermost frame. */
+ if (info->base == 0)
+ return;
(*this_id) = frame_id_build (info->base, get_frame_func (this_frame));
}
@@ -2163,6 +2166,9 @@ mips_insn32_frame_this_id (struct frame_
{
struct mips_frame_cache *info = mips_insn32_frame_cache (this_frame,
this_cache);
+ /* This marks the outermost frame. */
+ if (info->base == 0)
+ return;
(*this_id) = frame_id_build (info->base, get_frame_func (this_frame));
}
--
Daniel Jacobowitz
CodeSourcery
More information about the Gdb-patches
mailing list