From patchwork Wed Oct 24 19:37:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Muench X-Patchwork-Id: 29878 Received: (qmail 124552 invoked by alias); 24 Oct 2018 19:37:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 124536 invoked by uid 89); 24 Oct 2018 19:37:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: smtp.eurecom.fr Received: from smtp.eurecom.fr (HELO smtp.eurecom.fr) (193.55.113.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 Oct 2018 19:37:11 +0000 Received: from waha.eurecom.fr (HELO smtps.eurecom.fr) ([10.3.2.236]) by drago1i.eurecom.fr with ESMTP; 24 Oct 2018 21:37:08 +0200 Received: from [192.168.0.19] (vau06-2-82-238-189-157.fbx.proxad.net [82.238.189.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtps.eurecom.fr (Postfix) with ESMTPSA id 1DAD0E13; Wed, 24 Oct 2018 21:37:09 +0200 (CEST) Subject: Re: [PATCH] ARM: Do not use FP reg when on AAPCS To: Pedro Alves , Kevin Buettner , gdb-patches@sourceware.org References: <20181023101649.23d4af8b@pinnacle.lan> <406505df-13d3-08de-ad86-fc38131eb4b9@redhat.com> From: Marius Muench Message-ID: <15364ecd-125d-7196-8e83-e6db60127005@eurecom.fr> Date: Wed, 24 Oct 2018 21:37:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <406505df-13d3-08de-ad86-fc38131eb4b9@redhat.com> On 10/24/2018 07:23 PM, Pedro Alves wrote: > Tiny nit: > > On 10/24/2018 12:40 PM, Marius Muench wrote: >> >> + /* AAPCS does not use a frame register, so we can abort here. */ > > There should be a double space after the period. > >> + if (gdbarch_tdep (gdbarch)->arm_abi == ARM_ABI_AAPCS) >> + return; > > Thanks, > Pedro Alves > Fair enough, updated version below. gdb/ChangeLog: 2018-10-24 Marius Muench * arm-tdep.c (arm_scan_prologue): Don't dereference FP reg when on AAPCS. --- gdb/arm-tdep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 53eee76926..0165e92527 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1801,6 +1801,10 @@ arm_scan_prologue (struct frame_info *this_frame, CORE_ADDR frame_loc; ULONGEST return_value; + /* AAPCS does not use a frame register, so we can abort here. */ + if (gdbarch_tdep (gdbarch)->arm_abi == ARM_ABI_AAPCS) + return; + frame_loc = get_frame_register_unsigned (this_frame, ARM_FP_REGNUM); if (!safe_read_memory_unsigned_integer (frame_loc, 4, byte_order, &return_value))