From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28543 invoked by alias); 26 Feb 2014 11:12:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 28529 invoked by uid 89); 26 Feb 2014 11:12:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Feb 2014 11:12:28 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1QBCQDI004533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 26 Feb 2014 06:12:26 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s1QBCMXI009375; Wed, 26 Feb 2014 06:12:23 -0500 Message-ID: <530DCC16.7030406@redhat.com> Date: Wed, 26 Feb 2014 11:12:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Phil Muldoon CC: gdb-patches@sourceware.org Subject: Re: [patch][python] PR python/16324 (frame_id_eq check invalid) References: <530DAA99.6090209@redhat.com> In-Reply-To: <530DAA99.6090209@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-02/txt/msg00773.txt.bz2 On 02/26/2014 08:49 AM, Phil Muldoon wrote: > + > + /* If prev_frame != NULL, and get_frame_id cannot return > + the frame_id, there is nothing more to be done. At > + this point, assert that a valid frame id is > + returned. */ A nit (sorry!) - I find this "there is nothing more to be done" in the comment a little bit confusing/distracting. That reads to me like a comment we'd write when doing a regular early return, because whatever the function was supposed to had already been done. You had a good rationale in the intro. I'd suggest basing on it, saying this instead: /* All frames other than the sentinel (which PREV_FRAME can't be, as we are traversing the opposite direction) must have a valid id. If we get back a null_frame_id with prev_frame != NULL, something is messed up. */ > + gdb_assert (frame_id_p (frame_id) != 0); Please write: gdb_assert (frame_id_p (frame_id)); The '_p' suffix stands for predicate, indicating the function returns a boolean, and for those, we use 'if (foo())' / 'if (!foo())'. OK with that change. Thanks, -- Pedro Alves