This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[committed] Fix backtrace past _start problem on spu-elf
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 11 Jan 2007 22:10:36 +0100 (CET)
- Subject: [committed] Fix backtrace past _start problem on spu-elf
Hello,
this fixes a bug where GDB doesn't properly detect that the crt0
_start function should terminate stack backtraces. The implementation
of that function in newlib changed recently, and the prolog analyzer
didn't quite cope with the new instruction sequence ...
Tested on spu-elf, committed to mainline.
Bye,
Ulrich
ChangeLog:
* spu-tdep.c (spu_analyze_prologue): Fix erroneous backtrace
past entry function with recent newlib.
Index: gdb/spu-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/spu-tdep.c,v
retrieving revision 1.3
diff -c -p -r1.3 spu-tdep.c
*** gdb/spu-tdep.c 8 Jan 2007 20:03:49 -0000 1.3
--- gdb/spu-tdep.c 11 Jan 2007 20:04:46 -0000
*************** spu_analyze_prologue (CORE_ADDR start_pc
*** 478,488 ****
--- 478,494 ----
else if (is_ri16 (insn, op_il, &rt, &immed))
{
reg_immed[rt] = immed;
+
+ if (rt == SPU_RAW_SP_REGNUM && !found_sp)
+ found_sp = 1;
}
else if (is_ri18 (insn, op_ila, &rt, &immed))
{
reg_immed[rt] = immed & 0x3ffff;
+
+ if (rt == SPU_RAW_SP_REGNUM && !found_sp)
+ found_sp = 1;
}
/* STQD is used to save registers to the stack. */
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com