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/read.h | |
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/read.h')
-rw-r--r-- | gdb/dwarf2/read.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index 02478d1..e9c74a4 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -136,6 +136,9 @@ private: const dwarf2_debug_sections &names); public: + /* The corresponding BFD. */ + bfd *obfd; + /* Objects that can be shared across objfiles are stored in this obstack or on the psymtab obstack, while objects that are objfile-specific are stored on the objfile obstack. */ @@ -578,8 +581,7 @@ struct signatured_type there is no .gnu_debugaltlink section in the file. Error if there is such a section but the file cannot be found. */ -extern struct dwz_file *dwarf2_get_dwz_file - (struct dwarf2_per_objfile *dwarf2_per_objfile); +extern dwz_file *dwarf2_get_dwz_file (dwarf2_per_bfd *per_bfd); /* Return the type of the DIE at DIE_OFFSET in the CU named by PER_CU. */ |