From patchwork Sat Jun 11 20:48:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 12987 Received: (qmail 103378 invoked by alias); 11 Jun 2016 20:49:32 -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 103306 invoked by uid 89); 11 Jun 2016 20:49:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=2.7.0 X-Spam-User: qpsmtpd, 2 recipients X-HELO: bigwig.baldwin.cx Received: from bigwig.baldwin.cx (HELO bigwig.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sat, 11 Jun 2016 20:49:30 +0000 Received: from ralph.baldwin.cx.net (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 05D47B9C3; Sat, 11 Jun 2016 16:49:26 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org, binutils@sourceware.org Subject: [PATCH 5/8] Detect a frameless frame by comparing the FP register to -1. Date: Sat, 11 Jun 2016 13:48:32 -0700 Message-Id: <1465678115-58170-6-git-send-email-jhb@FreeBSD.org> In-Reply-To: <1465678115-58170-1-git-send-email-jhb@FreeBSD.org> References: <1465678115-58170-1-git-send-email-jhb@FreeBSD.org> X-IsSubscribed: yes Since CORE_ADDR is unsigned, the saved FP register is always greater than or equal to zero. Comparing to -1 results in a direct comparison with the value used to initialize the saved FP register to an uninitialized state. --- gdb/ChangeLog | 5 +++++ gdb/sh64-tdep.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 73f42e2..243b717 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2016-06-11 John Baldwin + * sh64-tdep.c (sh64_analyze_prologue): Compare FP register against + -1 to detect missing FP. + +2016-06-11 John Baldwin + * score-tdep.c (score7_malloc_and_get_memblock): Remove check for negative size. diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index e6b1e27..f5a6504 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -971,7 +971,7 @@ sh64_analyze_prologue (struct gdbarch *gdbarch, } } - if (cache->saved_regs[MEDIA_FP_REGNUM] >= 0) + if (cache->saved_regs[MEDIA_FP_REGNUM] == -1) cache->uses_fp = 1; }