diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2020-05-27 11:13:54 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-27 11:15:54 -0400 |
commit | c3699833af0343d13d7d39b3c589d3ac5b930137 (patch) | |
tree | ea8bea180c24cb12ed0ce1e7a85dba2eeceb82d8 /gdb/dwarf2/index-cache.c | |
parent | 1859c670e9979c1e58ed4e9d83085f732e6936f5 (diff) | |
download | gdb-c3699833af0343d13d7d39b3c589d3ac5b930137.zip gdb-c3699833af0343d13d7d39b3c589d3ac5b930137.tar.gz gdb-c3699833af0343d13d7d39b3c589d3ac5b930137.tar.bz2 |
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.
Change-Id: Ifb23f55dda93c499aae57b6a9aff9c6ff9d2f45f
Diffstat (limited to 'gdb/dwarf2/index-cache.c')
-rw-r--r-- | gdb/dwarf2/index-cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c index 76e7ce6..cb79c87 100644 --- a/gdb/dwarf2/index-cache.c +++ b/gdb/dwarf2/index-cache.c @@ -108,7 +108,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile) /* Get build id of dwz file, if present. */ gdb::optional<std::string> dwz_build_id_str; - const dwz_file *dwz = dwarf2_get_dwz_file (dwarf2_per_objfile); + const dwz_file *dwz = dwarf2_get_dwz_file (dwarf2_per_objfile->per_bfd); const char *dwz_build_id_ptr = NULL; if (dwz != nullptr) |