From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 8C8593858299; Thu, 22 Sep 2022 12:50:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C8593858299 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663851031; bh=lbYwaUpjdUQauC28TxKYBbxAxpIYUBrvTjBrfgLo/yM=; h=From:To:Subject:Date:From; b=R/ona5vzDhEV18/wp3xeQfsoPSeouGu+TBLGb7PlLJPHiWCo+jyByLJYi4RcQT8Ol gmqG7eo1MIkbn0Ev1ytvQSiRHyWJfrbT4NBidRi6njCQd8jbSeS2sxg6MIR2NT/cOa FH1tPZTmej80NpL4+9mRDYnQBgZNFm2t9fMIpb8g= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/symtab] Rename all_comp_units to all_units X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 3b8e069a3691adc1a93ca7f4bcb5e8e687317108 X-Git-Newrev: 93547a56dcbec5c3c3d8707dba4e55545000766a Message-Id: <20220922125031.8C8593858299@sourceware.org> Date: Thu, 22 Sep 2022 12:50:31 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D93547a56dcbe= c5c3c3d8707dba4e55545000766a commit 93547a56dcbec5c3c3d8707dba4e55545000766a Author: Tom de Vries Date: Thu Sep 22 14:50:27 2022 +0200 [gdb/symtab] Rename all_comp_units to all_units =20 Mechanically rename all_comp_units to all_units: ... $ sed -i 's/all_comp_units/all_units/' gdb/dwarf2/* ... =20 Tested on x86_64-linux. Diff: --- gdb/dwarf2/index-write.c | 20 +++---- gdb/dwarf2/read.c | 150 +++++++++++++++++++++++--------------------= ---- gdb/dwarf2/read.h | 4 +- 3 files changed, 87 insertions(+), 87 deletions(-) diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index b6d8dddafd3..09f14953bf8 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -1025,7 +1025,7 @@ private: static bool check_dwarf64_offsets (dwarf2_per_objfile *per_objfile) { - for (const auto &per_cu : per_objfile->per_bfd->all_comp_units) + for (const auto &per_cu : per_objfile->per_bfd->all_units) { if (to_underlying (per_cu->sect_off) >=3D (static_cast (1) << 32)) @@ -1176,28 +1176,28 @@ write_gdbindex (dwarf2_per_objfile *per_objfile, in the index file). This will later be needed to write the address table. */ cu_index_map cu_index_htab; - cu_index_htab.reserve (per_objfile->per_bfd->all_comp_units.size ()); + cu_index_htab.reserve (per_objfile->per_bfd->all_units.size ()); =20 /* Store out the .debug_type CUs, if any. */ data_buf types_cu_list; =20 /* The CU list is already sorted, so we don't need to do additional work here. Also, the debug_types entries do not appear in - all_comp_units, but only in their own hash table. */ + all_units, but only in their own hash table. */ =20 int counter =3D 0; int types_counter =3D 0; - for (int i =3D 0; i < per_objfile->per_bfd->all_comp_units.size (); ++i) + for (int i =3D 0; i < per_objfile->per_bfd->all_units.size (); ++i) { dwarf2_per_cu_data *per_cu - =3D per_objfile->per_bfd->all_comp_units[i].get (); + =3D per_objfile->per_bfd->all_units[i].get (); =20 int &this_counter =3D per_cu->is_debug_types ? types_counter : count= er; =20 const auto insertpair =3D cu_index_htab.emplace (per_cu, this_counte= r); gdb_assert (insertpair.second); =20 - /* The all_comp_units list contains CUs read from the objfile as wel= l as + /* The all_units list contains CUs read from the objfile as well as from the eventual dwz file. We need to place the entry in the corresponding index. */ data_buf &cu_list =3D (per_cu->is_debug_types @@ -1264,16 +1264,16 @@ write_debug_names (dwarf2_per_objfile *per_objfile, =20 /* The CU list is already sorted, so we don't need to do additional work here. Also, the debug_types entries do not appear in - all_comp_units, but only in their own hash table. */ + all_units, but only in their own hash table. */ data_buf cu_list; data_buf types_cu_list; debug_names nametable (per_objfile, dwarf5_is_dwarf64, dwarf5_byte_order= ); int counter =3D 0; int types_counter =3D 0; - for (int i =3D 0; i < per_objfile->per_bfd->all_comp_units.size (); ++i) + for (int i =3D 0; i < per_objfile->per_bfd->all_units.size (); ++i) { dwarf2_per_cu_data *per_cu - =3D per_objfile->per_bfd->all_comp_units[i].get (); + =3D per_objfile->per_bfd->all_units[i].get (); =20 int &this_counter =3D per_cu->is_debug_types ? types_counter : count= er; data_buf &this_list =3D per_cu->is_debug_types ? types_cu_list : cu_= list; @@ -1286,7 +1286,7 @@ write_debug_names (dwarf2_per_objfile *per_objfile, } =20 /* Verify that all units are represented. */ - gdb_assert (counter =3D=3D (per_objfile->per_bfd->all_comp_units.size () + gdb_assert (counter =3D=3D (per_objfile->per_bfd->all_units.size () - per_objfile->per_bfd->tu_stats.nr_tus)); gdb_assert (types_counter =3D=3D per_objfile->per_bfd->tu_stats.nr_tus); =20 diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 0ad9bda8772..8697fba55ea 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -1201,7 +1201,7 @@ static void prepare_one_comp_unit (struct dwarf2_cu *= cu, static struct type *set_die_type (struct die_info *, struct type *, struct dwarf2_cu *, bool =3D false); =20 -static void create_all_comp_units (dwarf2_per_objfile *per_objfile); +static void create_all_units (dwarf2_per_objfile *per_objfile); =20 static void load_full_comp_unit (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, @@ -1384,21 +1384,21 @@ line_header_eq_voidp (const void *item_lhs, const v= oid *item_rhs) =20 =0C =20 -/* An iterator for all_comp_units that is based on index. This - approach makes it possible to iterate over all_comp_units safely, +/* An iterator for all_units that is based on index. This + approach makes it possible to iterate over all_units safely, when some caller in the loop may add new units. */ =20 -class all_comp_units_iterator +class all_units_iterator { public: =20 - all_comp_units_iterator (dwarf2_per_bfd *per_bfd, bool start) + all_units_iterator (dwarf2_per_bfd *per_bfd, bool start) : m_per_bfd (per_bfd), - m_index (start ? 0 : per_bfd->all_comp_units.size ()) + m_index (start ? 0 : per_bfd->all_units.size ()) { } =20 - all_comp_units_iterator &operator++ () + all_units_iterator &operator++ () { ++m_index; return *this; @@ -1409,13 +1409,13 @@ public: return m_per_bfd->get_cu (m_index); } =20 - bool operator=3D=3D (const all_comp_units_iterator &other) const + bool operator=3D=3D (const all_units_iterator &other) const { return m_index =3D=3D other.m_index; } =20 =20 - bool operator!=3D (const all_comp_units_iterator &other) const + bool operator!=3D (const all_units_iterator &other) const { return m_index !=3D other.m_index; } @@ -1426,24 +1426,24 @@ private: size_t m_index; }; =20 -/* A range adapter for the all_comp_units_iterator. */ -class all_comp_units_range +/* A range adapter for the all_units_iterator. */ +class all_units_range { public: =20 - all_comp_units_range (dwarf2_per_bfd *per_bfd) + all_units_range (dwarf2_per_bfd *per_bfd) : m_per_bfd (per_bfd) { } =20 - all_comp_units_iterator begin () + all_units_iterator begin () { - return all_comp_units_iterator (m_per_bfd, true); + return all_units_iterator (m_per_bfd, true); } =20 - all_comp_units_iterator end () + all_units_iterator end () { - return all_comp_units_iterator (m_per_bfd, false); + return all_units_iterator (m_per_bfd, false); } =20 private: @@ -1467,7 +1467,7 @@ dwarf2_per_bfd::dwarf2_per_bfd (bfd *obfd, const dwar= f2_debug_sections *names, =20 dwarf2_per_bfd::~dwarf2_per_bfd () { - for (auto &per_cu : all_comp_units) + for (auto &per_cu : all_units) { per_cu->imported_symtabs_free (); per_cu->free_cached_file_names (); @@ -2096,7 +2096,7 @@ dwarf2_per_bfd::allocate_per_cu () { dwarf2_per_cu_data_up result (new dwarf2_per_cu_data); result->per_bfd =3D this; - result->index =3D all_comp_units.size (); + result->index =3D all_units.size (); return result; } =20 @@ -2107,7 +2107,7 @@ dwarf2_per_bfd::allocate_signatured_type (ULONGEST si= gnature) { signatured_type_up result (new signatured_type (signature)); result->per_bfd =3D this; - result->index =3D all_comp_units.size (); + result->index =3D all_units.size (); result->is_debug_types =3D true; tu_stats.nr_tus++; return result; @@ -2151,7 +2151,7 @@ create_cus_from_index_list (dwarf2_per_bfd *per_bfd, dwarf2_per_cu_data_up per_cu =3D create_cu_from_index_list (per_bfd, section, is_dwz, sect_off, length); - per_bfd->all_comp_units.push_back (std::move (per_cu)); + per_bfd->all_units.push_back (std::move (per_cu)); } } =20 @@ -2163,8 +2163,8 @@ create_cus_from_index (dwarf2_per_bfd *per_bfd, const gdb_byte *cu_list, offset_type cu_list_elements, const gdb_byte *dwz_list, offset_type dwz_elements) { - gdb_assert (per_bfd->all_comp_units.empty ()); - per_bfd->all_comp_units.reserve ((cu_list_elements + dwz_elements) / 2); + gdb_assert (per_bfd->all_units.empty ()); + per_bfd->all_units.reserve ((cu_list_elements + dwz_elements) / 2); =20 create_cus_from_index_list (per_bfd, cu_list, cu_list_elements, &per_bfd->info, 0); @@ -2210,7 +2210,7 @@ create_signatured_type_table_from_index slot =3D htab_find_slot (sig_types_hash.get (), sig_type.get (), INS= ERT); *slot =3D sig_type.get (); =20 - per_bfd->all_comp_units.emplace_back (sig_type.release ()); + per_bfd->all_units.emplace_back (sig_type.release ()); } =20 per_bfd->signatured_types =3D std::move (sig_types_hash); @@ -2258,7 +2258,7 @@ create_signatured_type_table_from_debug_names slot =3D htab_find_slot (sig_types_hash.get (), sig_type.get (), INS= ERT); *slot =3D sig_type.get (); =20 - per_objfile->per_bfd->all_comp_units.emplace_back (sig_type.release = ()); + per_objfile->per_bfd->all_units.emplace_back (sig_type.release ()); } =20 per_objfile->per_bfd->signatured_types =3D std::move (sig_types_hash); @@ -2301,7 +2301,7 @@ create_addrmap_from_index (dwarf2_per_objfile *per_ob= jfile, continue; } =20 - if (cu_index >=3D per_bfd->all_comp_units.size ()) + if (cu_index >=3D per_bfd->all_units.size ()) { complaint (_(".gdb_index address table has invalid CU number %u"), (unsigned) cu_index); @@ -2336,7 +2336,7 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_ob= jfile, dwarf2_per_cu_data *, gdb::hash_enum> debug_info_offset_to_per_cu; - for (const auto &per_cu : per_bfd->all_comp_units) + for (const auto &per_cu : per_bfd->all_units) { /* A TU will not need aranges, and skipping them here is an easy way of ignoring .debug_types -- and possibly seeing a @@ -2349,7 +2349,7 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_ob= jfile, =3D debug_info_offset_to_per_cu.emplace (per_cu->sect_off, per_cu.get ()); =20 - /* Assume no duplicate offsets in all_comp_units. */ + /* Assume no duplicate offsets in all_units. */ gdb_assert (insertpair.second); } =20 @@ -2709,7 +2709,7 @@ dwarf2_read_gdb_index index. */ if (per_bfd->types.size () > 1) { - per_bfd->all_comp_units.clear (); + per_bfd->all_units.clear (); return 0; } =20 @@ -2726,7 +2726,7 @@ dwarf2_read_gdb_index =20 per_bfd->index_table =3D std::move (map); per_bfd->quick_file_names_table =3D - create_quick_file_names_table (per_bfd->all_comp_units.size ()); + create_quick_file_names_table (per_bfd->all_units.size ()); =20 return 1; } @@ -2881,7 +2881,7 @@ dwarf2_base_index_functions::find_last_source_symtab = (struct objfile *objfile) { dwarf2_per_objfile *per_objfile =3D get_dwarf2_per_objfile (objfile); dwarf2_per_cu_data *dwarf_cu - =3D per_objfile->per_bfd->all_comp_units.back ().get (); + =3D per_objfile->per_bfd->all_units.back ().get (); compunit_symtab *cust =3D dw2_instantiate_symtab (dwarf_cu, per_objfile,= false); =20 if (cust =3D=3D NULL) @@ -2918,7 +2918,7 @@ dwarf2_base_index_functions::forget_cached_source_info { dwarf2_per_objfile *per_objfile =3D get_dwarf2_per_objfile (objfile); =20 - for (auto &per_cu : per_objfile->per_bfd->all_comp_units) + for (auto &per_cu : per_objfile->per_bfd->all_units) per_cu->free_cached_file_names (); } =20 @@ -2993,7 +2993,7 @@ dw2_symtab_iter_next (struct dw2_symtab_iterator *ite= r, && symbol_kind !=3D GDB_INDEX_SYMBOL_KIND_NONE); =20 /* Don't crash on bad data. */ - if (cu_index >=3D per_objfile->per_bfd->all_comp_units.size ()) + if (cu_index >=3D per_objfile->per_bfd->all_units.size ()) { complaint (_(".gdb_index entry has bad CU index" " [in module %s]"), objfile_name (per_objfile->objfile)); @@ -3074,7 +3074,7 @@ dwarf2_base_index_functions::print_stats (struct objf= ile *objfile, return; =20 dwarf2_per_objfile *per_objfile =3D get_dwarf2_per_objfile (objfile); - int total =3D per_objfile->per_bfd->all_comp_units.size (); + int total =3D per_objfile->per_bfd->all_units.size (); int count =3D 0; =20 for (int i =3D 0; i < total; ++i) @@ -3108,7 +3108,7 @@ void dwarf2_base_index_functions::expand_all_symtabs (struct objfile *objfile) { dwarf2_per_objfile *per_objfile =3D get_dwarf2_per_objfile (objfile); - int total_units =3D per_objfile->per_bfd->all_comp_units.size (); + int total_units =3D per_objfile->per_bfd->all_units.size (); =20 for (int i =3D 0; i < total_units; ++i) { @@ -4071,7 +4071,7 @@ dw2_expand_marked_cus } =20 /* Don't crash on bad data. */ - if (cu_index >=3D per_objfile->per_bfd->all_comp_units.size ()) + if (cu_index >=3D per_objfile->per_bfd->all_units.size ()) { complaint (_(".gdb_index entry has bad CU index" " [in module %s]"), objfile_name (per_objfile->objfile)); @@ -4109,7 +4109,7 @@ dw_expand_symtabs_matching_file_matcher /* The rule is CUs specify all the files, including those used by any TU, so there's no need to scan TUs here. */ =20 - for (const auto &per_cu : per_objfile->per_bfd->all_comp_units) + for (const auto &per_cu : per_objfile->per_bfd->all_units) { QUIT; =20 @@ -4208,7 +4208,7 @@ dwarf2_gdb_index::expand_symtabs_matching if (lookup_name =3D=3D nullptr) { for (dwarf2_per_cu_data *per_cu - : all_comp_units_range (per_objfile->per_bfd)) + : all_units_range (per_objfile->per_bfd)) { QUIT; =20 @@ -4326,7 +4326,7 @@ dwarf2_base_index_functions::map_symbol_filenames reuse the file names data from a currently unexpanded CU, in this case we don't want to report the files from the unexpanded CU. */ =20 - for (const auto &per_cu : per_objfile->per_bfd->all_comp_units) + for (const auto &per_cu : per_objfile->per_bfd->all_units) { if (!per_cu->is_debug_types && per_objfile->symtab_set_p (per_cu.get ())) @@ -4337,7 +4337,7 @@ dwarf2_base_index_functions::map_symbol_filenames } =20 for (dwarf2_per_cu_data *per_cu - : all_comp_units_range (per_objfile->per_bfd)) + : all_units_range (per_objfile->per_bfd)) { /* We only need to look at symtabs not already expanded. */ if (per_cu->is_debug_types || per_objfile->symtab_set_p (per_cu)) @@ -4397,7 +4397,7 @@ dwarf2_base_index_functions::has_unexpanded_symtabs (= struct objfile *objfile) { dwarf2_per_objfile *per_objfile =3D get_dwarf2_per_objfile (objfile); =20 - for (const auto &per_cu : per_objfile->per_bfd->all_comp_units) + for (const auto &per_cu : per_objfile->per_bfd->all_units) { /* Is this already expanded? */ if (per_objfile->symtab_set_p (per_cu.get ())) @@ -4625,7 +4625,7 @@ create_cus_from_debug_names_list (dwarf2_per_bfd *per= _bfd, dwarf2_per_cu_data_up per_cu =3D create_cu_from_index_list (per_bfd, §ion, is_dwz, sect_off, 0); - per_bfd->all_comp_units.push_back (std::move (per_cu)); + per_bfd->all_units.push_back (std::move (per_cu)); } return true; } @@ -4664,7 +4664,7 @@ create_cus_from_debug_names_list (dwarf2_per_bfd *per= _bfd, dwarf2_per_cu_data_up per_cu =3D create_cu_from_index_list (per_bfd, §ion, is_dwz, sect_off_prev, length); - per_bfd->all_comp_units.push_back (std::move (per_cu)); + per_bfd->all_units.push_back (std::move (per_cu)); } sect_off_prev =3D sect_off_next; } @@ -4680,8 +4680,8 @@ create_cus_from_debug_names (dwarf2_per_bfd *per_bfd, const mapped_debug_names &map, const mapped_debug_names &dwz_map) { - gdb_assert (per_bfd->all_comp_units.empty ()); - per_bfd->all_comp_units.reserve (map.cu_count + dwz_map.cu_count); + gdb_assert (per_bfd->all_units.empty ()); + per_bfd->all_units.reserve (map.cu_count + dwz_map.cu_count); =20 if (!create_cus_from_debug_names_list (per_bfd, map, per_bfd->info, false /* is_dwz */)) @@ -4731,7 +4731,7 @@ dwarf2_read_debug_names (dwarf2_per_objfile *per_objf= ile) =20 if (!create_cus_from_debug_names (per_bfd, *map, dwz_map)) { - per_bfd->all_comp_units.clear (); + per_bfd->all_units.clear (); return false; } =20 @@ -4741,7 +4741,7 @@ dwarf2_read_debug_names (dwarf2_per_objfile *per_objf= ile) index. */ if (per_bfd->types.size () > 1) { - per_bfd->all_comp_units.clear (); + per_bfd->all_units.clear (); return false; } =20 @@ -4758,7 +4758,7 @@ dwarf2_read_debug_names (dwarf2_per_objfile *per_objf= ile) =20 per_bfd->index_table =3D std::move (map); per_bfd->quick_file_names_table =3D - create_quick_file_names_table (per_bfd->all_comp_units.size ()); + create_quick_file_names_table (per_bfd->all_units.size ()); =20 return true; } @@ -5017,7 +5017,7 @@ dw2_debug_names_iterator::next () case DW_IDX_compile_unit: { /* Don't crash on bad data. */ - int nr_cus =3D (per_bfd->all_comp_units.size () + int nr_cus =3D (per_bfd->all_units.size () - per_bfd->tu_stats.nr_tus); if (ull >=3D nr_cus) { @@ -5041,7 +5041,7 @@ dw2_debug_names_iterator::next () continue; } { - int nr_cus =3D (per_bfd->all_comp_units.size () + int nr_cus =3D (per_bfd->all_units.size () - per_bfd->tu_stats.nr_tus); per_cu =3D per_bfd->get_cu (nr_cus + ull); } @@ -5254,7 +5254,7 @@ dwarf2_debug_names_index::expand_symtabs_matching if (lookup_name =3D=3D nullptr) { for (dwarf2_per_cu_data *per_cu - : all_comp_units_range (per_objfile->per_bfd)) + : all_units_range (per_objfile->per_bfd)) { QUIT; =20 @@ -5365,9 +5365,9 @@ dwarf2_initialize_objfile (struct objfile *objfile) { dwarf_read_debug_printf ("readnow requested"); =20 - create_all_comp_units (per_objfile); + create_all_units (per_objfile); per_bfd->quick_file_names_table - =3D create_quick_file_names_table (per_bfd->all_comp_units.size ()); + =3D create_quick_file_names_table (per_bfd->all_units.size ()); =20 objfile->qf.emplace_front (new readnow_functions); return; @@ -5662,15 +5662,15 @@ create_debug_types_hash_table (dwarf2_per_objfile *= per_objfile, static struct signatured_type * add_type_unit (dwarf2_per_objfile *per_objfile, ULONGEST sig, void **slot) { - if (per_objfile->per_bfd->all_comp_units.size () - =3D=3D per_objfile->per_bfd->all_comp_units.capacity ()) + if (per_objfile->per_bfd->all_units.size () + =3D=3D per_objfile->per_bfd->all_units.capacity ()) ++per_objfile->per_bfd->tu_stats.nr_all_type_units_reallocs; =20 signatured_type_up sig_type_holder =3D per_objfile->per_bfd->allocate_signatured_type (sig); signatured_type *sig_type =3D sig_type_holder.get (); =20 - per_objfile->per_bfd->all_comp_units.emplace_back + per_objfile->per_bfd->all_units.emplace_back (sig_type_holder.release ()); =20 if (slot =3D=3D NULL) @@ -6942,12 +6942,12 @@ build_type_psymtabs (dwarf2_per_objfile *per_objfil= e, =20 dwarf_read_debug_printf ("Building type unit groups ..."); =20 - /* Sort in a separate table to maintain the order of all_comp_units + /* Sort in a separate table to maintain the order of all_units for .gdb_index: TU indices directly index all_type_units. */ std::vector sorted_by_abbrev; sorted_by_abbrev.reserve (per_objfile->per_bfd->tu_stats.nr_tus); =20 - for (const auto &cu : per_objfile->per_bfd->all_comp_units) + for (const auto &cu : per_objfile->per_bfd->all_units) { if (cu->is_debug_types) { @@ -7032,7 +7032,7 @@ process_skeletonless_type_unit (void **slot, void *in= fo) if (*slot !=3D NULL) return 1; =20 - /* This does the job that create_all_comp_units would have done for + /* This does the job that create_all_units would have done for this TU. */ signatured_type *entry =3D add_type_unit (data->per_objfile, dwo_unit->signature, slot); @@ -7096,12 +7096,12 @@ dwarf2_build_psymtabs_hard (dwarf2_per_objfile *per= _objfile) per_bfd->map_info_sections (objfile); =20 cooked_index_storage index_storage; - create_all_comp_units (per_objfile); + create_all_units (per_objfile); build_type_psymtabs (per_objfile, &index_storage); std::vector> indexes; =20 per_bfd->quick_file_names_table - =3D create_quick_file_names_table (per_bfd->all_comp_units.size ()); + =3D create_quick_file_names_table (per_bfd->all_units.size ()); if (!per_bfd->debug_aranges.empty ()) read_addrmap_from_aranges (per_objfile, &per_bfd->debug_aranges, index_storage.get_addrmap ()); @@ -7110,7 +7110,7 @@ dwarf2_build_psymtabs_hard (dwarf2_per_objfile *per_o= bjfile) /* Ensure that complaints are handled correctly. */ complaint_interceptor complaint_handler; =20 - using iter_type =3D decltype (per_bfd->all_comp_units.begin ()); + using iter_type =3D decltype (per_bfd->all_units.begin ()); =20 auto task_size_ =3D [] (iter_type iter) { @@ -7127,8 +7127,8 @@ dwarf2_build_psymtabs_hard (dwarf2_per_objfile *per_o= bjfile) using result_type =3D std::pair, std::vector>; std::vector results - =3D gdb::parallel_for_each (1, per_bfd->all_comp_units.begin (), - per_bfd->all_comp_units.end (), + =3D gdb::parallel_for_each (1, per_bfd->all_units.begin (), + per_bfd->all_units.end (), [=3D] (iter_type iter, iter_type end) { std::vector errors; @@ -7255,7 +7255,7 @@ read_comp_units_from_section (dwarf2_per_objfile *per= _objfile, this_cu->set_version (cu_header.version); =20 info_ptr =3D info_ptr + this_cu->length (); - per_objfile->per_bfd->all_comp_units.push_back (std::move (this_cu)); + per_objfile->per_bfd->all_units.push_back (std::move (this_cu)); } } =20 @@ -7263,10 +7263,10 @@ read_comp_units_from_section (dwarf2_per_objfile *p= er_objfile, This is only done for -readnow and building partial symtabs. */ =20 static void -create_all_comp_units (dwarf2_per_objfile *per_objfile) +create_all_units (dwarf2_per_objfile *per_objfile) { htab_up types_htab; - gdb_assert (per_objfile->per_bfd->all_comp_units.empty ()); + gdb_assert (per_objfile->per_bfd->all_units.empty ()); =20 read_comp_units_from_section (per_objfile, &per_objfile->per_bfd->info, &per_objfile->per_bfd->abbrev, 0, @@ -18639,7 +18639,7 @@ cooked_index_functions::expand_symtabs_matching if (lookup_name =3D=3D nullptr) { for (dwarf2_per_cu_data *per_cu - : all_comp_units_range (per_objfile->per_bfd)) + : all_units_range (per_objfile->per_bfd)) { QUIT; =20 @@ -23532,18 +23532,18 @@ static int dwarf2_find_containing_comp_unit (sect_offset sect_off, unsigned int offset_in_dwz, - const std::vector &all_comp_units) + const std::vector &all_units) { int low, high; =20 low =3D 0; - high =3D all_comp_units.size () - 1; + high =3D all_units.size () - 1; while (high > low) { struct dwarf2_per_cu_data *mid_cu; int mid =3D low + (high - low) / 2; =20 - mid_cu =3D all_comp_units[mid].get (); + mid_cu =3D all_units[mid].get (); if (mid_cu->is_dwz > offset_in_dwz || (mid_cu->is_dwz =3D=3D offset_in_dwz && mid_cu->sect_off + mid_cu->length () > sect_off)) @@ -23564,8 +23564,8 @@ dwarf2_find_containing_comp_unit (sect_offset sect_= off, dwarf2_per_bfd *per_bfd) { int low =3D dwarf2_find_containing_comp_unit - (sect_off, offset_in_dwz, per_bfd->all_comp_units); - dwarf2_per_cu_data *this_cu =3D per_bfd->all_comp_units[low].get (); + (sect_off, offset_in_dwz, per_bfd->all_units); + dwarf2_per_cu_data *this_cu =3D per_bfd->all_units[low].get (); =20 if (this_cu->is_dwz !=3D offset_in_dwz || this_cu->sect_off > sect_off) { @@ -23575,13 +23575,13 @@ dwarf2_find_containing_comp_unit (sect_offset sec= t_off, sect_offset_str (sect_off), bfd_get_filename (per_bfd->obfd)); =20 - gdb_assert (per_bfd->all_comp_units[low-1]->sect_off + gdb_assert (per_bfd->all_units[low-1]->sect_off <=3D sect_off); - return per_bfd->all_comp_units[low - 1].get (); + return per_bfd->all_units[low - 1].get (); } else { - if (low =3D=3D per_bfd->all_comp_units.size () - 1 + if (low =3D=3D per_bfd->all_units.size () - 1 && sect_off >=3D this_cu->sect_off + this_cu->length ()) error (_("invalid dwarf2 offset %s"), sect_offset_str (sect_off)); gdb_assert (sect_off < this_cu->sect_off + this_cu->length ()); diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index c2f86a9d367..ce4fe52f4a2 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -433,7 +433,7 @@ struct dwarf2_per_bfd /* Return the CU given its index. */ dwarf2_per_cu_data *get_cu (int index) const { - return this->all_comp_units[index].get (); + return this->all_units[index].get (); } =20 /* A convenience function to allocate a dwarf2_per_cu_data. The @@ -489,7 +489,7 @@ public: =20 /* Table of all the compilation units. This is used to locate the target compilation unit of a particular reference. */ - std::vector all_comp_units; + std::vector all_units; =20 /* Table of struct type_unit_group objects. The hash key is the DW_AT_stmt_list value. */