]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Make load_cu return the loaded dwarf2_cu
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 8 Apr 2020 12:40:18 +0000 (08:40 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 12 May 2020 19:24:51 +0000 (15:24 -0400)
commit7d58fe143183d35acd8ed886c408fed2502d79c3
tree4ce936db6cca214c493653ca3a96aba22b59a3ee
parenta3ddd1a46c2f7ba70387d90ea2f6c16b5a9764b1
Make load_cu return the loaded dwarf2_cu

In a subsequent patch, the dwarf2_per_cu_data::cu link will be removed.
dwarf2_cu objects will instead need to be looked up from a per-objfile
map, using the dwarf2_per_cu_data object as the key.

To make it easier for some callers, this patch makes load_cu return the
dwarf2_cu it creates.  If the caller needs to use the created dwarf2_cu,
it will have it available right away, rather than having to do a map
lookup.

At the same time, this allows changing queue_and_load_all_dwo_tus to
take a dwarf2_cu instead of a dwarf2_per_cu_data.

gdb/ChangeLog:

* dwarf2/read.c (load_cu): Return dwarf2_cu.
(dw2_do_instantiate_symtab): Update.
(queue_and_load_all_dwo_tus): Change parameter from
dwarf2_per_cu_data to dwarf2_cu.
(dwarf2_fetch_die_loc_sect_off): Update.
(dwarf2_fetch_constant_bytes): Update.
(dwarf2_fetch_die_type_sect_off): Update.
gdb/dwarf2/read.c