* [PATCH] gdb: use gdb::unordered_{set,map} at a few places
@ 2025-11-13 21:35 Simon Marchi
2025-11-13 21:43 ` [PATCH v2] " Simon Marchi
0 siblings, 1 reply; 13+ messages in thread
From: Simon Marchi @ 2025-11-13 21:35 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Use the gdb:: set/map types instead of the std:: ones. I only changed
places in files I can build on my dev machine.
I needed to explicitly default the move constructor and assigment
operator in proc_mem_file. I think this is ok, as nothing takes the
address of a proc_mem_file, requiring it not to move.
Change-Id: If6f2d7ba3b1ae338eba38b0ab9f987400e661dff
---
gdb/aarch64-tdep.c | 2 +-
gdb/amdgpu-tdep.c | 2 +-
gdb/amdgpu-tdep.h | 9 ++++-----
gdb/arch/amd64-linux-tdesc.c | 3 ++-
gdb/arch/i386-linux-tdesc.c | 3 ++-
gdb/i386-tdep.c | 3 +--
gdb/linux-nat.c | 6 ++++--
gdb/solib-rocm.c | 8 +++-----
gdb/solib-svr4.c | 2 +-
gdb/x86-nat.c | 4 +---
10 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 89142e0a2149..b1cc17499bfb 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -66,7 +66,7 @@
#define HA_MAX_NUM_FLDS 4
/* All possible aarch64 target descriptors. */
-static std::unordered_map <aarch64_features, target_desc *> tdesc_aarch64_map;
+static gdb::unordered_map <aarch64_features, target_desc *> tdesc_aarch64_map;
/* The standard register names, and all the valid aliases for them.
We're not adding fp here, that name is already taken, see
diff --git a/gdb/amdgpu-tdep.c b/gdb/amdgpu-tdep.c
index a2cb7d8984ac..e0f64ee4b21e 100644
--- a/gdb/amdgpu-tdep.c
+++ b/gdb/amdgpu-tdep.c
@@ -356,7 +356,7 @@ using amd_dbgapi_register_type_enum_up
/* Map type lookup names to types. */
using amd_dbgapi_register_type_map
- = std::unordered_map<std::string, amd_dbgapi_register_type_up>;
+ = gdb::unordered_map<std::string, amd_dbgapi_register_type_up>;
/* Parse S as a ULONGEST, raise an error on overflow. */
diff --git a/gdb/amdgpu-tdep.h b/gdb/amdgpu-tdep.h
index 67bcaaf243a5..ac30023d74fc 100644
--- a/gdb/amdgpu-tdep.h
+++ b/gdb/amdgpu-tdep.h
@@ -23,9 +23,8 @@
#include "gdbarch.h"
#include <amd-dbgapi/amd-dbgapi.h>
-#include <unordered_map>
-/* Provide std::unordered_map::Hash for amd_dbgapi_register_id_t. */
+/* Provide gdb::unordered_map::Hash for amd_dbgapi_register_id_t. */
struct register_id_hash
{
size_t
@@ -35,7 +34,7 @@ struct register_id_hash
}
};
-/* Provide std::unordered_map::Equal for amd_dbgapi_register_id_t. */
+/* Provide gdb::unordered_map::Equal for amd_dbgapi_register_id_t. */
struct register_id_equal_to
{
bool
@@ -74,12 +73,12 @@ struct amdgpu_gdbarch_tdep : gdbarch_tdep_base
std::vector<int> dwarf_regnum_to_gdb_regnum;
/* A map of gdb regnums keyed by they equivalent register_id. */
- std::unordered_map<amd_dbgapi_register_id_t, int, register_id_hash,
+ gdb::unordered_map<amd_dbgapi_register_id_t, int, register_id_hash,
register_id_equal_to>
regnum_map;
/* A map of register_class_ids keyed by their name. */
- std::unordered_map<std::string, amd_dbgapi_register_class_id_t>
+ gdb::unordered_map<std::string, amd_dbgapi_register_class_id_t>
register_class_map;
};
diff --git a/gdb/arch/amd64-linux-tdesc.c b/gdb/arch/amd64-linux-tdesc.c
index 879666274e0e..4a7f2329f23d 100644
--- a/gdb/arch/amd64-linux-tdesc.c
+++ b/gdb/arch/amd64-linux-tdesc.c
@@ -21,6 +21,7 @@
#include "arch/amd64-linux-tdesc.h"
#include "arch/amd64.h"
#include "arch/x86-linux-tdesc-features.h"
+#include "gdbsupport/unordered_map.h"
/* See arch/amd64-linux-tdesc.h. */
@@ -29,7 +30,7 @@ const struct target_desc *
amd64_linux_read_description (uint64_t xstate_bv, bool is_x32)
{
/* The type used for the amd64 and x32 target description caches. */
- using tdesc_cache_type = std::unordered_map<uint64_t, const target_desc_up>;
+ using tdesc_cache_type = gdb::unordered_map<uint64_t, target_desc_up>;
/* Caches for the previously seen amd64 and x32 target descriptions,
indexed by the xstate_bv value that created the target
diff --git a/gdb/arch/i386-linux-tdesc.c b/gdb/arch/i386-linux-tdesc.c
index bd736eb68817..74f192b9c37c 100644
--- a/gdb/arch/i386-linux-tdesc.c
+++ b/gdb/arch/i386-linux-tdesc.c
@@ -21,6 +21,7 @@
#include "arch/i386-linux-tdesc.h"
#include "arch/i386.h"
#include "arch/x86-linux-tdesc-features.h"
+#include "gdbsupport/unordered_map.h"
/* See arch/i386-linux-tdesc.h. */
@@ -31,7 +32,7 @@ i386_linux_read_description (uint64_t xstate_bv)
xstate_bv value that created the target description. This
needs to be static within this function to ensure it is initialised
before first use. */
- static std::unordered_map<uint64_t, const target_desc_up> i386_tdesc_cache;
+ static gdb::unordered_map<uint64_t, target_desc_up> i386_tdesc_cache;
/* Only some bits are checked when creating a tdesc, but the
XSTATE_BV value contains other feature bits that are not relevant
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index e00b3337beaf..72d880a7a8a0 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -62,7 +62,6 @@
#include "user-regs.h"
#include "expression.h"
#include <algorithm>
-#include <unordered_set>
#include "producer.h"
#include "infcall.h"
#include "maint.h"
@@ -4206,7 +4205,7 @@ static std::string
i386_stap_adjust_register (struct gdbarch *gdbarch, struct stap_parse_info *p,
const std::string ®name, int regnum)
{
- static const std::unordered_set<std::string> reg_assoc
+ static const gdb::unordered_set<std::string> reg_assoc
= { "ax", "bx", "cx", "dx",
"si", "di", "bp", "sp" };
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 0c24e10c2c9e..cb33c0a9b844 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -63,7 +63,6 @@
#include "gdbsupport/scope-exit.h"
#include "gdbsupport/gdb-sigmask.h"
#include "gdbsupport/common-debug.h"
-#include <unordered_map>
/* This comment documents high-level logic of this file.
@@ -4039,6 +4038,9 @@ class proc_mem_file
gdb_assert (m_fd.get () != -1);
}
+ proc_mem_file (proc_mem_file &&) = default;
+ proc_mem_file & operator= (proc_mem_file &&) = default;
+
~proc_mem_file ()
{
linux_nat_debug_printf ("closing fd %d for /proc/%d/task/%ld/mem",
@@ -4067,7 +4069,7 @@ class proc_mem_file
(also default), we don't create an inferior for the fork child, but
we still need to remove breakpoints from the fork child's
memory. */
-static std::unordered_map<int, proc_mem_file> proc_mem_file_map;
+static gdb::unordered_map<int, proc_mem_file> proc_mem_file_map;
/* Close the /proc/PID/mem file for PID. */
diff --git a/gdb/solib-rocm.c b/gdb/solib-rocm.c
index b48e4426fd41..5f13feea5a0a 100644
--- a/gdb/solib-rocm.c
+++ b/gdb/solib-rocm.c
@@ -32,8 +32,6 @@
#include "solib-svr4.h"
#include "symfile.h"
-#include <unordered_map>
-
namespace {
/* Per inferior cache of opened file descriptors. */
@@ -68,7 +66,7 @@ struct rocm_solib_fd_cache
};
inferior *m_inferior;
- std::unordered_map<std::string, refcnt_fd> m_cache;
+ gdb::unordered_map<std::string, refcnt_fd> m_cache;
};
int
@@ -101,7 +99,7 @@ rocm_solib_fd_cache::open (const std::string &filename,
int
rocm_solib_fd_cache::close (int fd, fileio_error *target_errno)
{
- using cache_val = std::unordered_map<std::string, refcnt_fd>::value_type;
+ using cache_val = gdb::unordered_map<std::string, refcnt_fd>::value_type;
auto it
= std::find_if (m_cache.begin (), m_cache.end (),
[fd](const cache_val &s) { return s.second.fd == fd; });
@@ -544,7 +542,7 @@ rocm_bfd_iovec_open (bfd *abfd, inferior *inferior)
tokens.emplace_back (uri.substr (last));
/* Create a tag-value map from the tokenized query/fragment. */
- std::unordered_map<std::string_view, std::string_view,
+ gdb::unordered_map<std::string_view, std::string_view,
gdb::string_view_hash> params;
for (std::string_view token : tokens)
{
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index c91e0b2c37b4..2d15e7dfd8a5 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -3758,7 +3758,7 @@ svr4_solib_ops::get_solibs_in_ns (int nsid) const
faster, and to be able to remove SOs from the map, to avoid
returning the dynamic linker multiple times. */
CORE_ADDR debug_base = info->namespace_id[nsid];
- std::unordered_map<std::string, const lm_info_svr4 *> namespace_solibs;
+ gdb::unordered_map<std::string, const lm_info_svr4 *> namespace_solibs;
for (svr4_so &so : info->solib_lists[debug_base])
namespace_solibs[so.name] = so.lm_info.get ();
diff --git a/gdb/x86-nat.c b/gdb/x86-nat.c
index eb44dd58a4f4..381364cdd70e 100644
--- a/gdb/x86-nat.c
+++ b/gdb/x86-nat.c
@@ -21,8 +21,6 @@
#include "cli/cli-cmds.h"
#include "inferior.h"
-#include <unordered_map>
-
/* Support for hardware watchpoints and breakpoints using the x86
debug registers.
@@ -42,7 +40,7 @@ struct x86_dr_low_type x86_dr_low;
need to keep track of processes that aren't bound to any inferior
(e.g., fork children, checkpoints). */
-static std::unordered_map<pid_t,
+static gdb::unordered_map<pid_t,
struct x86_debug_reg_state> x86_debug_process_state;
/* See x86-nat.h. */
base-commit: fd3b1c4f4c111444dfe6ff9c3f00a5469e7cd8a6
--
2.51.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-13 21:35 [PATCH] gdb: use gdb::unordered_{set,map} at a few places Simon Marchi
@ 2025-11-13 21:43 ` Simon Marchi
2025-11-14 19:49 ` Tom Tromey
0 siblings, 1 reply; 13+ messages in thread
From: Simon Marchi @ 2025-11-13 21:43 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
New in v2:
- I forgot to actually build-test with all targets enabled, so I was
missing a change in solib-rocm.c.
Use the gdb:: set/map types instead of the std:: ones. I only changed
places in files I can build on my dev machine.
I needed to explicitly default the move constructor and assigment
operator in proc_mem_file. I think this is ok, as nothing takes the
address of a proc_mem_file, requiring it not to move.
I also needed to do it for refcnt_fd, in solib-rocm.c. It's a bit odd
to prevent moving / copying a refcnt_fd, as this struct doesn't directly
hold a resource, but I think I get why it was done.
Change-Id: If6f2d7ba3b1ae338eba38b0ab9f987400e661dff
---
gdb/aarch64-tdep.c | 2 +-
gdb/amdgpu-tdep.c | 2 +-
gdb/amdgpu-tdep.h | 9 ++++-----
gdb/arch/amd64-linux-tdesc.c | 3 ++-
gdb/arch/i386-linux-tdesc.c | 3 ++-
gdb/i386-tdep.c | 3 +--
gdb/linux-nat.c | 6 ++++--
gdb/solib-rocm.c | 12 ++++++------
gdb/solib-svr4.c | 2 +-
gdb/x86-nat.c | 4 +---
10 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 89142e0a2149..b1cc17499bfb 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -66,7 +66,7 @@
#define HA_MAX_NUM_FLDS 4
/* All possible aarch64 target descriptors. */
-static std::unordered_map <aarch64_features, target_desc *> tdesc_aarch64_map;
+static gdb::unordered_map <aarch64_features, target_desc *> tdesc_aarch64_map;
/* The standard register names, and all the valid aliases for them.
We're not adding fp here, that name is already taken, see
diff --git a/gdb/amdgpu-tdep.c b/gdb/amdgpu-tdep.c
index a2cb7d8984ac..e0f64ee4b21e 100644
--- a/gdb/amdgpu-tdep.c
+++ b/gdb/amdgpu-tdep.c
@@ -356,7 +356,7 @@ using amd_dbgapi_register_type_enum_up
/* Map type lookup names to types. */
using amd_dbgapi_register_type_map
- = std::unordered_map<std::string, amd_dbgapi_register_type_up>;
+ = gdb::unordered_map<std::string, amd_dbgapi_register_type_up>;
/* Parse S as a ULONGEST, raise an error on overflow. */
diff --git a/gdb/amdgpu-tdep.h b/gdb/amdgpu-tdep.h
index 67bcaaf243a5..ac30023d74fc 100644
--- a/gdb/amdgpu-tdep.h
+++ b/gdb/amdgpu-tdep.h
@@ -23,9 +23,8 @@
#include "gdbarch.h"
#include <amd-dbgapi/amd-dbgapi.h>
-#include <unordered_map>
-/* Provide std::unordered_map::Hash for amd_dbgapi_register_id_t. */
+/* Provide gdb::unordered_map::Hash for amd_dbgapi_register_id_t. */
struct register_id_hash
{
size_t
@@ -35,7 +34,7 @@ struct register_id_hash
}
};
-/* Provide std::unordered_map::Equal for amd_dbgapi_register_id_t. */
+/* Provide gdb::unordered_map::Equal for amd_dbgapi_register_id_t. */
struct register_id_equal_to
{
bool
@@ -74,12 +73,12 @@ struct amdgpu_gdbarch_tdep : gdbarch_tdep_base
std::vector<int> dwarf_regnum_to_gdb_regnum;
/* A map of gdb regnums keyed by they equivalent register_id. */
- std::unordered_map<amd_dbgapi_register_id_t, int, register_id_hash,
+ gdb::unordered_map<amd_dbgapi_register_id_t, int, register_id_hash,
register_id_equal_to>
regnum_map;
/* A map of register_class_ids keyed by their name. */
- std::unordered_map<std::string, amd_dbgapi_register_class_id_t>
+ gdb::unordered_map<std::string, amd_dbgapi_register_class_id_t>
register_class_map;
};
diff --git a/gdb/arch/amd64-linux-tdesc.c b/gdb/arch/amd64-linux-tdesc.c
index 879666274e0e..4a7f2329f23d 100644
--- a/gdb/arch/amd64-linux-tdesc.c
+++ b/gdb/arch/amd64-linux-tdesc.c
@@ -21,6 +21,7 @@
#include "arch/amd64-linux-tdesc.h"
#include "arch/amd64.h"
#include "arch/x86-linux-tdesc-features.h"
+#include "gdbsupport/unordered_map.h"
/* See arch/amd64-linux-tdesc.h. */
@@ -29,7 +30,7 @@ const struct target_desc *
amd64_linux_read_description (uint64_t xstate_bv, bool is_x32)
{
/* The type used for the amd64 and x32 target description caches. */
- using tdesc_cache_type = std::unordered_map<uint64_t, const target_desc_up>;
+ using tdesc_cache_type = gdb::unordered_map<uint64_t, target_desc_up>;
/* Caches for the previously seen amd64 and x32 target descriptions,
indexed by the xstate_bv value that created the target
diff --git a/gdb/arch/i386-linux-tdesc.c b/gdb/arch/i386-linux-tdesc.c
index bd736eb68817..74f192b9c37c 100644
--- a/gdb/arch/i386-linux-tdesc.c
+++ b/gdb/arch/i386-linux-tdesc.c
@@ -21,6 +21,7 @@
#include "arch/i386-linux-tdesc.h"
#include "arch/i386.h"
#include "arch/x86-linux-tdesc-features.h"
+#include "gdbsupport/unordered_map.h"
/* See arch/i386-linux-tdesc.h. */
@@ -31,7 +32,7 @@ i386_linux_read_description (uint64_t xstate_bv)
xstate_bv value that created the target description. This
needs to be static within this function to ensure it is initialised
before first use. */
- static std::unordered_map<uint64_t, const target_desc_up> i386_tdesc_cache;
+ static gdb::unordered_map<uint64_t, target_desc_up> i386_tdesc_cache;
/* Only some bits are checked when creating a tdesc, but the
XSTATE_BV value contains other feature bits that are not relevant
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index e00b3337beaf..72d880a7a8a0 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -62,7 +62,6 @@
#include "user-regs.h"
#include "expression.h"
#include <algorithm>
-#include <unordered_set>
#include "producer.h"
#include "infcall.h"
#include "maint.h"
@@ -4206,7 +4205,7 @@ static std::string
i386_stap_adjust_register (struct gdbarch *gdbarch, struct stap_parse_info *p,
const std::string ®name, int regnum)
{
- static const std::unordered_set<std::string> reg_assoc
+ static const gdb::unordered_set<std::string> reg_assoc
= { "ax", "bx", "cx", "dx",
"si", "di", "bp", "sp" };
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 0c24e10c2c9e..cb33c0a9b844 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -63,7 +63,6 @@
#include "gdbsupport/scope-exit.h"
#include "gdbsupport/gdb-sigmask.h"
#include "gdbsupport/common-debug.h"
-#include <unordered_map>
/* This comment documents high-level logic of this file.
@@ -4039,6 +4038,9 @@ class proc_mem_file
gdb_assert (m_fd.get () != -1);
}
+ proc_mem_file (proc_mem_file &&) = default;
+ proc_mem_file & operator= (proc_mem_file &&) = default;
+
~proc_mem_file ()
{
linux_nat_debug_printf ("closing fd %d for /proc/%d/task/%ld/mem",
@@ -4067,7 +4069,7 @@ class proc_mem_file
(also default), we don't create an inferior for the fork child, but
we still need to remove breakpoints from the fork child's
memory. */
-static std::unordered_map<int, proc_mem_file> proc_mem_file_map;
+static gdb::unordered_map<int, proc_mem_file> proc_mem_file_map;
/* Close the /proc/PID/mem file for PID. */
diff --git a/gdb/solib-rocm.c b/gdb/solib-rocm.c
index b48e4426fd41..b328cc7b5d06 100644
--- a/gdb/solib-rocm.c
+++ b/gdb/solib-rocm.c
@@ -32,8 +32,6 @@
#include "solib-svr4.h"
#include "symfile.h"
-#include <unordered_map>
-
namespace {
/* Per inferior cache of opened file descriptors. */
@@ -60,15 +58,17 @@ struct rocm_solib_fd_cache
private:
struct refcnt_fd
{
- DISABLE_COPY_AND_ASSIGN (refcnt_fd);
refcnt_fd (int fd, int refcnt) : fd (fd), refcnt (refcnt) {}
+ refcnt_fd (refcnt_fd &&) = default;
+ refcnt_fd &operator=(refcnt_fd &&other) = default;
+
int fd = -1;
int refcnt = 0;
};
inferior *m_inferior;
- std::unordered_map<std::string, refcnt_fd> m_cache;
+ gdb::unordered_map<std::string, refcnt_fd> m_cache;
};
int
@@ -101,7 +101,7 @@ rocm_solib_fd_cache::open (const std::string &filename,
int
rocm_solib_fd_cache::close (int fd, fileio_error *target_errno)
{
- using cache_val = std::unordered_map<std::string, refcnt_fd>::value_type;
+ using cache_val = gdb::unordered_map<std::string, refcnt_fd>::value_type;
auto it
= std::find_if (m_cache.begin (), m_cache.end (),
[fd](const cache_val &s) { return s.second.fd == fd; });
@@ -544,7 +544,7 @@ rocm_bfd_iovec_open (bfd *abfd, inferior *inferior)
tokens.emplace_back (uri.substr (last));
/* Create a tag-value map from the tokenized query/fragment. */
- std::unordered_map<std::string_view, std::string_view,
+ gdb::unordered_map<std::string_view, std::string_view,
gdb::string_view_hash> params;
for (std::string_view token : tokens)
{
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index c91e0b2c37b4..2d15e7dfd8a5 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -3758,7 +3758,7 @@ svr4_solib_ops::get_solibs_in_ns (int nsid) const
faster, and to be able to remove SOs from the map, to avoid
returning the dynamic linker multiple times. */
CORE_ADDR debug_base = info->namespace_id[nsid];
- std::unordered_map<std::string, const lm_info_svr4 *> namespace_solibs;
+ gdb::unordered_map<std::string, const lm_info_svr4 *> namespace_solibs;
for (svr4_so &so : info->solib_lists[debug_base])
namespace_solibs[so.name] = so.lm_info.get ();
diff --git a/gdb/x86-nat.c b/gdb/x86-nat.c
index eb44dd58a4f4..381364cdd70e 100644
--- a/gdb/x86-nat.c
+++ b/gdb/x86-nat.c
@@ -21,8 +21,6 @@
#include "cli/cli-cmds.h"
#include "inferior.h"
-#include <unordered_map>
-
/* Support for hardware watchpoints and breakpoints using the x86
debug registers.
@@ -42,7 +40,7 @@ struct x86_dr_low_type x86_dr_low;
need to keep track of processes that aren't bound to any inferior
(e.g., fork children, checkpoints). */
-static std::unordered_map<pid_t,
+static gdb::unordered_map<pid_t,
struct x86_debug_reg_state> x86_debug_process_state;
/* See x86-nat.h. */
base-commit: fd3b1c4f4c111444dfe6ff9c3f00a5469e7cd8a6
--
2.51.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-13 21:43 ` [PATCH v2] " Simon Marchi
@ 2025-11-14 19:49 ` Tom Tromey
2025-11-14 20:00 ` Simon Marchi
0 siblings, 1 reply; 13+ messages in thread
From: Tom Tromey @ 2025-11-14 19:49 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb-patches
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
Simon> New in v2:
Simon> - I forgot to actually build-test with all targets enabled, so I was
Simon> missing a change in solib-rocm.c.
Simon> Use the gdb:: set/map types instead of the std:: ones. I only changed
Simon> places in files I can build on my dev machine.
Simon> I needed to explicitly default the move constructor and assigment
Simon> operator in proc_mem_file. I think this is ok, as nothing takes the
Simon> address of a proc_mem_file, requiring it not to move.
Simon> I also needed to do it for refcnt_fd, in solib-rocm.c. It's a bit odd
Simon> to prevent moving / copying a refcnt_fd, as this struct doesn't directly
Simon> hold a resource, but I think I get why it was done.
The patch removes DISABLE_COPY_AND_ASSIGN from refcnt_fd, but that seems
like it shouldn't be needed -- the map should handle move-only types
fine, and I think proc_mem_file is already one such.
Simon> struct refcnt_fd
Simon> {
Simon> - DISABLE_COPY_AND_ASSIGN (refcnt_fd);
Simon> refcnt_fd (int fd, int refcnt) : fd (fd), refcnt (refcnt) {}
i.e. this change seems unnecessary.
Adding DISABLE_COPY_AND_ASSIGN to proc_mem_file isn't really need, since
it's handled by scoped_fd, though maybe it's worthwhile for clarity.
Tom
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-14 19:49 ` Tom Tromey
@ 2025-11-14 20:00 ` Simon Marchi
2025-11-14 20:05 ` Tom Tromey
0 siblings, 1 reply; 13+ messages in thread
From: Simon Marchi @ 2025-11-14 20:00 UTC (permalink / raw)
To: Tom Tromey, Simon Marchi; +Cc: gdb-patches
On 2025-11-14 14:49, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
>
> Simon> New in v2:
> Simon> - I forgot to actually build-test with all targets enabled, so I was
> Simon> missing a change in solib-rocm.c.
>
> Simon> Use the gdb:: set/map types instead of the std:: ones. I only changed
> Simon> places in files I can build on my dev machine.
>
> Simon> I needed to explicitly default the move constructor and assigment
> Simon> operator in proc_mem_file. I think this is ok, as nothing takes the
> Simon> address of a proc_mem_file, requiring it not to move.
>
> Simon> I also needed to do it for refcnt_fd, in solib-rocm.c. It's a bit odd
> Simon> to prevent moving / copying a refcnt_fd, as this struct doesn't directly
> Simon> hold a resource, but I think I get why it was done.
>
> The patch removes DISABLE_COPY_AND_ASSIGN from refcnt_fd, but that seems
> like it shouldn't be needed -- the map should handle move-only types
> fine, and I think proc_mem_file is already one such.
>
> Simon> struct refcnt_fd
> Simon> {
> Simon> - DISABLE_COPY_AND_ASSIGN (refcnt_fd);
> Simon> refcnt_fd (int fd, int refcnt) : fd (fd), refcnt (refcnt) {}
>
> i.e. this change seems unnecessary.
>
> Adding DISABLE_COPY_AND_ASSIGN to proc_mem_file isn't really need, since
> it's handled by scoped_fd, though maybe it's worthwhile for clarity.
I'm a bit confused with your answer. But if I don't explicitly default
the move constructor and move assignment operator in proc_mem_file, it
won't build. I would have expected proc_mem_file to automatically have
them since its scoped_fd field already is movable. I don't understand
what makes it non-movable unless I explicitly default the operations.
Simon
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-14 20:00 ` Simon Marchi
@ 2025-11-14 20:05 ` Tom Tromey
2025-11-14 20:32 ` Simon Marchi
0 siblings, 1 reply; 13+ messages in thread
From: Tom Tromey @ 2025-11-14 20:05 UTC (permalink / raw)
To: Simon Marchi; +Cc: Tom Tromey, Simon Marchi, gdb-patches
>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
>> Adding DISABLE_COPY_AND_ASSIGN to proc_mem_file isn't really need, since
>> it's handled by scoped_fd, though maybe it's worthwhile for clarity.
Simon> I'm a bit confused with your answer. But if I don't explicitly default
Simon> the move constructor and move assignment operator in proc_mem_file, it
Simon> won't build. I would have expected proc_mem_file to automatically have
Simon> them since its scoped_fd field already is movable. I don't understand
Simon> what makes it non-movable unless I explicitly default the operations.
The move operators are fine, this particular part of the note is just
saying that perhaps proc_mem_file would benefit from the explicit
addition of DISABLE_COPY_AND_ASSIGN. However it's not truly needed.
Tom
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-14 20:05 ` Tom Tromey
@ 2025-11-14 20:32 ` Simon Marchi
2025-11-14 21:10 ` Tom Tromey
0 siblings, 1 reply; 13+ messages in thread
From: Simon Marchi @ 2025-11-14 20:32 UTC (permalink / raw)
To: Tom Tromey, Simon Marchi; +Cc: gdb-patches
On 2025-11-14 15:05, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
>
>>> Adding DISABLE_COPY_AND_ASSIGN to proc_mem_file isn't really need, since
>>> it's handled by scoped_fd, though maybe it's worthwhile for clarity.
>
> Simon> I'm a bit confused with your answer. But if I don't explicitly default
> Simon> the move constructor and move assignment operator in proc_mem_file, it
> Simon> won't build. I would have expected proc_mem_file to automatically have
> Simon> them since its scoped_fd field already is movable. I don't understand
> Simon> what makes it non-movable unless I explicitly default the operations.
>
> The move operators are fine, this particular part of the note is just
> saying that perhaps proc_mem_file would benefit from the explicit
> addition of DISABLE_COPY_AND_ASSIGN. However it's not truly needed.
Ok, I have no problem being more explicit than necessary and using
DISABLE_COPY_AND_ASSIGN there. See updated patch below.
From e1f67cc4665e6c7ef4fc3fe6133c1447bab795c2 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@efficios.com>
Date: Thu, 13 Nov 2025 16:43:56 -0500
Subject: [PATCH] gdb: use gdb::unordered_{set,map} at a few places
Use the gdb:: set/map types instead of the std:: ones. I only changed
places in files I can build on my dev machine.
I needed to explicitly default the move constructor and assignment
operator in proc_mem_file. I think this is ok, as nothing takes the
address of a proc_mem_file, requiring it not to move.
I also needed to do it for refcnt_fd, in solib-rocm.c. It's a bit odd
to prevent moving / copying a refcnt_fd, as this struct doesn't directly
hold a resource, but I think I get why it was done.
Change-Id: If6f2d7ba3b1ae338eba38b0ab9f987400e661dff
---
gdb/aarch64-tdep.c | 2 +-
gdb/amdgpu-tdep.c | 2 +-
gdb/amdgpu-tdep.h | 9 ++++-----
gdb/arch/amd64-linux-tdesc.c | 3 ++-
gdb/arch/i386-linux-tdesc.c | 3 ++-
gdb/i386-tdep.c | 3 +--
gdb/linux-nat.c | 8 ++++++--
gdb/solib-rocm.c | 12 ++++++------
gdb/solib-svr4.c | 2 +-
gdb/x86-nat.c | 4 +---
10 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 89142e0a2149..b1cc17499bfb 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -66,7 +66,7 @@
#define HA_MAX_NUM_FLDS 4
/* All possible aarch64 target descriptors. */
-static std::unordered_map <aarch64_features, target_desc *> tdesc_aarch64_map;
+static gdb::unordered_map <aarch64_features, target_desc *> tdesc_aarch64_map;
/* The standard register names, and all the valid aliases for them.
We're not adding fp here, that name is already taken, see
diff --git a/gdb/amdgpu-tdep.c b/gdb/amdgpu-tdep.c
index a2cb7d8984ac..e0f64ee4b21e 100644
--- a/gdb/amdgpu-tdep.c
+++ b/gdb/amdgpu-tdep.c
@@ -356,7 +356,7 @@ using amd_dbgapi_register_type_enum_up
/* Map type lookup names to types. */
using amd_dbgapi_register_type_map
- = std::unordered_map<std::string, amd_dbgapi_register_type_up>;
+ = gdb::unordered_map<std::string, amd_dbgapi_register_type_up>;
/* Parse S as a ULONGEST, raise an error on overflow. */
diff --git a/gdb/amdgpu-tdep.h b/gdb/amdgpu-tdep.h
index 67bcaaf243a5..ac30023d74fc 100644
--- a/gdb/amdgpu-tdep.h
+++ b/gdb/amdgpu-tdep.h
@@ -23,9 +23,8 @@
#include "gdbarch.h"
#include <amd-dbgapi/amd-dbgapi.h>
-#include <unordered_map>
-/* Provide std::unordered_map::Hash for amd_dbgapi_register_id_t. */
+/* Provide gdb::unordered_map::Hash for amd_dbgapi_register_id_t. */
struct register_id_hash
{
size_t
@@ -35,7 +34,7 @@ struct register_id_hash
}
};
-/* Provide std::unordered_map::Equal for amd_dbgapi_register_id_t. */
+/* Provide gdb::unordered_map::Equal for amd_dbgapi_register_id_t. */
struct register_id_equal_to
{
bool
@@ -74,12 +73,12 @@ struct amdgpu_gdbarch_tdep : gdbarch_tdep_base
std::vector<int> dwarf_regnum_to_gdb_regnum;
/* A map of gdb regnums keyed by they equivalent register_id. */
- std::unordered_map<amd_dbgapi_register_id_t, int, register_id_hash,
+ gdb::unordered_map<amd_dbgapi_register_id_t, int, register_id_hash,
register_id_equal_to>
regnum_map;
/* A map of register_class_ids keyed by their name. */
- std::unordered_map<std::string, amd_dbgapi_register_class_id_t>
+ gdb::unordered_map<std::string, amd_dbgapi_register_class_id_t>
register_class_map;
};
diff --git a/gdb/arch/amd64-linux-tdesc.c b/gdb/arch/amd64-linux-tdesc.c
index 879666274e0e..4a7f2329f23d 100644
--- a/gdb/arch/amd64-linux-tdesc.c
+++ b/gdb/arch/amd64-linux-tdesc.c
@@ -21,6 +21,7 @@
#include "arch/amd64-linux-tdesc.h"
#include "arch/amd64.h"
#include "arch/x86-linux-tdesc-features.h"
+#include "gdbsupport/unordered_map.h"
/* See arch/amd64-linux-tdesc.h. */
@@ -29,7 +30,7 @@ const struct target_desc *
amd64_linux_read_description (uint64_t xstate_bv, bool is_x32)
{
/* The type used for the amd64 and x32 target description caches. */
- using tdesc_cache_type = std::unordered_map<uint64_t, const target_desc_up>;
+ using tdesc_cache_type = gdb::unordered_map<uint64_t, target_desc_up>;
/* Caches for the previously seen amd64 and x32 target descriptions,
indexed by the xstate_bv value that created the target
diff --git a/gdb/arch/i386-linux-tdesc.c b/gdb/arch/i386-linux-tdesc.c
index bd736eb68817..74f192b9c37c 100644
--- a/gdb/arch/i386-linux-tdesc.c
+++ b/gdb/arch/i386-linux-tdesc.c
@@ -21,6 +21,7 @@
#include "arch/i386-linux-tdesc.h"
#include "arch/i386.h"
#include "arch/x86-linux-tdesc-features.h"
+#include "gdbsupport/unordered_map.h"
/* See arch/i386-linux-tdesc.h. */
@@ -31,7 +32,7 @@ i386_linux_read_description (uint64_t xstate_bv)
xstate_bv value that created the target description. This
needs to be static within this function to ensure it is initialised
before first use. */
- static std::unordered_map<uint64_t, const target_desc_up> i386_tdesc_cache;
+ static gdb::unordered_map<uint64_t, target_desc_up> i386_tdesc_cache;
/* Only some bits are checked when creating a tdesc, but the
XSTATE_BV value contains other feature bits that are not relevant
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index e00b3337beaf..72d880a7a8a0 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -62,7 +62,6 @@
#include "user-regs.h"
#include "expression.h"
#include <algorithm>
-#include <unordered_set>
#include "producer.h"
#include "infcall.h"
#include "maint.h"
@@ -4206,7 +4205,7 @@ static std::string
i386_stap_adjust_register (struct gdbarch *gdbarch, struct stap_parse_info *p,
const std::string ®name, int regnum)
{
- static const std::unordered_set<std::string> reg_assoc
+ static const gdb::unordered_set<std::string> reg_assoc
= { "ax", "bx", "cx", "dx",
"si", "di", "bp", "sp" };
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 0c24e10c2c9e..322b44eae65a 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -63,7 +63,6 @@
#include "gdbsupport/scope-exit.h"
#include "gdbsupport/gdb-sigmask.h"
#include "gdbsupport/common-debug.h"
-#include <unordered_map>
/* This comment documents high-level logic of this file.
@@ -4039,6 +4038,11 @@ class proc_mem_file
gdb_assert (m_fd.get () != -1);
}
+ DISABLE_COPY_AND_ASSIGN (proc_mem_file);
+
+ proc_mem_file (proc_mem_file &&) = default;
+ proc_mem_file & operator= (proc_mem_file &&) = default;
+
~proc_mem_file ()
{
linux_nat_debug_printf ("closing fd %d for /proc/%d/task/%ld/mem",
@@ -4067,7 +4071,7 @@ class proc_mem_file
(also default), we don't create an inferior for the fork child, but
we still need to remove breakpoints from the fork child's
memory. */
-static std::unordered_map<int, proc_mem_file> proc_mem_file_map;
+static gdb::unordered_map<int, proc_mem_file> proc_mem_file_map;
/* Close the /proc/PID/mem file for PID. */
diff --git a/gdb/solib-rocm.c b/gdb/solib-rocm.c
index b48e4426fd41..b328cc7b5d06 100644
--- a/gdb/solib-rocm.c
+++ b/gdb/solib-rocm.c
@@ -32,8 +32,6 @@
#include "solib-svr4.h"
#include "symfile.h"
-#include <unordered_map>
-
namespace {
/* Per inferior cache of opened file descriptors. */
@@ -60,15 +58,17 @@ struct rocm_solib_fd_cache
private:
struct refcnt_fd
{
- DISABLE_COPY_AND_ASSIGN (refcnt_fd);
refcnt_fd (int fd, int refcnt) : fd (fd), refcnt (refcnt) {}
+ refcnt_fd (refcnt_fd &&) = default;
+ refcnt_fd &operator=(refcnt_fd &&other) = default;
+
int fd = -1;
int refcnt = 0;
};
inferior *m_inferior;
- std::unordered_map<std::string, refcnt_fd> m_cache;
+ gdb::unordered_map<std::string, refcnt_fd> m_cache;
};
int
@@ -101,7 +101,7 @@ rocm_solib_fd_cache::open (const std::string &filename,
int
rocm_solib_fd_cache::close (int fd, fileio_error *target_errno)
{
- using cache_val = std::unordered_map<std::string, refcnt_fd>::value_type;
+ using cache_val = gdb::unordered_map<std::string, refcnt_fd>::value_type;
auto it
= std::find_if (m_cache.begin (), m_cache.end (),
[fd](const cache_val &s) { return s.second.fd == fd; });
@@ -544,7 +544,7 @@ rocm_bfd_iovec_open (bfd *abfd, inferior *inferior)
tokens.emplace_back (uri.substr (last));
/* Create a tag-value map from the tokenized query/fragment. */
- std::unordered_map<std::string_view, std::string_view,
+ gdb::unordered_map<std::string_view, std::string_view,
gdb::string_view_hash> params;
for (std::string_view token : tokens)
{
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index c91e0b2c37b4..2d15e7dfd8a5 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -3758,7 +3758,7 @@ svr4_solib_ops::get_solibs_in_ns (int nsid) const
faster, and to be able to remove SOs from the map, to avoid
returning the dynamic linker multiple times. */
CORE_ADDR debug_base = info->namespace_id[nsid];
- std::unordered_map<std::string, const lm_info_svr4 *> namespace_solibs;
+ gdb::unordered_map<std::string, const lm_info_svr4 *> namespace_solibs;
for (svr4_so &so : info->solib_lists[debug_base])
namespace_solibs[so.name] = so.lm_info.get ();
diff --git a/gdb/x86-nat.c b/gdb/x86-nat.c
index eb44dd58a4f4..381364cdd70e 100644
--- a/gdb/x86-nat.c
+++ b/gdb/x86-nat.c
@@ -21,8 +21,6 @@
#include "cli/cli-cmds.h"
#include "inferior.h"
-#include <unordered_map>
-
/* Support for hardware watchpoints and breakpoints using the x86
debug registers.
@@ -42,7 +40,7 @@ struct x86_dr_low_type x86_dr_low;
need to keep track of processes that aren't bound to any inferior
(e.g., fork children, checkpoints). */
-static std::unordered_map<pid_t,
+static gdb::unordered_map<pid_t,
struct x86_debug_reg_state> x86_debug_process_state;
/* See x86-nat.h. */
base-commit: 5f224e54aee5bfe64175749aec885d15e69d6874
--
2.51.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-14 20:32 ` Simon Marchi
@ 2025-11-14 21:10 ` Tom Tromey
2025-11-14 21:15 ` Simon Marchi
0 siblings, 1 reply; 13+ messages in thread
From: Tom Tromey @ 2025-11-14 21:10 UTC (permalink / raw)
To: Simon Marchi; +Cc: Tom Tromey, Simon Marchi, gdb-patches
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
>> The move operators are fine, this particular part of the note is just
>> saying that perhaps proc_mem_file would benefit from the explicit
>> addition of DISABLE_COPY_AND_ASSIGN. However it's not truly needed.
Simon> Ok, I have no problem being more explicit than necessary and using
Simon> DISABLE_COPY_AND_ASSIGN there. See updated patch below.
Simon> struct refcnt_fd
Simon> {
Simon> - DISABLE_COPY_AND_ASSIGN (refcnt_fd);
Simon> refcnt_fd (int fd, int refcnt) : fd (fd), refcnt (refcnt) {}
I still think this removal is in error. Is it really needed?
Allowing copying here would surely lead to bugs.
Tom
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-14 21:10 ` Tom Tromey
@ 2025-11-14 21:15 ` Simon Marchi
2025-11-14 21:43 ` Tom Tromey
0 siblings, 1 reply; 13+ messages in thread
From: Simon Marchi @ 2025-11-14 21:15 UTC (permalink / raw)
To: Tom Tromey, Simon Marchi; +Cc: gdb-patches
On 2025-11-14 16:10, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
>
>>> The move operators are fine, this particular part of the note is just
>>> saying that perhaps proc_mem_file would benefit from the explicit
>>> addition of DISABLE_COPY_AND_ASSIGN. However it's not truly needed.
>
> Simon> Ok, I have no problem being more explicit than necessary and using
> Simon> DISABLE_COPY_AND_ASSIGN there. See updated patch below.
>
> Simon> struct refcnt_fd
> Simon> {
> Simon> - DISABLE_COPY_AND_ASSIGN (refcnt_fd);
> Simon> refcnt_fd (int fd, int refcnt) : fd (fd), refcnt (refcnt) {}
>
> I still think this removal is in error. Is it really needed?
> Allowing copying here would surely lead to bugs.
Well, since I defaulted the move operations, the copy operations are
disabled (at least that is my understanding). But again, I can be more
explicit than needed, since it's clearer.
I think it's a bit odd to prevent copying this particular structure in
the first place, since it's not that structure that controls the release
of the resource, through its constructor. It's done externally.
Simon
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-14 21:15 ` Simon Marchi
@ 2025-11-14 21:43 ` Tom Tromey
2025-11-14 22:20 ` Simon Marchi
0 siblings, 1 reply; 13+ messages in thread
From: Tom Tromey @ 2025-11-14 21:43 UTC (permalink / raw)
To: Simon Marchi; +Cc: Tom Tromey, Simon Marchi, gdb-patches
>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
Simon> I think it's a bit odd to prevent copying this particular structure in
Simon> the first place, since it's not that structure that controls the release
Simon> of the resource, through its constructor. It's done externally.
Yeah, I see now.
You can leave it as is I guess.
This type seems weird to me but on the other hand it's private to the
class that actually manages it.
Tom
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-14 21:43 ` Tom Tromey
@ 2025-11-14 22:20 ` Simon Marchi
2025-11-17 15:58 ` Tom Tromey
0 siblings, 1 reply; 13+ messages in thread
From: Simon Marchi @ 2025-11-14 22:20 UTC (permalink / raw)
To: Tom Tromey, Simon Marchi; +Cc: gdb-patches
On 11/14/25 4:43 PM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
>
> Simon> I think it's a bit odd to prevent copying this particular structure in
> Simon> the first place, since it's not that structure that controls the release
> Simon> of the resource, through its constructor. It's done externally.
>
> Yeah, I see now.
> You can leave it as is I guess.
I'll add the DISABLE_COPY_AND_ASSIGN just to be clear. Otherwise,
should I take this as an approval?
Simon
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-14 22:20 ` Simon Marchi
@ 2025-11-17 15:58 ` Tom Tromey
2025-11-17 16:31 ` Simon Marchi
0 siblings, 1 reply; 13+ messages in thread
From: Tom Tromey @ 2025-11-17 15:58 UTC (permalink / raw)
To: Simon Marchi; +Cc: Tom Tromey, Simon Marchi, gdb-patches
Simon> I'll add the DISABLE_COPY_AND_ASSIGN just to be clear. Otherwise,
Simon> should I take this as an approval?
Yeah sorry.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-17 15:58 ` Tom Tromey
@ 2025-11-17 16:31 ` Simon Marchi
2026-07-27 16:21 ` Daniel Fellows
0 siblings, 1 reply; 13+ messages in thread
From: Simon Marchi @ 2025-11-17 16:31 UTC (permalink / raw)
To: Tom Tromey, Simon Marchi; +Cc: gdb-patches
On 11/17/25 10:58 AM, Tom Tromey wrote:
> Simon> I'll add the DISABLE_COPY_AND_ASSIGN just to be clear. Otherwise,
> Simon> should I take this as an approval?
>
> Yeah sorry.
> Approved-By: Tom Tromey <tom@tromey.com>
>
> Tom
Thanks, pushed with the 2 DISABLE_COPY_AND_ASSIGN added.
Simon
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
2025-11-17 16:31 ` Simon Marchi
@ 2026-07-27 16:21 ` Daniel Fellows
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Fellows @ 2026-07-27 16:21 UTC (permalink / raw)
To: simark; +Cc: simon.marchi, gdb-patches, tom, nd
Hi Simon,
Would you be willing to backport the solib-svr4.c change from this patch
to gdb-17-branch?
We encountered the following build failure on both Intel and Arm macOS
hosts after moving to GDB 17:
gdb/solib-svr4.c:3769:3: error:
no template named 'unordered_map' in namespace 'std';
did you mean 'gdb::unordered_map'?
I tested changing this instance to gdb::unordered_map, and it fixes the
affected macOS builds.
The complete commit touches several unrelated files, has conflicts with
gdb-17-branch, and part of it was later reverted for x86-nat.c. Only the
solib-svr4.c change appears to be required here.
Would you be able to prepare that backport, or advise whether another
approach would be preferred?
Thanks,
Daniel
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-07-27 16:23 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-13 21:35 [PATCH] gdb: use gdb::unordered_{set,map} at a few places Simon Marchi
2025-11-13 21:43 ` [PATCH v2] " Simon Marchi
2025-11-14 19:49 ` Tom Tromey
2025-11-14 20:00 ` Simon Marchi
2025-11-14 20:05 ` Tom Tromey
2025-11-14 20:32 ` Simon Marchi
2025-11-14 21:10 ` Tom Tromey
2025-11-14 21:15 ` Simon Marchi
2025-11-14 21:43 ` Tom Tromey
2025-11-14 22:20 ` Simon Marchi
2025-11-17 15:58 ` Tom Tromey
2025-11-17 16:31 ` Simon Marchi
2026-07-27 16:21 ` Daniel Fellows
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox