aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2025-03-11 11:21:26 -0600
committerTom Tromey <tom@tromey.com>2025-03-18 05:32:03 -0600
commit7116b64e238b641fbbdf941814e4c8250b173a28 (patch)
tree04a848bf2f196fecb8dcab498bdf09c5394ca9ea /gdb
parentf9868995b4b8b7f0abeaf53365181fc05e54ee1f (diff)
downloadbinutils-7116b64e238b641fbbdf941814e4c8250b173a28.zip
binutils-7116b64e238b641fbbdf941814e4c8250b173a28.tar.gz
binutils-7116b64e238b641fbbdf941814e4c8250b173a28.tar.bz2
Use gdb unordered set in linux-procfs.c
This changes linux-procfs.c to use gdb:unordered_set. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/nat/linux-procfs.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c
index 5efc86c..d762713 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 <dirent.h>
#include <sys/stat.h>
-#include <unordered_set>
#include <utility>
/* 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<unsigned long, ULONGEST> &v) const
- {
- return (std::hash<unsigned long>() (v.first)
- ^ std::hash<ULONGEST>() (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<std::pair<unsigned long, ULONGEST>,
- pair_hash> visited_lwps;
+ gdb::unordered_set<std::pair<unsigned long, ULONGEST>> 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