#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
/* 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. */
#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
}
};
-/* 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
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;
};
#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. */
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
#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. */
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
#include "user-regs.h"
#include "expression.h"
#include <algorithm>
-#include <unordered_set>
#include "producer.h"
#include "infcall.h"
#include "maint.h"
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" };
#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.
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",
(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. */
#include "solib-svr4.h"
#include "symfile.h"
-#include <unordered_map>
-
namespace {
/* Per inferior cache of opened file descriptors. */
private:
struct refcnt_fd
{
- DISABLE_COPY_AND_ASSIGN (refcnt_fd);
refcnt_fd (int fd, int refcnt) : fd (fd), refcnt (refcnt) {}
+ DISABLE_COPY_AND_ASSIGN (refcnt_fd);
+
+ 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
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; });
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)
{
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 ();
#include "cli/cli-cmds.h"
#include "inferior.h"
-#include <unordered_map>
-
/* Support for hardware watchpoints and breakpoints using the x86
debug registers.
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. */