From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 7582F3857B93 for ; Wed, 27 Sep 2023 14:20:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7582F3857B93 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from eig-obgw-6007a.ext.cloudfilter.net ([10.0.30.247]) by cmsmtp with ESMTP id lHyFqYp9tQFHRlVOZqSVjU; Wed, 27 Sep 2023 14:20:07 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id lVOXqmIzQLcIOlVOYqMqsZ; Wed, 27 Sep 2023 14:20:06 +0000 X-Authority-Analysis: v=2.4 cv=YcKuWidf c=1 sm=1 tr=0 ts=65143a16 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=zNV7Rl7Rt7sA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=5B_3pBatHXag9PEv0vkA:9 a=ul9cdbp4aOFLsgKbc677: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:In-Reply-To:Date:References :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=gnbOCpQWizKBQbzhH/rF473EUTpk9oDQPydRxSxYqow=; b=wux3LKcVzI3JFoK0BX3GQSkdXm cYScIPlnNrwHWfmgw9k2nLuNfbOb8iBPgb6EPRtk4q0kkIfBQYbX9U1iGUHqxjyUORZQra2yJmL0Q qyeikR/Sv4+pm7jDp3P1TPjTu; Received: from 71-211-130-31.hlrn.qwest.net ([71.211.130.31]:49104 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qlVOX-0044u3-1Y; Wed, 27 Sep 2023 08:20:05 -0600 From: Tom Tromey To: Andrew Burgess via Gdb-patches Cc: Tom Tromey , Andrew Burgess Subject: Re: [PATCH] gdb: add Python events for program space addition and removal References: <634d50951c6a4d50b0aa8dc91758c025738e8c68.1695300249.git.aburgess@redhat.com> <87cyyb72pj.fsf@tromey.com> <87r0mjx514.fsf@redhat.com> X-Attribution: Tom Date: Wed, 27 Sep 2023 08:20:04 -0600 In-Reply-To: <87r0mjx514.fsf@redhat.com> (Andrew Burgess via Gdb-patches's message of "Wed, 27 Sep 2023 11:51:51 +0100") Message-ID: <87h6nf4s17.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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: 71.211.130.31 X-Source-L: No X-Exim-ID: 1qlVOX-0044u3-1Y X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-130-31.hlrn.qwest.net (murgatroyd) [71.211.130.31]:49104 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfFrij747pqs4YaWE0tWOQpGugnpxniXwweA5b1vdnYrawwK1DHsXpJGNaz2BxvDpU08vz27Ijxh8l58zPSuY4j17HvPaKrtiv4I1jgHubngrN8ocr0W1 1RF22fBF4gxTkWdMyj31qQkzoI9LtpW82uKFwCSN+9gQhjA6OcbOE3uVdp8wiMSuF22038lS8txdUNJEcyxl279mKfOumXahkIU= X-Spam-Status: No, score=-3018.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Andrew" == Andrew Burgess via Gdb-patches writes: >> This approach seems totally fine to me, but it's worth noting that you >> could attach data directly to a Progspace if the tp_hash field were >> filled in. Some other Python classes in gdb do this. This makes caches >> easier because the cleanup is automatic. Andrew> I'm not sure I understand how tp_hash helps here? Yeah, I meant tp_dictoffset ... Andrew> gdb.Progspace does have a __dict__ attribute, so things like: ... which is already set. Sorry about that. Andrew> works just fine, and I did consider this. But I wasn't sure if this was Andrew> "good practice". My concern was mostly that this might lead to clashes Andrew> between different extensions if good names are not chosen for Andrew> 'my_random_var', or even clashes between extensions and future GDB Andrew> enhancements -- my understanding is that if we later added Andrew> 'my_random_var' as a builtin attribute this would take precedence over Andrew> the user defined attribute, breaking their extension. Yeah. gdb should promise not to use "_" names here & in other spots using tp_dictoffset. Tom