]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Make dwarf2_get_dwz_file take a dwarf2_per_bfd
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 6 Apr 2020 16:55:09 +0000 (12:55 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 12 May 2020 19:24:50 +0000 (15:24 -0400)
commit1d2852ed0a155ecefd754eea5704f81bb81db2ad
tree0fb78c0af5ade1d85af3fd257fd58e4ba0a33892
parent89b41af1b1bd607c43c071b39c0500e221675780
Make dwarf2_get_dwz_file take a dwarf2_per_bfd

This allows removing a per_bfd->dwarf2_per_objfile reference in
get_abbrev_section_for_cu.

This requires saving the bfd in dwarf2_per_bfd.  The constructor of
dwarf2_per_bfd already accepts the bfd, so it's just a matter of saving
it in a field.

I replaced uses of objfile_name with bfd_get_filename, which should be
equivalent in this case.

gdb/ChangeLog:

* dwarf2/read.h (struct dwarf2_per_bfd) <obfd>: New member.
(dwarf2_get_dwz_file): Replace parameter with dwarf2_per_bfd.
* dwarf2/read.c (dwarf2_per_bfd::dwarf2_per_bfd): Assign obfd
field.
(dwarf2_get_dwz_file): Replace parameter with dwarf2_per_bfd.
(create_cus_from_index): Update.
(dwarf2_read_gdb_index): Update.
(create_cus_from_debug_names): Update.
(dwarf2_read_debug_names): Update.
(get_abbrev_section_for_cu): Update.
(create_all_comp_units): Update.
(read_attribute_value): Update.
(get_debug_line_section): Update.
* dwarf2/index-cache.c (index_cache::store): Update.
* dwarf2/index-write.c (save_gdb_index_command): Update.
* dwarf2/macro.c (dwarf_decode_macro_bytes): Update.
gdb/dwarf2/index-cache.c
gdb/dwarf2/index-write.c
gdb/dwarf2/macro.c
gdb/dwarf2/read.c
gdb/dwarf2/read.h