From patchwork Wed Oct 24 11:40:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Muench X-Patchwork-Id: 29867 Received: (qmail 76772 invoked by alias); 24 Oct 2018 11:40:15 -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 76759 invoked by uid 89); 24 Oct 2018 11:40:14 -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 11:40:12 +0000 Received: from waha.eurecom.fr (HELO smtps.eurecom.fr) ([10.3.2.236]) by drago1i.eurecom.fr with ESMTP; 24 Oct 2018 13:40:10 +0200 Received: from [10.0.3.38] (unknown [193.55.114.4]) (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 A1BACA21; Wed, 24 Oct 2018 13:40:10 +0200 (CEST) Subject: Re: [PATCH] ARM: Do not use FP reg when on AAPCS To: Kevin Buettner , gdb-patches@sourceware.org Cc: Marius Muench References: <20181023101649.23d4af8b@pinnacle.lan> From: Marius Muench Openpgp: preference=signencrypt Message-ID: Date: Wed, 24 Oct 2018 13:40:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20181023101649.23d4af8b@pinnacle.lan> On 10/23/18 7:16 PM, Kevin Buettner wrote: > On Tue, 23 Oct 2018 15:03:39 +0200 > Marius Muench wrote: >> gdb/ChangeLog >> 2018-10-23 Marius Muench >> >> * arm-tdeb.c (arm_scan_prologue): Don't dereference FP reg >> when on aapcs. > > Typo on filename above. (s/tdeb/tdep/) While you're changing it, > please capitalize AAPCS too. > > Otherwise, okay. > > Kevin > Good catch, sorry for that. Here's the updated patch. Thanks, Marius 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..5cff22977d 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))