From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id RarUKx16f2pUeSYAWB0awg (envelope-from ) for ; Fri, 14 Aug 2026 16:27:09 -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=PYYz0hdg; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9EB361E0A3; Fri, 14 Aug 2026 16:27:09 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 C85211E09B for ; Fri, 14 Aug 2026 16:27:08 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8C5214BA79B1 for ; Fri, 14 Aug 2026 20:27:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C5214BA79B1 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=PYYz0hdg Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 30B844BA7990 for ; Fri, 14 Aug 2026 20:26:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30B844BA7990 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 30B844BA7990 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786739198; cv=none; b=nMwkdYdh+i8hyRJOShWKQ0xEfFyVvyNo1x3AbN5OgCramGJoAbCiwxgDdcUMW9qus5eRX3swCR53mk3Lszam8obYhUYoHblCiTnXSUdWSbkx37MQuR7tbT/9TqksPZz1LYcHBHOkcu6lPGs0gURtJiQSO0mKUt/2Q9lOsqW4+WY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786739198; c=relaxed/simple; bh=fJ3d92dhP8TEcxmjzeO/+beu53tUeRGXppriYXuf6N4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UNgO5ziPAufcLGa19m1FIoXh4G1nvfUXbDS3wC0SmW0Am//Apvvk2/mY5+In1MfUbQLdgLNrngv0Ybbyj4F0pEEvyfJQXzKEMRlszxo22LE7mdRI5uNvGYU8KMQlaR6gDKBbrmuQe6g5mMJuhvEQ90tFpCsZLuL7Ez2OHM8Eypo= 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=PYYz0hdg reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30B844BA7990 Received: from eig-obgw-5005b.ext.cloudfilter.net ([10.0.29.189]) by cmsmtp with ESMTPS id ux7aw7bZxuFzguyU9wg1Jj; Fri, 14 Aug 2026 20:26:37 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id uyU8wISZtFb3luyU8wkMQq; Fri, 14 Aug 2026 20:26:36 +0000 X-Authority-Analysis: v=2.4 cv=Xo36OUF9 c=1 sm=1 tr=0 ts=6a7f79fc a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=Sv0fKeRqtYgA:10 a=ItBw4LHWJt0A:10 a=psABPXrj8SeqCAdfHsYA: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=eQqvEGxwCSnSSsh5ZRJSx8SvpUNgUUHd0vNDPXX58j0=; b=PYYz0hdgtMoHltYFnLNRvbavDK xSt8ieH7H7wslBY5+iMFXx47+N58qz5my5dFkbBPVGsETog1ymZQsvba6tNAT9l23CgDGHCOxGW4n rvQ38CvNawZSPCUEWiNIwuGJ0; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:58378 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1wuyU7-00000001BRS-3qUe; Fri, 14 Aug 2026 14:26:36 -0600 From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2] [gdb/python] Convert valpy_call to the "python safety" approach In-Reply-To: <20260810115236.1087432-1-tdevries@suse.de> (Tom de Vries's message of "Mon, 10 Aug 2026 13:52:36 +0200") References: <20260810115236.1087432-1-tdevries@suse.de> X-Attribution: Tom Date: Fri, 14 Aug 2026 14:26:34 -0600 Message-ID: <87cxvkv479.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: 1wuyU7-00000001BRS-3qUe X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net (bapiya) [75.166.225.82]:58378 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfOtYAoJFCFWAv2km2NZNM1x9iTsAvpqbo7cWI113zDzXIa7hja5NFamlyUfOzpAjWHgXA3znQcHZm45l9tekqp9/PoWapF70zebMz6juaos0T/KlYev1 3/sQVFW0xbQX2J7MYJPPadMZh+nM6SSFqJkdbyHsauzt1+RiEf9jh97lNaaO1bKDMk1xCPNj4WNyNTbvKksPeUDxQ+eRDfRCwlU= 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 >>>>> "Tom" == Tom de Vries writes: Tom> I added wrapper function gdbpy_tuple_check to wrap PyTuple_Check. It always Tom> succeeds, so strictly speaking it doesn't need a wrapper, but always using Tom> wrapper functions and trusting them to DDRT is easier than remembering which Tom> functions always succeed. Seems reasonable. Tom> I also added this template: Tom> ... Tom> template Tom> T Tom> gdbpy_require_nonnull (T val) Tom> { Tom> if (val == nullptr) Tom> throw gdb_python_exception (); Tom> return val; Tom> } Tom> ... Tom> to do this simplification: This also seems fine, though in the longer run we should be removing this function again. Tom> +gdbpy_ref<> Tom> +value_object::valpy_call (gdbpy_borrowed_ref<> args, Tom> + gdbpy_opt_borrowed_ref<> keywords ATTRIBUTE_UNUSED) Not too sure about that ATTRIBUTE_UNUSED. Like, if we don't need it, we should support a different signature elsewhere. Tom> + safety_details::varargs_wrapper, /*tp_call*/ I think code outside py-safety.h should not refer to the contents of the safety_details namespace. Tom