From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 623ZCMd9vmDwSQAAWB0awg (envelope-from ) for ; Mon, 07 Jun 2021 16:12:55 -0400 Received: by simark.ca (Postfix, from userid 112) id 163471F163; Mon, 7 Jun 2021 16:12:55 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 335491E54D for ; Mon, 7 Jun 2021 16:12:54 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6E1613896C20 for ; Mon, 7 Jun 2021 20:12:53 +0000 (GMT) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 3A1DD3835424 for ; Mon, 7 Jun 2021 20:12:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3A1DD3835424 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x435.google.com with SMTP id f2so18958028wri.11 for ; Mon, 07 Jun 2021 13:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=8XFFQ65gy0y8Ys8GQwBmSd11Kz6vwYaL/JdrGI1eKDQ=; b=L0Vj2yITt9uJ2blL0XZl6Myu6l3Mz9CA1hsmNPMic2GhatPluxRSASHq0p0esSyT7T vtGYUbsckWWFiaSJGAVuH3t7iUbBknnwmhHlAz7tJfmWupjtodG7nPvjesNpO+1jLR/r veHgV9RayR+p9VHv0UpeDunJWguJcgfaoxo0J5+BeueS1/7Fjqjn4/eFPaINl0vf8NqH JBfuTt7RjsFnExtxB7UVSN3JWBaPxTp9d2XcXkiqVw80EARhp6pmaf9/79WgZxpiQvdI XTjPjLEE6DReLd2MSch6NnsY7RotBkjdOlbczlYE9INqjVmYOhwWR4Cq2edVyOlMosZQ zztQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=8XFFQ65gy0y8Ys8GQwBmSd11Kz6vwYaL/JdrGI1eKDQ=; b=PMnRfPfqWdkpzir9Myr9vTecCoaZc6ggYXHC1DI42R/wl1ezk9G4W60pCl6oCoWzEW hZYNrlZbC2gFV65S87MhxcX3VEbng4x6+D16LkxbXC835Nf0aWh2N7tTP9uPR4tGMJ50 jBttGgjYvNKtLlA+b7vWvoGogS9eDEBo9ozTaN/ptvJNPTSZ+FGqVw1zq2QPVV4tE0+J wvJawWCp1kAQivDezfZdXxvsDbyc9Yxh+vtV7JQZgaMxZaU5Pw/+PoR2xPGenrT7PQ/f vfKUX1SFWYPoZwH3XS9qQu/r3KTr1/LCqzeqT1t4pD/HGqkpN0Z5F0VayP/f+bM3uxD7 +HfQ== X-Gm-Message-State: AOAM532ABOTDB8RhhbbBINuu129UzQZ636UiSGzmioPuDyBYPD+/r9Yl q0+Xtm5WzVbDiwS0BvS/IXnDH5pZuEIZIg== X-Google-Smtp-Source: ABdhPJxwBxSvFQa9Q1zz/iN885LERFq3qnJaKa0NX4p+Rjg9GPNIl+0Em6DxTh2qrBUvIBoZb24CFg== X-Received: by 2002:adf:a15c:: with SMTP id r28mr18763870wrr.224.1623096760156; Mon, 07 Jun 2021 13:12:40 -0700 (PDT) Received: from localhost (host109-151-46-70.range109-151.btcentralplus.com. [109.151.46.70]) by smtp.gmail.com with ESMTPSA id w23sm967264wmi.0.2021.06.07.13.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:12:39 -0700 (PDT) Date: Mon, 7 Jun 2021 21:12:38 +0100 From: Andrew Burgess To: Lancelot SIX Subject: Re: [PATCH 1/5] gdb/python: handle saving user registers in a frame unwinder Message-ID: <20210607201238.GV2672@embecosm.com> References: <20210607170710.a2dtukyyjjxwzmes@Plymouth> <20210607180131.dtq5ejhffpigicue@Plymouth> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20210607180131.dtq5ejhffpigicue@Plymouth> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 21:11:28 up 19 days, 9:55, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" * Lancelot SIX [2021-06-07 19:01:31 +0100]: > On Mon, Jun 07, 2021 at 01:20:33PM -0400, Simon Marchi wrote: > > On 2021-06-07 1:07 p.m., Lancelot SIX via Gdb-patches wrote: > > > Hi, > > >=20 > > > I just have a minor stylistic remark in the python code in the test: > > >=20 > > >> [=E2=80=A6] > > >> + > > >> + def __call__(self, pending_frame): > > >> + pc_desc =3D pending_frame.architecture().registers().find("= pc") > > >> + pc =3D pending_frame.read_register(pc_desc) > > >> + > > >> + sp_desc =3D pending_frame.architecture().registers().find("= sp") > > >> + sp =3D pending_frame.read_register(sp_desc) > > >> + > > >> + block =3D gdb.block_for_pc(int(pc)) > > >> + if block =3D=3D None: > > >=20 > > > When looking for None, it is usually prefered to use 'is None' instead > > > of '=3D=3D None'. The result is the same unless there is a strange o= verload > > > of __eq__. > > >=20 > > > This pattern can also be seen in patch 3 and 4 of your series (patch 4 > > > using both '=3D=3D' and 'is' to check for None). > >=20 > > I agree, that's the convention in Python. It is not in our coding > > standards, but I suggest using flake8 to check the Python code, it > > reports this (and much more): >=20 > Hi, >=20 > Actually, this is mentioned in the PEP-8[1][2], which states in the > =E2=80=9CProgramming Recommandations=E2=80=9D section: >=20 > Comparisons to singletons like None should always be done with is or > is not, never the equality operators. >=20 > This leads me to an annex question. Given that I still lack a lot of > experience with the overall codebase, I tend to pick this kind of small > stylistic details more easily than design and logic problems. I do not > always point out those I see when I read the ML, but I can totally > understand those isolated stylistic comments can be considered as noise. > If so, please let me know! I agree with Simon that any constructive feedback is great. And specifically, thanks for pointing this issue out to me. I've updated all of the patches locally to use 'is None' now. Thanks again, Andrew