From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103379 invoked by alias); 11 Jun 2016 20:49:32 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@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 20:49:00 -0000 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-SW-Source: 2016-06/txt/msg00131.txt.bz2 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; } -- 2.7.0