No behavior changes expected.
Change-Id: I16ff6c67058362c65cc8edb05d1948e48be6b2e1
Approved-By: Tom Tromey <tom@tromey.com>
struct gdbarch *gdbarch = objfile->arch ();
dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
- std::unordered_map<sect_offset, dwarf2_per_cu_data *>
+ gdb::unordered_map<sect_offset, dwarf2_per_cu_data *>
debug_info_offset_to_per_cu;
for (const auto &per_cu : per_bfd->all_units)
{
#include "gdbsupport/task-group.h"
#include "gdbsupport/thread-pool.h"
#include <chrono>
-#include <unordered_set>
#include "cli/cli-cmds.h"
/* We don't want gdb to exit while it is in the process of writing to
the index cache. So, all live cooked index vectors are stored
here, and then these are all waited for before exit proceeds. */
-static std::unordered_set<cooked_index *> active_vectors;
+static gdb::unordered_set<cooked_index *> active_vectors;
/* See cooked-index.h. */
}
/* Only show a given exception a single time. */
- std::unordered_set<gdb_exception> seen_exceptions;
+ gdb::unordered_set<gdb_exception> seen_exceptions;
for (auto &one_result : m_results)
{
re_emit_complaints (std::get<1> (one_result));
#include "gdbsupport/selftest.h"
#include "selftest-arch.h"
#endif
-#include <unordered_map>
#include <algorithm>
/* The CIE table is used to find CIEs during parsing, but then
discarded. It maps from the CIE's offset to the CIE. */
-typedef std::unordered_map<ULONGEST, dwarf2_cie *> dwarf2_cie_table;
+using dwarf2_cie_table = gdb::unordered_map<ULONGEST, dwarf2_cie *>;
/* Frame Description Entry (FDE). */
#include <algorithm>
#include <map>
-#include <unordered_map>
-#include <unordered_set>
/* Ensure only legit values are used. */
#define DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE(cu_index, value) \
this, we want to keep the entry from the first CU -- but this is
implicit due to the sort. This choice is done because it's
similar to what gdb historically did for partial symbols. */
- std::unordered_set<offset_type> seen;
+ gdb::unordered_set<offset_type> seen;
from = std::remove_if (cu_indices.begin (), cu_indices.end (),
[&] (offset_type val)
{
const char *const m_cstr;
};
-/* A std::unordered_map::hasher for c_str_view that uses the right
+/* A gdb::unordered_map::hasher for c_str_view that uses the right
hash function for strings in a mapped index. */
class c_str_view_hasher
{
}
};
-/* A std::unordered_map::hasher for std::vector<>. */
+/* A gdb::unordered_map::hasher for std::vector<>. */
template<typename T>
class vector_hasher
{
{
/* Elements are sorted vectors of the indices of all the CUs that
hold an object of this name. */
- std::unordered_map<std::vector<offset_type>, offset_type,
+ gdb::unordered_map<std::vector<offset_type>, offset_type,
vector_hasher<offset_type>>
symbol_hash_table;
}
/* Now write out the hash table. */
- std::unordered_map<c_str_view, offset_type, c_str_view_hasher> str_table;
+ gdb::unordered_map<c_str_view, offset_type, c_str_view_hasher> str_table;
for (const auto &entry : *symtab)
{
offset_type str_off, vec_off;
}
using cu_index_map
- = std::unordered_map<const dwarf2_per_cu_data *, unsigned int>;
+ = gdb::unordered_map<const dwarf2_per_cu_data *, unsigned int>;
/* Helper struct for building the address table. */
struct addrmap_index_data
}
private:
- std::unordered_map<c_str_view, size_t, c_str_view_hasher> m_str_table;
+ gdb::unordered_map<c_str_view, size_t, c_str_view_hasher> m_str_table;
bfd *const m_abfd;
dwarf2_per_bfd *m_per_bfd;
const bool has_parent;
};
- /* Provide std::unordered_map::hasher for index_key. */
+ /* Provide gdb::unordered_map::hasher for index_key. */
class index_key_hasher
{
public:
/* Map each used .debug_names abbreviation tag parameter to its
index value. */
- std::unordered_map<index_key, int, index_key_hasher> m_indexkey_to_idx;
+ gdb::unordered_map<index_key, int, index_key_hasher> m_indexkey_to_idx;
/* .debug_names abbreviation table. */
data_buf m_abbrev_table;
#include "compile/compile.h"
#include <algorithm>
#include <vector>
-#include <unordered_set>
#include "gdbsupport/underlying.h"
#include "gdbsupport/byte-vector.h"
#include "extract-store-integer.h"
std::vector<CORE_ADDR> todo;
/* Track here CORE_ADDRs which were already visited. */
- std::unordered_set<CORE_ADDR> addr_hash;
+ gdb::unordered_set<CORE_ADDR> addr_hash;
todo.push_back (verify_addr);
while (!todo.empty ())
(struct gdbarch *gdbarch,
gdb::unique_xmalloc_ptr<struct call_site_chain> *resultp,
std::vector<struct call_site *> &chain,
- std::unordered_set<CORE_ADDR> &addr_hash,
+ gdb::unordered_set<CORE_ADDR> &addr_hash,
struct call_site *call_site,
CORE_ADDR callee_pc)
{
paddress (gdbarch, save_callee_pc));
/* Mark CALL_SITEs so we do not visit the same ones twice. */
- std::unordered_set<CORE_ADDR> addr_hash;
+ gdb::unordered_set<CORE_ADDR> addr_hash;
/* Do not push CALL_SITE to CHAIN. Push there only the first tail call site
at the target's function. All the possible tail call sites in the
std::vector<const gdb_byte *> ops_to_visit;
/* Operations already visited. */
- std::unordered_set<const gdb_byte *> visited_ops;
+ gdb::unordered_set<const gdb_byte *> visited_ops;
/* Insert OP in OPS_TO_VISIT if it is within the expression's range and
hasn't been visited yet. */
std::vector<attr> attr_vec;
};
- std::unordered_map<ULONGEST, index_val> abbrev_map;
+ gdb::unordered_map<ULONGEST, index_val> abbrev_map;
/* Even though the scanning of .debug_names and creation of the cooked index
entries is done serially, we create multiple shards so that the
#include "producer.h"
#include <fcntl.h>
#include <algorithm>
-#include <unordered_map>
#include "gdbsupport/selftest.h"
#include "rust-lang.h"
#include "gdbsupport/pathstuff.h"
#include "count-one-bits.h"
-#include <unordered_set>
#include "dwarf2/abbrev-table-cache.h"
#include "cooked-index.h"
#include "gdbsupport/thread-pool.h"
/* Use caches to ensure we only call FUN once for each filename. */
filename_seen_cache filenames_cache;
- std::unordered_set<quick_file_names *> qfn_cache;
+ gdb::unordered_set<quick_file_names *> qfn_cache;
/* The rule is CUs specify all the files, including those used by any TU,
so there's no need to scan TUs here. We can ignore file names coming
/* We need a way to find the correct discriminant given a
variant name. For convenience we build a map here. */
struct type *enum_type = disr_field->type ();
- std::unordered_map<std::string_view, ULONGEST> discriminant_map;
+ gdb::unordered_map<std::string_view, ULONGEST> discriminant_map;
for (int i = 0; i < enum_type->num_fields (); ++i)
{
if (enum_type->field (i).loc_kind () == FIELD_LOC_KIND_ENUMVAL)
/* A convenience typedef that's used when finding the discriminant
field for a variant part. */
-typedef std::unordered_map<sect_offset, int> offset_map_type;
+using offset_map_type = gdb::unordered_map<sect_offset, int>;
/* Compute the discriminant range for a given variant. OBSTACK is
where the results will be stored. VARIANT is the variant to
#define GDB_DWARF2_READ_H
#include <queue>
-#include <unordered_map>
#include "dwarf2/comp-unit-head.h"
#include "dwarf2/file-and-dir.h"
#include "dwarf2/index-cache.h"
/* Mapping from abstract origin DIE to concrete DIEs that reference it as
DW_AT_abstract_origin. */
- std::unordered_map<sect_offset, std::vector<sect_offset>>
+ gdb::unordered_map<sect_offset, std::vector<sect_offset>>
abstract_to_concrete;
/* Current directory, captured at the moment that object this was
that the CU/TU has not been expanded yet. */
std::vector<compunit_symtab *> m_symtabs;
- /* Map from a type unit group to the corresponding unshared
- structure. */
- std::unordered_map<type_unit_group *, type_unit_group_unshareable_up>
+ /* Map from a type unit group to the corresponding unshared
+ structure. */
+ gdb::unordered_map<type_unit_group *, type_unit_group_unshareable_up>
m_type_units;
/* Map from signatured types to the corresponding struct type. */
- std::unordered_map<signatured_type *, struct type *> m_type_map;
+ gdb::unordered_map<signatured_type *, struct type *> m_type_map;
/* Map from the objfile-independent dwarf2_per_cu_data instances to the
corresponding objfile-dependent dwarf2_cu instances. */
- std::unordered_map<dwarf2_per_cu_data *, dwarf2_cu_up> m_dwarf2_cus;
+ gdb::unordered_map<dwarf2_per_cu_data *, dwarf2_cu_up> m_dwarf2_cus;
};
/* Converts DWARF language names to GDB language names. */