From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5028 invoked by alias); 27 Nov 2002 18:43:19 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5021 invoked from network); 27 Nov 2002 18:43:18 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 27 Nov 2002 18:43:18 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id E1B4C3F30; Wed, 27 Nov 2002 13:43:13 -0500 (EST) Message-ID: <3DE51241.9040104@redhat.com> Date: Wed, 27 Nov 2002 10:43:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Richard.Earnshaw@arm.com, Kris Warkentin Cc: gdb-patches@sources.redhat.com Subject: [rfa?] Add frame_align(); Was: ARM stack alignment on hand called functions References: <200211270917.gAR9HNE29771@pc960.cambridge.arm.com> Content-Type: multipart/mixed; boundary="------------030803040908090203020908" X-SW-Source: 2002-11/txt/msg00685.txt.bz2 This is a multi-part message in MIME format. --------------030803040908090203020908 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 177 [mailing list changed] The attached implements the theory. Doesn't show any regressions. Then again, I don't know if it fixes the reported problem either :-/ Kris? Andrew --------------030803040908090203020908 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1076 2002-11-27 Andrew Cagney * arm-tdep.c (arm_frame_align): New function. (arm_gdbarch_init): Set frame_align. Index: arm-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/arm-tdep.c,v retrieving revision 1.78 diff -u -r1.78 arm-tdep.c --- arm-tdep.c 24 Nov 2002 18:23:37 -0000 1.78 +++ arm-tdep.c 27 Nov 2002 18:26:44 -0000 @@ -1279,6 +1279,15 @@ return sp; } +/* Ensure that the ARM's stack pointer has the correct alignment for a + new frame. */ +static CORE_ADDR +arm_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) +{ + return (addr & -16); +} + + /* Push an empty stack frame, to record the current PC, etc. */ static void @@ -2857,6 +2866,7 @@ set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_frame_init_saved_regs (gdbarch, arm_frame_init_saved_regs); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); + set_gdbarch_frame_align (gdbarch, arm_frame_align); set_gdbarch_pop_frame (gdbarch, arm_pop_frame); /* Address manipulation. */ --------------030803040908090203020908--