From: Simon Marchi Date: Wed, 12 Feb 2025 15:52:51 +0000 (-0500) Subject: gdb/dwarf: use term "shard" instead of "index" X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c6898a825b4766a1ee71e782f9d5d66aa88804a;p=thirdparty%2Fbinutils-gdb.git gdb/dwarf: use term "shard" instead of "index" A bit more changes as in 8e745eac7db3 ("gdb/dwarf: rename cooked_index::m_vector to m_shards"). I think it's clearer if the term "index" is reserved for the whole thing, while "shard" or "index shard" are used for the parts. Change-Id: I457bb0016a70f3f9918f4a3c3977262a7801705b Approved-By: Tom Tromey --- diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index b7a38b8367d..4ab1adbe05e 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -400,7 +400,7 @@ public: cooked_index_entry_ref parent_entry, dwarf2_per_cu_data *per_cu) { - return m_index->add (die_offset, tag, flags, per_cu->lang (), + return m_shard->add (die_offset, tag, flags, per_cu->lang (), name, parent_entry, per_cu); } @@ -408,8 +408,8 @@ public: then transfer ownership of the index to the caller. */ std::unique_ptr release () { - m_index->install_addrmap (&m_addrmap); - return std::move (m_index); + m_shard->install_addrmap (&m_addrmap); + return std::move (m_shard); } /* Return the mutable addrmap that is currently being created. */ @@ -445,7 +445,7 @@ private: /* A hash table of cutu_reader objects. */ htab_up m_reader_hash; /* The index shard that is being constructed. */ - std::unique_ptr m_index; + std::unique_ptr m_shard; /* Parent map for each CU that is read. */ parent_map m_parent_map; diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6bd9c4ddd70..9b10c7fb8f5 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -3640,7 +3640,7 @@ cooked_index_storage::cooked_index_storage () eq_cutu_reader, htab_delete_entry, xcalloc, xfree)), - m_index (new cooked_index_shard) + m_shard (new cooked_index_shard) { } @@ -4204,18 +4204,19 @@ cooked_index_debug_info::done_reading () { /* Only handle the scanning results here. Complaints and exceptions can only be dealt with on the main thread. */ - std::vector> indexes; + std::vector> shards; + for (auto &one_result : m_results) { - indexes.push_back (std::move (std::get<0> (one_result))); + shards.push_back (std::move (std::get<0> (one_result))); m_all_parents_map.add_map (std::get<3> (one_result)); } /* This has to wait until we read the CUs, we need the list of DWOs. */ process_skeletonless_type_units (m_per_objfile, &m_index_storage); - indexes.push_back (m_index_storage.release ()); - indexes.shrink_to_fit (); + shards.push_back (m_index_storage.release ()); + shards.shrink_to_fit (); m_all_parents_map.add_map (m_index_storage.release_parent_map ()); @@ -4223,7 +4224,7 @@ cooked_index_debug_info::done_reading () cooked_index *table = (gdb::checked_static_cast (per_bfd->index_table.get ())); - table->set_contents (std::move (indexes), &m_warnings, + table->set_contents (std::move (shards), &m_warnings, &m_all_parents_map); }