aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2025-03-11 11:19:43 -0600
committerTom Tromey <tom@tromey.com>2025-03-18 05:32:03 -0600
commitcd0f7432a8b6c833b254c7a547d10f320c0b2d8a (patch)
tree5644a71bf71264210a597929333232eaa14052fd /gdb
parentff64da7cfdc81b68a064198d7e1e88810f87454d (diff)
downloadbinutils-cd0f7432a8b6c833b254c7a547d10f320c0b2d8a.zip
binutils-cd0f7432a8b6c833b254c7a547d10f320c0b2d8a.tar.gz
binutils-cd0f7432a8b6c833b254c7a547d10f320c0b2d8a.tar.bz2
Use gdb unordered map for complaints
This changes the complaints code to use gdb::unordered_map. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/complaints.c6
-rw-r--r--gdb/complaints.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/gdb/complaints.c b/gdb/complaints.c
index b50bea8..80b358c 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -23,14 +23,14 @@
#include "run-on-main-thread.h"
#include "top.h"
#include "gdbsupport/selftest.h"
-#include <unordered_map>
+#include "gdbsupport/unordered_map.h"
#if CXX_STD_THREAD
#include <mutex>
#endif
/* Map format strings to counters. */
-static std::unordered_map<const char *, int> counters;
+static gdb::unordered_map<const char *, int> counters;
/* How many complaints about a particular thing should be printed
before we stop whining about it? Default is no whining at all,
@@ -149,7 +149,7 @@ namespace selftests {
static void
test_complaints ()
{
- std::unordered_map<const char *, int> tmp;
+ gdb::unordered_map<const char *, int> tmp;
scoped_restore reset_counters = make_scoped_restore (&counters, tmp);
scoped_restore reset_stop_whining = make_scoped_restore (&stop_whining, 2);
diff --git a/gdb/complaints.h b/gdb/complaints.h
index 3d0e0ba..2065067 100644
--- a/gdb/complaints.h
+++ b/gdb/complaints.h
@@ -21,7 +21,7 @@
#define GDB_COMPLAINTS_H
#include "gdbsupport/scoped_restore.h"
-#include <unordered_set>
+#include "gdbsupport/unordered_set.h"
/* Helper for complaint. */
extern void complaint_internal (const char *fmt, ...)
@@ -59,7 +59,7 @@ extern void clear_complaints ();
/* Type of collected complaints. */
-typedef std::unordered_set<std::string> complaint_collection;
+typedef gdb::unordered_set<std::string> complaint_collection;
/* A class that can handle calls to complaint from multiple threads.
When this is instantiated, it hooks into the complaint mechanism,