From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30652 invoked by alias); 5 Sep 2008 16:19:29 -0000 Received: (qmail 11220 invoked by uid 22791); 5 Sep 2008 15:23:41 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 05 Sep 2008 15:22:55 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id m85FLaMV393060 for ; Fri, 5 Sep 2008 15:21:36 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 m85FLaau680020 for ; Fri, 5 Sep 2008 17:21:36 +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 m85FLP1V029920 for ; Fri, 5 Sep 2008 17:21:32 +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 m85FLLNf029869; Fri, 5 Sep 2008 17:21:21 +0200 Message-Id: <200809051521.m85FLLNf029869@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 5 Sep 2008 17:21:21 +0200 Subject: [commit, spu] Do not use generic_push_dummy_code To: mark.kettenis@xs4all.nl (Mark Kettenis) Date: Fri, 05 Sep 2008 16:19:00 -0000 From: "Ulrich Weigand" Cc: drow@false.org, gdb-patches@sourceware.org, pedro@codesourcery.com In-Reply-To: <200809051410.m85EAKmN020776@brahms.sibelius.xs4all.nl> from "Mark Kettenis" at Sep 05, 2008 04:10:20 PM 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-09/txt/msg00101.txt.bz2 Mark Kettenis wrote: > Now you mention it, it would be nice if we could change the SPU code > such that it doesn't use generic_push_dummy_code(). This function > abuses frame_align(), and it would be nice if we could eliminate it. > > Something like i386_dicos_push_dummy_code() is needed. I can roll you > a diff if you want, but I won't be able to test it. No problem. The following patch adds a spu_push_dummy_code function. If you want to eliminate generic_push_dummy_code now, that would certainly be fine with me ... Tested with no regressions on spu-elf. Committed to mainline. Bye, Ulrich ChangeLog: * spu-tdep.c (spu_push_dummy_code): New function. (spu_gdbarch_init): Install it. Index: gdb/spu-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/spu-tdep.c,v retrieving revision 1.39 diff -c -p -r1.39 spu-tdep.c *** gdb/spu-tdep.c 5 Sep 2008 11:37:17 -0000 1.39 --- gdb/spu-tdep.c 5 Sep 2008 15:06:47 -0000 *************** spu_frame_align (struct gdbarch *gdbarch *** 1032,1037 **** --- 1032,1053 ---- return sp & ~15; } + static CORE_ADDR + spu_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, + struct value **args, int nargs, struct type *value_type, + CORE_ADDR *real_pc, CORE_ADDR *bp_addr, + struct regcache *regcache) + { + /* Allocate space sufficient for a breakpoint, keeping the stack aligned. */ + sp = (sp - 4) & ~15; + /* Store the address of that breakpoint */ + *bp_addr = sp; + /* The call starts at the callee's entry point. */ + *real_pc = funaddr; + + return sp; + } + static int spu_scalar_value_p (struct type *type) { *************** spu_gdbarch_init (struct gdbarch_info in *** 2108,2113 **** --- 2124,2130 ---- 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_code (gdbarch, spu_push_dummy_code); 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