Pass existing_cu object to cutu_reader
It is possible, seemingly for a special case described in
find_partial_die, for cutu_reader to re-use an existing dwarf2_cu
instead of creating a new one. This happens when running this test, for
example:
make check TESTS="gdb.dwarf2/fission-reread.exp"
Right now the, `use_existing_cu` flag tells cutu_reader to use the
dwarf2_cu object at dwarf2_per_cu_data::cu. However, we'll remove that
field, so we need to find another solution.
This situation arises when some caller up the stack has already created
the dwarf2_cu to read a dwarf2_per_cu_data, but needs to re-read it with
some other parameters. Therefore, it's possible to just have that
caller pass down the dwarf2_cu object to use as a `existing_cu`
parameter. If `existing_cu` is NULL, it tells cutu_reader that it needs
to instantiate a new one.
gdb/ChangeLog:
* dwarf2/read.c (class cutu_reader) <cutu_reader>: Replace
`int use_existing_cu` parameter with `dwarf2_cu *existing_cu`.
(init_tu_and_read_dwo_dies): Likewise.
(cutu_reader::init_tu_and_read_dwo_dies): Likewise.
(cutu_reader::cutu_reader): Likewise.
(load_partial_comp_unit): Likewise.
(process_psymtab_comp_unit): Update.
(build_type_psymtabs_1): Update.
(process_skeletonless_type_unit): Update.
(load_full_comp_unit): Update.
(find_partial_die): Update.
(dwarf2_read_addr_index): Update.
(read_signatured_type): Update.
Change-Id: Id03e3bc3de3cf99d9e4b4080ad83b029c93bf434