From: Tom Tromey Date: Tue, 11 Mar 2025 17:21:26 +0000 (-0600) Subject: Use gdb unordered set in linux-procfs.c X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7116b64e238b641fbbdf941814e4c8250b173a28;p=thirdparty%2Fbinutils-gdb.git Use gdb unordered set in linux-procfs.c This changes linux-procfs.c to use gdb:unordered_set. Approved-By: Simon Marchi --- diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c index 5efc86cca1f..d7627138e45 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