Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 09/19] Use gdb unordered map for complaints
Date: Mon, 17 Mar 2025 20:15:02 -0600	[thread overview]
Message-ID: <20250317-replace-std-stuff-v1-9-7ba4ee88e218@tromey.com> (raw)
In-Reply-To: <20250317-replace-std-stuff-v1-0-7ba4ee88e218@tromey.com>

This changes the complaints code to use gdb::unordered_map.
---
 gdb/complaints.c | 6 +++---
 gdb/complaints.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/complaints.c b/gdb/complaints.c
index b50bea846790cf83fe09ae04c83c2f786f34311b..80b358c8dd165d7ed432563dea0f1a46833d30d1 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 3d0e0babd836a667134edf4b6ecb22a5b3d53490..20650671404be9988a0b58a976d1b1aad6e83045 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,

-- 
2.46.1


  parent reply	other threads:[~2025-03-18  2:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18  2:14 [PATCH 00/19] Convert std::unordered_{set,map} to gdb implementations Tom Tromey
2025-03-18  2:14 ` [PATCH 01/19] Use gdb unordered set and map in corelow.c Tom Tromey
2025-03-18  2:14 ` [PATCH 02/19] Use gdb unordered set in breakpoint.c Tom Tromey
2025-03-18  2:14 ` [PATCH 03/19] Use gdb unordered map in dictionary.c Tom Tromey
2025-03-18  2:14 ` [PATCH 04/19] Use gdb unordered map in gdb_bfd.c Tom Tromey
2025-03-18  2:14 ` [PATCH 05/19] Use gdb unordered set in symtab.c Tom Tromey
2025-03-18  2:14 ` [PATCH 06/19] Use gdb unordered map in ada-exp.y Tom Tromey
2025-03-18  2:15 ` [PATCH 07/19] Use gdb unordered map in inferior.h Tom Tromey
2025-03-18  2:15 ` [PATCH 08/19] Use gdb unordered map in stap-probe.c Tom Tromey
2025-03-18  2:15 ` Tom Tromey [this message]
2025-03-18  2:15 ` [PATCH 10/19] Use gdb unordered map in linux-nat.c Tom Tromey
2025-03-18  2:15 ` [PATCH 11/19] Use gdb unordered set in linux-procfs.c Tom Tromey
2025-03-18  2:15 ` [PATCH 12/19] Use gdb unordered set and map in Python layer Tom Tromey
2025-03-18  2:15 ` [PATCH 13/19] Use gdb unordered map in ravenscar.c Tom Tromey
2025-03-18  2:15 ` [PATCH 14/19] Use gdb unordered map in target.c Tom Tromey
2025-03-18  2:15 ` [PATCH 15/19] Use gdb unordered set and map in unit tests Tom Tromey
2025-03-18  2:15 ` [PATCH 16/19] Use gdb unordered map in xml-tdesc.c Tom Tromey
2025-03-18  2:15 ` [PATCH 17/19] Use gdb unordered set and map in cp-namespace.c Tom Tromey
2025-03-18  3:20   ` Simon Marchi
2025-03-18 11:32     ` Tom Tromey
2025-03-18  2:15 ` [PATCH 18/19] Use gdb unordered map in tui-io.c Tom Tromey
2025-03-18  3:26   ` Simon Marchi
2025-03-18 11:34     ` Tom Tromey
2025-03-18  2:15 ` [PATCH 19/19] Use gdb unordered map in regcache.c Tom Tromey
2025-03-18  3:27 ` [PATCH 00/19] Convert std::unordered_{set,map} to gdb implementations Simon Marchi
2025-03-18 11:43   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250317-replace-std-stuff-v1-9-7ba4ee88e218@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox