From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iVSSOllSvmC/QAAAWB0awg (envelope-from ) for ; Mon, 07 Jun 2021 13:07:37 -0400 Received: by simark.ca (Postfix, from userid 112) id E0C1D1F163; Mon, 7 Jun 2021 13:07:37 -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.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 0592D1E939 for ; Mon, 7 Jun 2021 13:07:37 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E70C389001F for ; Mon, 7 Jun 2021 17:07:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E70C389001F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623085656; bh=u3xfzBvp1FnlZNdhh4LC75+7fruE4FQknE+dQE1xdu8=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=uweUgZlsO93lxXKw25RvzscAfTIJiiKv2DOz4S+JxB3DmImJq6SKM2AWLJD/tEIBH ILCoEF/hoLYdPq/XLe8Tl/EcNUKtdPa1QNnLpGvErmAgeOsKj+1jpFr0BXUDJSv2xv gHFnSLOEY05A7MST7uQf7X23UOe52SNHNYFJc99E= 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 To: Andrew Burgess 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-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: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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