aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/index-write.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-09-22 14:50:27 +0200
committerTom de Vries <tdevries@suse.de>2022-09-22 14:50:27 +0200
commitaaf3f3f3bb38a59125ea34afa0ef7e0e14c2e916 (patch)
tree2cdc8093ac6cc472099fa965e576506b678fee2c /gdb/dwarf2/index-write.c
parent93547a56dcbec5c3c3d8707dba4e55545000766a (diff)
downloadfsf-binutils-gdb-aaf3f3f3bb38a59125ea34afa0ef7e0e14c2e916.zip
fsf-binutils-gdb-aaf3f3f3bb38a59125ea34afa0ef7e0e14c2e916.tar.gz
fsf-binutils-gdb-aaf3f3f3bb38a59125ea34afa0ef7e0e14c2e916.tar.bz2
[gdb/symtab] Add all_comp_units/all_type_units views on all_units
Add all_comp_units/all_type_units views on all_units. Having the views allows us to: - easily get the number of CUs or TUs in all_units, and - easily access the nth CU or TU. This minimizes the use of tu_stats.nr_tus. Tested on x86_64-linux.
Diffstat (limited to 'gdb/dwarf2/index-write.c')
-rw-r--r--gdb/dwarf2/index-write.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
index 09f1495..4cc0ee5 100644
--- a/gdb/dwarf2/index-write.c
+++ b/gdb/dwarf2/index-write.c
@@ -1286,9 +1286,8 @@ write_debug_names (dwarf2_per_objfile *per_objfile,
}
/* Verify that all units are represented. */
- gdb_assert (counter == (per_objfile->per_bfd->all_units.size ()
- - per_objfile->per_bfd->tu_stats.nr_tus));
- gdb_assert (types_counter == per_objfile->per_bfd->tu_stats.nr_tus);
+ gdb_assert (counter == per_objfile->per_bfd->all_comp_units.size ());
+ gdb_assert (types_counter == per_objfile->per_bfd->all_type_units.size ());
for (const cooked_index_entry *entry : table->all_entries ())
nametable.insert (entry);