This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Respect "red zone" for SPU inferior calls


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]