From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id K4jKL9YgW2HVdAAAWB0awg (envelope-from ) for ; Mon, 04 Oct 2021 11:42:14 -0400 Received: by simark.ca (Postfix, from userid 112) id AF2FD1EE1A; Mon, 4 Oct 2021 11:42:14 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D2C151EDDB for ; Mon, 4 Oct 2021 11:42:13 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5CAC8385843E for ; Mon, 4 Oct 2021 15:42:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CAC8385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633362133; bh=htvHP9kNeixOxpsPf2d5GJZGfB0NZ3x5/cNJkPeg1HE=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=iPOXUtOvGfnv/bkQnNuzcW2OwoV2WAO8Ov9MN8nAELWAWWidn3/WKfWNivgR6xmcY kRcPgozU7tQSiVkN34H80ViOosC47ppaGcxyzFfmP2x5PSCKoE2buVNk0z+D26V8f9 eOif0/k6L/We0Lp6cjatbjZTlQsYA3NDA/hPJHAk= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id C26073858D28 for ; Mon, 4 Oct 2021 15:41:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C26073858D28 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 194Ffnn1011554 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 4 Oct 2021 11:41:53 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 194Ffnn1011554 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E15AD1EDDB; Mon, 4 Oct 2021 11:41:48 -0400 (EDT) Message-ID: Date: Mon, 4 Oct 2021 11:41:48 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: [PATCH 1/4] [gdb/symtab] Fix htab_find_slot call in read_call_site_scope Content-Language: en-US To: Tom de Vries , gdb-patches@sourceware.org References: <20211001123328.22314-1-tdevries@suse.de> <113a7cab-f06b-32ad-caa1-b0c87e67335b@polymtl.ca> <24809991-4982-9951-a7f7-514a2d01cd10@polymtl.ca> <17aa014b-2500-14f0-81af-a5de2a98e657@suse.de> In-Reply-To: <17aa014b-2500-14f0-81af-a5de2a98e657@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 4 Oct 2021 15:41:49 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-10-04 08:46, Tom de Vries wrote: > On 10/4/21 2:05 PM, Simon Marchi wrote: >>>> Ah, I had not seen this comment. So it was on purpose. Still, I think >>>> that it makes it more confusing than anything. The patch LGTM. >>> >>> And, this follow-up commit reverts everything except the comment. >>> >>> Any comments? >>> >>> Thanks, >>> - Tom >>> >> >> Is there a problem with having the lookups done with just the pc? > > Well, there's the problem that I describe in the commit message. I > don't known of any other problem. > >> If we >> were to replace this with some C++ hash table, say std::unordered_map, it >> would be std::unordered_map. > > Right, because there's a separation between key and element. > >> So doing >> the lookups using just the pc in the htab makes sense to me. > > I'm sorry, I don't really understand what you're trying to say here. > > Do you agree with the patch? Do you disagree with the patch. Are you > suggesting an alternative solution? My thinking was: why not keep core_addr_eq and core_addr_hash, and pass a pointer to a CORE_ADDR when calling htab_find_slot. And drop the requirement for call_site::pc to be the first member of call_site. But I now realize that this may not be a correct use of htab: htab_find passes entries to the eq func. So if we have core_addr_eq as the eq func and htab passes a call_site* entry to core_addr_eq, it won't work. Now, we don't actually use htab_find, so it would still work for us. But that would be like setting up a trap for whoever tries to use htab_find in the future. So, the patche LGTM. Simon