Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit] Respect "red zone" for SPU inferior calls
@ 2008-08-06 18:31 Ulrich Weigand
  2008-08-06 19:15 ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weigand @ 2008-08-06 18:31 UTC (permalink / raw)
  To: gdb-patches

Hello,

GDB neglected to respect the ABI-defined "red zone" of 2000 bytes on the SPU,
which could cause stack corruption when calling an inferior function while
within prologue code of another function.  Fixed by the patch below.  

Tested on spu-elf with no regressions, applied to mainline.

Bye,
Ulrich


ChangeLog:

	* spu-tdep.c (spu_gdbarch_init): Call set_gdbarch_frame_red_zone_size.

Index: gdb/spu-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/spu-tdep.c,v
retrieving revision 1.31
diff -c -p -r1.31 spu-tdep.c
*** gdb/spu-tdep.c	12 Jul 2008 22:42:52 -0000	1.31
--- gdb/spu-tdep.c	6 Aug 2008 18:25:35 -0000
*************** spu_gdbarch_init (struct gdbarch_info in
*** 2043,2048 ****
--- 2043,2049 ----
    /* Inferior function calls.  */
    set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
    set_gdbarch_frame_align (gdbarch, spu_frame_align);
+   set_gdbarch_frame_red_zone_size (gdbarch, 2000);
    set_gdbarch_push_dummy_call (gdbarch, spu_push_dummy_call);
    set_gdbarch_dummy_id (gdbarch, spu_dummy_id);
    set_gdbarch_return_value (gdbarch, spu_return_value);
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-06 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-06 18:31 [commit] Respect "red zone" for SPU inferior calls Ulrich Weigand
2008-08-06 19:15 ` Mark Kettenis
2008-08-06 20:13   ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox