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/macro.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/macro.c')
-rw-r--r-- | gdb/dwarf2/macro.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/dwarf2/macro.c b/gdb/dwarf2/macro.c index c258019..a44e2c7 100644 --- a/gdb/dwarf2/macro.c +++ b/gdb/dwarf2/macro.c @@ -507,7 +507,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile, || section_is_dwz) { struct dwz_file *dwz - = dwarf2_get_dwz_file (dwarf2_per_objfile); + = dwarf2_get_dwz_file (dwarf2_per_objfile->per_bfd); body = dwz->read_string (objfile, str_offset); } @@ -644,7 +644,8 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile, if (macinfo_type == DW_MACRO_import_sup) { - struct dwz_file *dwz = dwarf2_get_dwz_file (dwarf2_per_objfile); + struct dwz_file *dwz + = dwarf2_get_dwz_file (dwarf2_per_objfile->per_bfd); dwz->macro.read (objfile); |