From patchwork Tue Oct 23 13:03:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Muench X-Patchwork-Id: 29851 Received: (qmail 67946 invoked by alias); 23 Oct 2018 13:03:48 -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 67925 invoked by uid 89); 23 Oct 2018 13:03:47 -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; Tue, 23 Oct 2018 13:03:42 +0000 Received: from waha.eurecom.fr (HELO smtps.eurecom.fr) ([10.3.2.236]) by drago1i.eurecom.fr with ESMTP; 23 Oct 2018 15:03:39 +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 6595582A for ; Tue, 23 Oct 2018 15:03:39 +0200 (CEST) From: Marius Muench Subject: [PATCH] ARM: Do not use FP reg when on AAPCS Openpgp: preference=signencrypt To: gdb-patches@sourceware.org Message-ID: Date: Tue, 23 Oct 2018 15:03:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 Hi all, GDB tries to dereference the frame pointer in arm_scan_prologue as a last resort to create frame information. However, the more recent AAPCS ABI does not make use of a frame pointer. This patch checks whether the specified arm_abi is AAPCS before dereferencing the "frame pointer". If so, just return as efforts to use it for restoring frame information won't work. Cheers, Marius gdb/ChangeLog 2018-10-23 Marius Muench * arm-tdeb.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..859ce71d6a 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))