[09/10] Use gdb map in py-connection.c

Message ID 20250225-source-cache-hash-v1-9-f937ce22b0e9@tromey.com
State New
Headers
Series Some simple changes to use gdb's unordered set and map |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Test passed

Commit Message

Tom Tromey Feb. 26, 2025, 1:08 a.m. UTC
  This changes py-connection.c to use gdb::unordered_map.
---
 gdb/python/py-connection.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
  

Patch

diff --git a/gdb/python/py-connection.c b/gdb/python/py-connection.c
index 7b5146dbe84254979cc1ead98db440a226a5c3e0..d2cd10df65a9c60e667ed8827e1651a28dda0089 100644
--- a/gdb/python/py-connection.c
+++ b/gdb/python/py-connection.c
@@ -27,8 +27,7 @@ 
 #include "arch-utils.h"
 #include "remote.h"
 #include "charset.h"
-
-#include <map>
+#include "gdbsupport/unordered_map.h"
 
 /* The Python object that represents a connection.  */
 
@@ -65,8 +64,8 @@  extern PyTypeObject remote_connection_object_type
 /* A map between process_stratum targets and the Python object representing
    them.  We actually hold a gdbpy_ref around the Python object so that
    reference counts are handled correctly when entries are deleted.  */
-static std::map<process_stratum_target *,
-		gdbpy_ref<connection_object>> all_connection_objects;
+static gdb::unordered_map<process_stratum_target *,
+			  gdbpy_ref<connection_object>> all_connection_objects;
 
 /* Return a reference to a gdb.TargetConnection object for TARGET.  If
    TARGET is nullptr then a reference to None is returned.