From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id N0h0OI93D2qxcg0AWB0awg (envelope-from ) for ; Thu, 21 May 2026 17:22:23 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Dn4XnKGE; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D10B51E024; Thu, 21 May 2026 17:22:23 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 28FF41E024 for ; Thu, 21 May 2026 17:22:23 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8755A48F66E2 for ; Thu, 21 May 2026 21:22:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8755A48F66E2 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Dn4XnKGE Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 8A3974C91762 for ; Thu, 21 May 2026 21:21:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A3974C91762 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8A3974C91762 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779398517; cv=none; b=esynorXsnwpTd/DcD1CdjNfadWBbHqRpnziVO8oEZ8j8zGowE14pcTitcPP7SyLLnRJqoX0Ba2PDmu/a9yV/DAuGDLprQg2n5AnGBxahHofr2tR4sYMska+M2r2PDLWE/EOOAhsCisLOOOu5TZq9UWHAEK9vDUjvxy/KdcTlIkQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779398517; c=relaxed/simple; bh=P0AIkAONO+QleTF7hqPCTsn36h/yTBE4AJRq7FGki1M=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uYj8JEjmJiHK4YxERVxGCyxBqk3d6Ow6qOQs8nSircmqmDd03n5ptReNBvqwsv+eifWUUOCXe7lGaMZFgbDP+1QyNx2QeCUUqixH46N1dhQS+HBKU079mdOPNLqUK+HsaD1F6QzM176/iyZC5otOlvl4lGtVZrn0jq1YnYO7UUU= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Dn4XnKGE reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A3974C91762 Received: from eig-obgw-5006b.ext.cloudfilter.net ([10.0.29.217]) by cmsmtp with ESMTPS id Q9QJwvxcNKSRRQAq5w0B5v; Thu, 21 May 2026 21:21:57 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id QAq3wXa3jhFZUQAq3w4zco; Thu, 21 May 2026 21:21:56 +0000 X-Authority-Analysis: v=2.4 cv=RduQC0tv c=1 sm=1 tr=0 ts=6a0f7774 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=NGcC8JguVDcA:10 a=ItBw4LHWJt0A:10 a=20KFwNOVAAAA:8 a=CQ1SG-Uk0PeaZ49tJaEA:9 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YzeQ4bbMEIwTq903vodP2pHsEuJCxdRtSFZ8Tp49/po=; b=Dn4XnKGEmAl+/V77CxBSqMy/PA Pb1rrnKRhMjG7T7NXBAZQsqRyLsznYG73IeO00RezoBEwPqphFYWkkZEwTPi8lsuzpZWM/drbPfW6 +OuxohcKC+NBgmW71ZQxI4akl; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:35130 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.2) (envelope-from ) id 1wQAq3-00000000kBj-19Gk; Thu, 21 May 2026 15:21:55 -0600 From: Tom Tromey To: Andrew Burgess Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH v2 4/4] Convert py-tui.c to the "python safety" approach In-Reply-To: <871pf8dh8a.fsf@redhat.com> (Andrew Burgess's message of "Mon, 18 May 2026 13:39:33 +0100") References: <20260515-python-safety-initial-v2-0-6129cadf258a@tromey.com> <20260515-python-safety-initial-v2-4-6129cadf258a@tromey.com> <871pf8dh8a.fsf@redhat.com> X-Attribution: Tom Date: Thu, 21 May 2026 15:21:54 -0600 Message-ID: <878q9cjw5p.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.225.82 X-Source-L: No X-Exim-ID: 1wQAq3-00000000kBj-19Gk X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net (prentzel) [75.166.225.82]:35130 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfMCW2o2UVysufXViZmuwCc9V9uLIhjSzuz8UrC+mNjR9Fb0L3ejMfl5K1W8Z6KYyK37cl65fCxHlu9WK+bsLcDnuK/ycWrPEUnRBFeYY51sm6iMxjFBY wYWFfMKeGXgG+CWxWhQt2iQk8lnXfVUtV9qJaqA7BqMKDXoKEGT800BNrh0fT9B5oI8wOD46o6V3or9JJZTTDbOprtujrETWVTY= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Andrew" == Andrew Burgess writes: >> * gdb.register_tui_window is converted and simply returns 'void'. Andrew> typo: gdb.register_tui_window should be gdbpy_register_tui_window I think. I used the Python name rather than the C++ name. I'll change it though. >> /* Return true if this object is valid. */ >> - bool is_valid () const; >> + bool is_valid (); Andrew> Dropping 'const' here is unfortunate, and I think is a consequence of Andrew> either noargs_method or maybe wrapped_method requiring non-const. I will look but perhaps add the overloads on an as-needed basis. Andrew> Can we add a 'const' aware overload of noargs_method, or wrapped_method, Andrew> or whatever, and allow is_valid to retain the const qualifier? Yep, I fixed this. Andrew> If this works, then there might be other places in the wrapper functions Andrew> (patch #3) where we could/should add const overloads. >> + /* FIXME: safety */ Andrew> Please can you expand this comment. I know this is something you're Andrew> actively working on, and the plan is that this comment probably Andrew> shouldn't exist in the code for too long. But it might, so we should Andrew> assume that it will, and write this accordingly. I did this. Andrew> I'll be honest, even with the commit message hint, I don't really Andrew> understand what it is that needs fixing here, I guess it's that you'd Andrew> like python_string_to_host_string to throw rather than return NULL? But Andrew> the issue is that this function is used in non-safety code, so cannot Andrew> (currently) be changed? Yes, that's correct. Tom