From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29488 invoked by alias); 6 Aug 2008 18:31:27 -0000 Received: (qmail 29476 invoked by uid 22791); 6 Aug 2008 18:31:25 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate5.de.ibm.com (HELO mtagate5.de.ibm.com) (195.212.29.154) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Aug 2008 18:30:41 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.8/8.13.8) with ESMTP id m76ITSWA681640 for ; Wed, 6 Aug 2008 18:29:28 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m76ITS3d2560248 for ; Wed, 6 Aug 2008 20:29:28 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m76ITSd7032222 for ; Wed, 6 Aug 2008 20:29:28 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m76ITSl5032217 for ; Wed, 6 Aug 2008 20:29:28 +0200 Message-Id: <200808061829.m76ITSl5032217@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 6 Aug 2008 20:29:28 +0200 Subject: [commit] Respect "red zone" for SPU inferior calls To: gdb-patches@sourceware.org Date: Wed, 06 Aug 2008 18:31:00 -0000 From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00130.txt.bz2 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