From patchwork Sun Nov 30 15:41:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 4014 Received: (qmail 18796 invoked by alias); 30 Nov 2014 15:41:19 -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 18786 invoked by uid 89); 30 Nov 2014 15:41:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 30 Nov 2014 15:41:17 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 47D0C1164CD; Sun, 30 Nov 2014 10:41:15 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lOKr6AJxUcCt; Sun, 30 Nov 2014 10:41:15 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id CE4041164B6; Sun, 30 Nov 2014 10:41:14 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id E181140EAE; Sun, 30 Nov 2014 19:41:10 +0400 (RET) Date: Sun, 30 Nov 2014 19:41:10 +0400 From: Joel Brobecker To: Martin Galvan Cc: gdb-patches@sourceware.org, daniel.gutson@tallertechnologies.com Subject: Re: [PATCH] frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq(). Message-ID: <20141130154110.GE4882@adacore.com> References: <1416944088-8750-1-git-send-email-martin.galvan@tallertechnologies.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1416944088-8750-1-git-send-email-martin.galvan@tallertechnologies.com> User-Agent: Mutt/1.5.21 (2010-09-15) On Tue, Nov 25, 2014 at 04:34:48PM -0300, Martin Galvan wrote: > I noticed in frame_id_eq() we were checking for the "l" frame_id being invalid twice instead of checking both "l" and "r", so I corrected it. > > gdb/ChangeLog: > > 2014-11-25 Martin Galvan > > * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID. Thank you for the patch. It does indeed look pretty obvious. You're patch did not apply for some reason, but since it was so simple, I just redid it, bearing in mind Sergio's comments. I then re-ran the testsuite on x86_64-linux to make sure it doesn't cause any regression. Attached is what I ended pushing (as both obvious and under 'tiny patch' rule, meaning that you don't need a copyright assignment for this change). If you are interested in contributing more patches to GDB, you'll need a copyright assignement in place with the FSF. Let us know and we will get you started; the process can be somewhat lengthy. From 0bba2ddfa79b718e4bab94f2827165bd5b55c92c Mon Sep 17 00:00:00 2001 From: Martin Galvan Date: Sun, 30 Nov 2014 19:34:15 +0400 Subject: [PATCH] frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq() I noticed in frame_id_eq() we were checking for the "l" frame_id being invalid twice instead of checking both "l" and "r", so this patch corrects it. gdb/ChangeLog: * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID. --- gdb/ChangeLog | 5 +++++ gdb/frame.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4112438..f706f29 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-11-30 Martin Galvan (tiny patch, obvious) + + Pushed by Joel Brobecker . + * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID. + 2014-11-29 Siva Chandra Reddy * eval.c (evaluate_subexp): Check that the thread stack temporaries diff --git a/gdb/frame.c b/gdb/frame.c index 0663af9..75ad341 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -614,7 +614,7 @@ frame_id_eq (struct frame_id l, struct frame_id r) outer_frame_id. */ eq = 1; else if (l.stack_status == FID_STACK_INVALID - || l.stack_status == FID_STACK_INVALID) + || r.stack_status == FID_STACK_INVALID) /* Like a NaN, if either ID is invalid, the result is false. Note that a frame ID is invalid iff it is the null frame ID. */ eq = 0; -- 1.9.1