From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37824 invoked by alias); 29 May 2015 13:11: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 37815 invoked by uid 89); 29 May 2015 13:11:29 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f52.google.com Received: from mail-pa0-f52.google.com (HELO mail-pa0-f52.google.com) (209.85.220.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 29 May 2015 13:11:28 +0000 Received: by pacrp13 with SMTP id rp13so12398599pac.2 for ; Fri, 29 May 2015 06:11:26 -0700 (PDT) X-Received: by 10.68.200.100 with SMTP id jr4mr14651387pbc.168.1432905086193; Fri, 29 May 2015 06:11:26 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id qz7sm5622464pbc.11.2015.05.29.06.11.23 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 29 May 2015 06:11:25 -0700 (PDT) From: Yao Qi To: Doug Evans Cc: Yao Qi , gdb-patches Subject: Re: [PATCH 4/6] Fetch and store GP registers by PTRACE_{G,S}ETREGSET References: <1432822816-32327-1-git-send-email-yao.qi@linaro.org> <1432822816-32327-5-git-send-email-yao.qi@linaro.org> Date: Fri, 29 May 2015 13:11:00 -0000 In-Reply-To: (Doug Evans's message of "Thu, 28 May 2015 11:50:50 -0700") Message-ID: <867frrplzb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00715.txt.bz2 Doug Evans writes: > The =3D=3D 1 in this test hinders readability (to me anyway). > [It occurs here and in 5/6, 6/6.] > The name suggests the variable is a boolean, so I'm > left wondering "Can it have values other than 0/1, > and is the else clause correct for those other values?" > > Digging deeper the reader would find the variable is tri-state, > but the initial -1 value should never be seen here (at least > that's the intuitive choice). Yes, this variable have three states, uninitialised (-1), true (1) and false (0) and that is reason I check "have_ptrace_getregset =3D=3D 1" instead of "have_ptrace_getregset". > > If one wanted to add an assert that the value is not -1 here > that'd be ok, though one could also argue it's overkill. > I don't have a preference either way. > > But I suggest removing the "=3D=3D 1" in the test. I am OK to remove "=3D=3D 1" from patches #4, #5 and #6. --=20 Yao (=E9=BD=90=E5=B0=A7)