From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gdb-patches@sourceware.org
Subject: [commit] Respect "red zone" for SPU inferior calls
Date: Wed, 06 Aug 2008 18:31:00 -0000 [thread overview]
Message-ID: <200808061829.m76ITSl5032217@d12av02.megacenter.de.ibm.com> (raw)
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
next reply other threads:[~2008-08-06 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-06 18:31 Ulrich Weigand [this message]
2008-08-06 19:15 ` Mark Kettenis
2008-08-06 20:13 ` Ulrich Weigand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200808061829.m76ITSl5032217@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox