From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id K92cA5CKF2k1UAIAWB0awg (envelope-from ) for ; Fri, 14 Nov 2025 15:01:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1763150479; bh=ca6u1Ap2wJoeE0Pl/B7cP03/4c4/hcKDPpa5qNYsSo4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=umai4cVWqelEf95LbdutqklRY4PwRnqVhoG4BN4k6EXt9UYJFgWp1zJaOLuVTcf8O BNdVFnxSQ61qgu4uUzg2BXd1GyeCN7TODX73gAHpqca1kE91CPu0f9/PlYYW6qFhj2 fh95WaW+kL2lvArOQ1Ik4+lGYMAEF70AUh6c6Zf8= Received: by simark.ca (Postfix, from userid 112) id EEC6A1E0B8; Fri, 14 Nov 2025 15:01:19 -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.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=R0SFT9IB; dkim-atps=neutral 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 40D6B1E04C for ; Fri, 14 Nov 2025 15:01:19 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0552E3858290 for ; Fri, 14 Nov 2025 20:01:19 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 7CC143858D21 for ; Fri, 14 Nov 2025 20:01:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7CC143858D21 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7CC143858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1763150460; cv=none; b=XZ2cGMX6aP2Y9qA39tlybITHq3lB5oor34hbVGX4TE4QrZEUQUvsyf8katb22JY9GTSDQv9giD6cmi0QYBv9IRf24ksWaqlUdrvVya4E8H6gWqELEzda0iE7jYVCYHwQtse3U67JmH6xOaRPNVIq/mY1N2j8vtGpkxP75dSwi2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1763150460; c=relaxed/simple; bh=ca6u1Ap2wJoeE0Pl/B7cP03/4c4/hcKDPpa5qNYsSo4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=tdlzHLbxgLtgCeRlJTkgTUoAptxdk1u9/vJraSD2V6LiQG7gT+BfnZ4Ar2VEnMj6EDy6fsXAWCwFij5NFfmf46KGmUuaYWUSODbYnC3cIxxBFvijHenQsRz+FP3/K3ertemSEqZGKh3ALUtYr27vkKRsC0uojExg+r/9xVXiRr8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1763150460; bh=ca6u1Ap2wJoeE0Pl/B7cP03/4c4/hcKDPpa5qNYsSo4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=R0SFT9IBz3ar5wMzZ5pNy1EgNpFPxxDSQzHp9e8fpdaNTlpACt5WyBAtntzrb5lDv NPWuPO8KXGAJU6QQw1efWO/wgQo/6BnAMxKAuQzKCOIj+cwM/LvfnJOvKGhIKUFW+m 8fLYmPBsBKvwgvGEXohYXt9dk4c9WqVt/rawh4eA= Received: by simark.ca (Postfix) id EF36B1E04C; Fri, 14 Nov 2025 15:00:59 -0500 (EST) Message-ID: Date: Fri, 14 Nov 2025 15:00:59 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places To: Tom Tromey , Simon Marchi Cc: gdb-patches@sourceware.org References: <20251113213506.313040-1-simon.marchi@efficios.com> <20251113214507.359286-1-simon.marchi@efficios.com> <87a50ov1gv.fsf@tromey.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <87a50ov1gv.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 2025-11-14 14:49, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> New in v2: > Simon> - I forgot to actually build-test with all targets enabled, so I was > Simon> missing a change in solib-rocm.c. > > Simon> Use the gdb:: set/map types instead of the std:: ones. I only changed > Simon> places in files I can build on my dev machine. > > Simon> I needed to explicitly default the move constructor and assigment > Simon> operator in proc_mem_file. I think this is ok, as nothing takes the > Simon> address of a proc_mem_file, requiring it not to move. > > Simon> I also needed to do it for refcnt_fd, in solib-rocm.c. It's a bit odd > Simon> to prevent moving / copying a refcnt_fd, as this struct doesn't directly > Simon> hold a resource, but I think I get why it was done. > > The patch removes DISABLE_COPY_AND_ASSIGN from refcnt_fd, but that seems > like it shouldn't be needed -- the map should handle move-only types > fine, and I think proc_mem_file is already one such. > > Simon> struct refcnt_fd > Simon> { > Simon> - DISABLE_COPY_AND_ASSIGN (refcnt_fd); > Simon> refcnt_fd (int fd, int refcnt) : fd (fd), refcnt (refcnt) {} > > i.e. this change seems unnecessary. > > Adding DISABLE_COPY_AND_ASSIGN to proc_mem_file isn't really need, since > it's handled by scoped_fd, though maybe it's worthwhile for clarity. I'm a bit confused with your answer. But if I don't explicitly default the move constructor and move assignment operator in proc_mem_file, it won't build. I would have expected proc_mem_file to automatically have them since its scoped_fd field already is movable. I don't understand what makes it non-movable unless I explicitly default the operations. Simon