[gdb/symtab] Add all_comp_units/all_type_units views on all_units
authorTom de Vries <tdevries@suse.de>
Thu, 22 Sep 2022 12:50:27 +0000 (14:50 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 22 Sep 2022 12:50:27 +0000 (14:50 +0200)
commitaaf3f3f3bb38a59125ea34afa0ef7e0e14c2e916
tree2cdc8093ac6cc472099fa965e576506b678fee2c
parent93547a56dcbec5c3c3d8707dba4e55545000766a
[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.
gdb/dwarf2/index-write.c
gdb/dwarf2/read.c
gdb/dwarf2/read.h