From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id 8A83E3886C58 for ; Mon, 7 Jun 2021 17:07:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8A83E3886C58 Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:7bc6:28c0:e505:21fc]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id DAA2381895; Mon, 7 Jun 2021 17:07:14 +0000 (UTC) Date: Mon, 7 Jun 2021 18:07:10 +0100 From: Lancelot SIX To: Andrew Burgess Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/5] gdb/python: handle saving user registers in a frame unwinder Message-ID: <20210607170710.a2dtukyyjjxwzmes@Plymouth> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Mon, 07 Jun 2021 17:07:15 +0000 (UTC) X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 07 Jun 2021 17:07:18 -0000 Hi, I just have a minor stylistic remark in the python code in the test: > […] > + > + def __call__(self, pending_frame): > + pc_desc = pending_frame.architecture().registers().find("pc") > + pc = pending_frame.read_register(pc_desc) > + > + sp_desc = pending_frame.architecture().registers().find("sp") > + sp = pending_frame.read_register(sp_desc) > + > + block = gdb.block_for_pc(int(pc)) > + if block == None: When looking for None, it is usually prefered to use 'is None' instead of '== None'. The result is the same unless there is a strange overload of __eq__. This pattern can also be seen in patch 3 and 4 of your series (patch 4 using both '==' and 'is' to check for None). Lancelot. > + return None > + func = block.function > + if func == None: > + return None