From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7K5JOpSCt2fguzcAWB0awg (envelope-from ) for ; Thu, 20 Feb 2025 14:29:24 -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=NU4rBcvS; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E27D61E105; Thu, 20 Feb 2025 14:29:24 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 6B5701E05C for ; Thu, 20 Feb 2025 14:29:24 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EFA183858405 for ; Thu, 20 Feb 2025 19:29:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFA183858405 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=NU4rBcvS Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id ABAB13858D20 for ; Thu, 20 Feb 2025 19:28:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ABAB13858D20 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 ABAB13858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740079721; cv=none; b=pxoNb3fMMeqXXjc8fFKLqczmelQNrCxHKx86ZZCIizW3RYFuDuy2440uH2tkSEdhaP8qObp0EkLN5vfp4dWjTN7cGV9sX33xJ0rxaSHb3S0XfQn4GSk7+Q0gD8sRgSn9K0oDY1U5w7cwI7QkYJ4nrJAK5XynOXUL0DTxfUxSjBE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740079721; c=relaxed/simple; bh=pQs7s+5Eu12BilldP/HwUDdsksPdAuO0GUmoPrh0W8U=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fuszJEDh3GBjyXsdVMz0UEB8w45CcneAx/n4OUOVAYSsgVWgsoz0DaC2CGkoav2sfQ613pqu2Ig/863+z/aP2OqLQETfO/wyyyvGmdDLY7V6wHcvPY1AVAowEvRJniPgyMEAhdqgQZV1eTjqVdQkp7DWUtDGBxL+ujNEcszm9Yc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABAB13858D20 Received: from eig-obgw-5002a.ext.cloudfilter.net ([10.0.29.215]) by cmsmtp with ESMTPS id knmOtVTxjAfjwlCDwt0mxc; Thu, 20 Feb 2025 19:28:40 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id lCDvtlB1fdY0flCDwtQCFl; Thu, 20 Feb 2025 19:28:40 +0000 X-Authority-Analysis: v=2.4 cv=NoUacNdJ c=1 sm=1 tr=0 ts=67b78268 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=TDl5R864AAAA:8 a=bq8tZTQetBJTGxw7LAcA:9 a=Ubqy2apZIHKmzbd7uXgK:22 a=4IKI_MBedZsHOhguCAbN:22 a=6Ogn3jAGHLSNbaov7Orx: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=+g7FPRySy+0qD+HlhrlveCqp+oWJVS8eiPdfK1AR+uI=; b=NU4rBcvSpoVftAPFt31B9gjfRC O7wcVRB+KA41opB/3aca3/2O+7MZAZ1B8Xy9YAntCzma8kN6mEoZygb3K1yWB/t1CQp7olpSsvdJO RGEqpcSPoyF40s693mJq4y8dK; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:41768 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1tlCDv-002f7f-0g; Thu, 20 Feb 2025 12:28:39 -0700 From: Tom Tromey To: Jan Vrany Cc: gdb-patches@sourceware.org Subject: Re: [RFC 5/9] gdb/python: introduce gdbpy_registry In-Reply-To: <20250127104435.823519-6-jan.vrany@labware.com> (Jan Vrany's message of "Mon, 27 Jan 2025 10:44:31 +0000") References: <20250127104435.823519-1-jan.vrany@labware.com> <20250127104435.823519-6-jan.vrany@labware.com> X-Attribution: Tom Date: Thu, 20 Feb 2025 12:28:32 -0700 Message-ID: <87pljca00v.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.118.36.154 X-Source-L: No X-Exim-ID: 1tlCDv-002f7f-0g X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (murgatroyd) [97.118.36.154]:41768 X-Source-Auth: tom+tromey.com X-Email-Count: 7 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfAte2kswm62FvFufEtWRJuS9RVMdlvc2x6H8wBFPddLRe4fyP+iLXRzorfKbjDwR7Tpq/6v9AkfeNCBIen9vTz8ANUvgDeFn7gbZzSxWc4w98xcW0PTq JM+o4ZRpb+TuaayAKh1iVkpHiV0dYLZr23Ys3pQnGmPnpPP3PgRI6SCMNOdL1FubhZiPRI5NSIvMuvlW1Akv0Iw75iMSrADfIhU= 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 >>>>> "Jan" == Jan Vrany writes: Jan> +#include Jan> +#include Simon recently imported a hash table so we use gdb::unordered_map and gdb::unordered_set now. You can probably just remove the includes and change the names and things will keep working. Jan> + The actuall tracking of "owned" Python objects is handled externally Small typo, s/actuall/actual/ Jan> + /* Lookup pre-existing Python object for given VAL. Return such object Jan> + if found, otherwise return NULL. This method always returns new Jan> + reference. */ Jan> + template Jan> + obj_type *lookup (O *owner, val_type *val) const Jan> + { Returning a new reference suggests that perhaps the return type should be gdbpy_ref<> (or gdbpy_ref). Jan> + Storage *get_storage(struct objfile* objf) const Jan> + { Jan> + return get_storage(objf, m_key_for_objf); Spaces before "(". There's a few of these around. Jan> + obj_type *lookup (val_type *val) const Jan> + { Jan> + gdb_assert_not_reached ("Should not be used."); Jan> + } I wonder if these methods can just be deleted? Like if the registry's 'lookup' template isn't instantiated, perhaps this function won't ever be called, and so no error generated? Same question for the assert in the 'remove' method. Tom