]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add dwarf2_per_objfile parameter to cutu_reader's constructors
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 8 Apr 2020 14:21:46 +0000 (10:21 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 12 May 2020 19:24:50 +0000 (15:24 -0400)
commit9fb9ca853da2381d997c4fa689f05da4c6f3a1de
tree972e7c1a3ff8c99e0d1591c9affab73fddb5dec4
parentbf1c1db5b2bc4410f670005c6c0b537ef3a4fedd
Add dwarf2_per_objfile parameter to cutu_reader's constructors

The cutu_reader type is used for reading the CU represented by the
passed dwarf2_per_cu_data object.  This reading is done in the context
of a given obfile, which is currently the one associated to the passed
dwarf2_per_cu_data object.  Since the dwarf2_per_cu_data type will
become objfile-independent, we will need to pass the objfile separately.

This patch therefore adds a dwarf2_per_objfile parameter to the
cutu_reader constructors, as well as to their callers, up until the
point where we can get the dwarf2_per_objfile object from somewhere
else.  In the end, this allows removing the reference to
dwarf2_per_cu_data::dwarf2_per_objfile in cutu_reader::cutu_reader.

A few dwarf2_per_cu_data::dwarf2_per_objfile references are added (e.g.
in dwarf2_fetch_die_type_sect_off).  This is temporary, this will be
removed once these functions will get re-worked in subsequent patches.

gdb/ChangeLog:

* dwarf2/read.c (class cutu_reader) <cutu_reader>: Add
per_objfile parameter.
(load_full_type_unit): Add per_objfile parameter.
(read_signatured_type): Likewise.
(load_full_comp_unit): Likewise.
(load_cu): Likewise.
(dw2_do_instantiate_symtab): Likewise.
(dw2_get_file_names): Likewise.
(dw2_map_symtabs_matching_filename): Update.
(dw_expand_symtabs_matching_file_matcher): Update.
(dw2_map_symbol_filenames): Update.
(process_psymtab_comp_unit): Add per_objfile parameter.
(build_type_psymtabs_1): Update.
(process_skeletonless_type_unit): Update.
(dwarf2_build_psymtabs_hard): Update.
(load_partial_comp_unit): Add per_objfile parameter.
(scan_partial_symbols): Update.
(load_full_comp_unit): Add per_objfile parameter.
(process_imported_unit_die): Update.
(create_cus_hash_table): Update.
(find_partial_die): Update.
(dwarf2_read_addr_index): Update.
(follow_die_offset): Update.
(dwarf2_fetch_die_loc_sect_off): Update.
(dwarf2_fetch_constant_bytes): Update.
(dwarf2_fetch_die_type_sect_off): Update.
(follow_die_sig_1): Update.
(load_full_type_unit): Add per_objfile parameter.
(read_signatured_type): Likewise.
gdb/dwarf2/read.c