From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CBKlCZvZ2GdQYxMAWB0awg (envelope-from ) for ; Mon, 17 Mar 2025 22:25:31 -0400 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=m+6JH2oM; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 242011E100; Mon, 17 Mar 2025 22:25:31 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 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 CD5FF1E05C for ; Mon, 17 Mar 2025 22:25:30 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7D5CE3857BBF for ; Tue, 18 Mar 2025 02:25:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D5CE3857BBF 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=m+6JH2oM Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 4BBF0385800F for ; Tue, 18 Mar 2025 02:15:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4BBF0385800F 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 4BBF0385800F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1742264104; cv=none; b=VbaPui1PrxhDxVORO1PbcWBP7V47VTDP3Ougomcf1Ebp6nNv0Hg5lHcR4r1+Ra5U2weJXEa52t7KyvWqRVfBRPLdXcqzGjKXMGxllRuk7jBbsKR/ZfMFD6l621pliWA1YlURQQn3S/BgsqmXcXaCiVcABmoozR53EZibODH3WVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1742264104; c=relaxed/simple; bh=EZrhA/S9GhcW4V9IbfjwdKRXqbYxQmds2/QdGzxFOsA=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=go8TxizfvPRgTCGkqhLo4g9tvOVIr/9xVfS2HjHd1yo3DSnc/G30GyuoYYmfsNgDQ5U2MAOOx5anOgB/gevR0v9iwedso6PnoZ/V6OlAEFnFPaiSKBc34mYpcKkcv2yzN4DJjonmN6GGrQ12Zn2vIOv+u49S1OE1LUEjwDT+qJs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BBF0385800F Received: from eig-obgw-5002a.ext.cloudfilter.net ([10.0.29.215]) by cmsmtp with ESMTPS id uFRvtRdPxVkcRuMTwt98LX; Tue, 18 Mar 2025 02:15:04 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id uMTvtyizCJ4PguMTvtRJE5; Tue, 18 Mar 2025 02:15:03 +0000 X-Authority-Analysis: v=2.4 cv=ZaLWNdVA c=1 sm=1 tr=0 ts=67d8d727 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=ItBw4LHWJt0A:10 a=M-arFxfq_70urDab1-oA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=jIHh7G6W4lEEward8DNyHIGhyYQ7fSpHifIdN9lWn64=; b=m+6JH2oMiZ95quOAG83AbeRoVg 4LWAInFcWd/ONOVqeljW7eNsDq2QnFwTBftLA2Lg7a0MqxP+K48M7/T0ZGWcvjUpMmzmnDKtFK5JJ xkWPFAzs+vN1RubiVdlFQubXo; Received: from 97-122-96-32.hlrn.qwest.net ([97.122.96.32]:36240 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tuMTu-00000002cIx-2vd6; Mon, 17 Mar 2025 20:15:02 -0600 From: Tom Tromey Date: Mon, 17 Mar 2025 20:15:04 -0600 Subject: [PATCH 11/19] Use gdb unordered set in linux-procfs.c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250317-replace-std-stuff-v1-11-7ba4ee88e218@tromey.com> References: <20250317-replace-std-stuff-v1-0-7ba4ee88e218@tromey.com> In-Reply-To: <20250317-replace-std-stuff-v1-0-7ba4ee88e218@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.122.96.32 X-Source-L: No X-Exim-ID: 1tuMTu-00000002cIx-2vd6 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-96-32.hlrn.qwest.net (prentzel.local) [97.122.96.32]:36240 X-Source-Auth: tom+tromey.com X-Email-Count: 12 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfEc+2px/QYIwiy7Tlenb/ySAwh7soKMAQbwuSrbZ1BKkxJSop3NaqqZjU6WuWdHuOqW7l6dgd8ATB8NNe7ChkrHg7pasrEELisa6jfQ4okLeA19WbiW2 ESrFMhTY+xfNqkjDG3Rn172RimQjneR9LLFqklBk/Jfd2IwBWOusakaPXg1B9ijO/sYjlcNllmKjgurtKgQRwNofJh11ZU4Hxtc= 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 This changes linux-procfs.c to use gdb:unordered_set. --- gdb/nat/linux-procfs.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c index 5efc86cca1f4f135c475159ed78fe72ca6a7c927..d7627138e45b1353cd681d4ca81dcc7a6c6a2e9c 100644 --- a/gdb/nat/linux-procfs.c +++ b/gdb/nat/linux-procfs.c @@ -18,9 +18,9 @@ #include "linux-procfs.h" #include "gdbsupport/filestuff.h" +#include "gdbsupport/unordered_set.h" #include #include -#include #include /* Return the TGID of LWPID from /proc/pid/status. Returns -1 if not @@ -358,20 +358,9 @@ linux_proc_attach_tgid_threads (pid_t pid, return; } - /* Callable object to hash elements in visited_lpws. */ - struct pair_hash - { - std::size_t operator() (const std::pair &v) const - { - return (std::hash() (v.first) - ^ std::hash() (v.second)); - } - }; - /* Keeps track of the LWPs we have already visited in /proc, identified by their PID and starttime to detect PID reuse. */ - std::unordered_set, - pair_hash> visited_lwps; + gdb::unordered_set> visited_lwps; /* Scan the task list for existing threads. While we go through the threads, new threads may be spawned. Cycle through the list of -- 2.46.1