From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 2087E3851C07 for ; Mon, 22 Jun 2020 17:00:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2087E3851C07 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5B1A71E792; Mon, 22 Jun 2020 13:00:17 -0400 (EDT) Subject: Re: [PATCH v2 3/3] gdb/jit: enable tracking multiple jitter objfiles To: "Aktemur, Tankut Baris" , Pedro Alves , "gdb-patches@sourceware.org" References: <4f7d8cfd9635484c5148e72f0941a0d9f369b7f3.1592299502.git.tankut.baris.aktemur@intel.com> <40e500a7-81ab-280a-1e40-d737d9aeb93f@simark.ca> <5ce80dbd-b9b1-f707-59e1-53a474037750@simark.ca> From: Simon Marchi Message-ID: <2a2078fe-e921-ddee-4051-4900ad3c8f96@simark.ca> Date: Mon, 22 Jun 2020 13:00:16 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2020 17:00:19 -0000 On 2020-06-22 12:53 p.m., Aktemur, Tankut Baris via Gdb-patches wrote: > On Monday, June 22, 2020 6:40 PM, Simon Marchi wrote: >> On 2020-06-22 12:28 p.m., Pedro Alves wrote: >>> On 6/21/20 4:32 AM, Simon Marchi wrote: >>>> >>>> I would prefer #2, because using registries is kind of our standard way to keep >>>> per-stuff data (where stuff is objfile, program_space, inferior, etc). >>> >>> I'd just like to point out that the main point of the registry mechanism >>> is dynamic registration, which is useful when you have parts of the >>> debugger that may or not be present in the final build. E.g., >>> per-stuff data that is only used by some -tdep.c file. Otherwise, >>> if we're talking about data used by some module that is _always_ >>> included in the built, then IMO the registry stuff is an unnecessary >>> abstraction. >> >> What would you use instead, an explicit field in the objfile structure? >> >> Simon > > Can we use an std::unordered_map instead of > > static const struct objfile_key jit_per_objfile; > > ? > > -Baris An std::unordered_map with the objfile* as the key? Isn't that pretty much what objfile_key does, except that now you must manage it manually (make sure the remove the entry when an objfile is deleted)? Simon