]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use gdb unordered set and map in Python layer
authorTom Tromey <tom@tromey.com>
Tue, 11 Mar 2025 17:22:05 +0000 (11:22 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 18 Mar 2025 11:32:04 +0000 (05:32 -0600)
This changes a couple of files in the Python layer to use
gdb:unordered_set and gdb::unordered_map.  Another use exists but I
think it is being handled by Jan's series.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/python/py-inferior.c
gdb/python/py-registers.c

index 60bf56d17def31ce8e7a52dcc497f6e851b288b6..d11ca9e6506949441d1706a43136256328588d15 100644 (file)
 #include "py-event.h"
 #include "py-stopevent.h"
 #include "progspace-and-thread.h"
-#include <unordered_map>
+#include "gdbsupport/unordered_map.h"
 
 using thread_map_t
-  = std::unordered_map<thread_info *, gdbpy_ref<thread_object>>;
+  = gdb::unordered_map<thread_info *, gdbpy_ref<thread_object>>;
 
 struct inferior_object
 {
index 229dd62a826aac2beb2bf65770e6bd0c1ba73a87..75f99e510719f9bb163eefd8efe93f16a7da964e 100644 (file)
@@ -22,7 +22,7 @@
 #include "reggroups.h"
 #include "python-internal.h"
 #include "user-regs.h"
-#include <unordered_map>
+#include "gdbsupport/unordered_map.h"
 
 /* Per-gdbarch data type.  */
 typedef std::vector<gdbpy_ref<>> gdbpy_register_type;
@@ -98,7 +98,7 @@ gdbpy_get_reggroup (const reggroup *reggroup)
   /* Map from GDB's internal reggroup objects to the Python representation.
      GDB's reggroups are global, and are never deleted, so using a map like
      this is safe.  */
-  static std::unordered_map<const struct reggroup *,gdbpy_ref<>>
+  static gdb::unordered_map<const struct reggroup *,gdbpy_ref<>>
     gdbpy_reggroup_object_map;
 
   /* If there is not already a suitable Python object in the map then