From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0gaYOmEwp2kNzRIAWB0awg (envelope-from ) for ; Tue, 03 Mar 2026 14:02:57 -0500 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=oA8z/T6K; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D3EBE1E089; Tue, 03 Mar 2026 14:02:57 -0500 (EST) 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 436691E089 for ; Tue, 03 Mar 2026 14:02:57 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id AF1F94BA2E14 for ; Tue, 3 Mar 2026 19:02:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF1F94BA2E14 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=oA8z/T6K Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id D30EA4BA2E0F for ; Tue, 3 Mar 2026 19:02:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D30EA4BA2E0F 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 D30EA4BA2E0F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772564549; cv=none; b=iRQZHEhVwNRqG/s/jOqpMh8mrbqaTXFWKpuA6SgdG+3ZgJoD028vCj0Or8FO0U8VnYcIIFP1bM4r+2ZozYWGCIWk3BHZXF6D3XvJvsvTT1iXBiUmZtqmolE3XIXyM8GsVq+Xi03tTaFuqYt2LpJMg2NhxIZa0WSDM3X7SRZjb5k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772564549; c=relaxed/simple; bh=QSaVF5eYvcqR3GyEVpNR177QcFFvWnaHoyDyCx7Wx3c=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=VG1iDscAgbYapfaUAEpJzwX2VubU5nde+AMGtd8eYaW46SOxFmyjYa2R/16kGlUjIPKks6yXW8jyqtMC0UTigYImqFOR5UeVAiEdBPxgjRXw9kak7Cm0Kzk99H1wL7qfc3IvCuI9LBA2k/VxrFG2TPsbn6c0/RJnbIlQITTS5gM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D30EA4BA2E0F Received: from eig-obgw-6006b.ext.cloudfilter.net ([10.0.30.211]) by cmsmtp with ESMTPS id xTarvWhDRVCBNxV0mvk3ml; Tue, 03 Mar 2026 19:02:28 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id xV0bvxhQsvXvHxV0bvkUOu; Tue, 03 Mar 2026 19:02:17 +0000 X-Authority-Analysis: v=2.4 cv=e4IGSbp/ c=1 sm=1 tr=0 ts=69a73043 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=Yq5XynenixoA:10 a=ItBw4LHWJt0A:10 a=CCpqsmhAAAAA:8 a=7CQSdrXTAAAA:8 a=YPZoJte1r_0KY4-wk1YA:9 a=gkoysRN8xy4A:10 a=ul9cdbp4aOFLsgKbc677:22 a=a-qgeE7W1pNrGK8U0ZQC:22 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=ulz04rLU6Rl1Kegn1p70y80r8cZtpn13xCMq6QOVO6c=; b=oA8z/T6KboInxg8CmW4g4eUn+D +kS3xaQaiEbau8HaTNZDZxeLFj8Q/ECfEcCSd1t7AKERJxrQdFY8YJL4hKym3q6chbO/qMaYm26RF 1ahWjmKRDNppgwYbECNdMFqeQ; Received: from 97-122-122-234.hlrn.qwest.net ([97.122.122.234]:59622 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vxV0b-000000021D6-1bby; Tue, 03 Mar 2026 12:02:17 -0700 From: Tom Tromey To: Matthieu Longo Cc: , Tom Tromey Subject: Re: [PATCH v2 9/9] gdb/python: add accessor helpers for __dict__ in Python extension objects In-Reply-To: <20260303161659.397427-10-matthieu.longo@arm.com> (Matthieu Longo's message of "Tue, 3 Mar 2026 16:16:59 +0000") References: <20260303161659.397427-1-matthieu.longo@arm.com> <20260303161659.397427-10-matthieu.longo@arm.com> X-Attribution: Tom Date: Tue, 03 Mar 2026 12:02:16 -0700 Message-ID: <87zf4opwhz.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: 97.122.122.234 X-Source-L: No X-Exim-ID: 1vxV0b-000000021D6-1bby X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-122-234.hlrn.qwest.net (bapiya) [97.122.122.234]:59622 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: MS4xfAwtBocf/y7nl2nw1Rlml1Uj9engSeW3XpoNOhJdDN9KSFCBiAeWL5pQjn+Vm+m8QrhKfbej7f2XTPBzvlQ6fjbsuDbAdXGAxPCfnhElr68K1T1s8JaA dGc84lUj6bk9BZJdAH6AiwJMU97AU1lK8hQCTpY9hE7XfLW3izI1KHVqOARtn+TOFU3KqnvWfxkxpYRJJ1QRq3B2aiMQjIwEhko= 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 >>>>> Matthieu Longo writes: > A previous patch centralized the creation logic; this patch focuses > on centralizing the access to the dictionary. It introduces two new > macros: Thanks. > + #define gdbpy_dict_wrapper_PyGetSetDef(object_name) \ > + { \ > + "__dict__", /* name */ \ > + (getter) gdb_py_generic_dict_getter, \ > + (setter) nullptr, \ > + "The __dict__ for this " object_name ".", /* doc */ \ > + nullptr, /* closure */ \ > + } > + > + #define gdbpy_dict_wrapper_PyTypeObject_tps \ > + /*tp_getattro*/ \ > + gdb_py_generic_getattro, \ > + /*tp_setattro*/ \ > + gdb_py_generic_setattro I wouldn't indent the '#define'. But I tend to think it would be better to just use constexpr functions here. I'd also suggest changing the name, the "PyGetSetDef" suffix is kind of un-gdb-ish and anyway not really needed for a function, since this will be clear from the return type. You can see an example of doing this in a similar-ish context here https://sourceware.org/pipermail/gdb-patches/2026-February/225253.html Tom