diff options
author | Ali Tamur <tamur@google.com> | 2019-12-23 19:31:24 -0800 |
---|---|---|
committer | Ali Tamur <tamur@google.com> | 2020-01-13 15:35:35 -0800 |
commit | 18a8505e38fc2de4b0730b6e13cbd23db5984de9 (patch) | |
tree | f122269b54afe1509c4e855301a489108ddb2d2c /gdb/ChangeLog | |
parent | 0cac9354bfb07a5cf53d70dbefaa35c6afa7da0a (diff) | |
download | gdb-18a8505e38fc2de4b0730b6e13cbd23db5984de9.zip gdb-18a8505e38fc2de4b0730b6e13cbd23db5984de9.tar.gz gdb-18a8505e38fc2de4b0730b6e13cbd23db5984de9.tar.bz2 |
Dwarf 5: Handle debug_str_offsets and indexed attributes that have base offsets.
* Process debug_str_offsets section. Handle DW_AT_str_offsets_base attribute and
keep the value in dwarf2_cu.
* Make addr_base field in dwarf2_cu optional to disambiguate 0 value
(absent or present and 0).
* During parsing, there is no guarantee that DW_AT_str_offsets_base and
DW_AT_rnglists_base fields will be processed before the attributes that need
those values for correct computation. So make two passes, on the first one mark
the attributes that depend on *_base attributes and process only the others.
On the second pass, only process the attributes that are marked on the first
pass.
* For string attributes, differentiate between addresses that directly point to
a string and those that point to an offset in debug_str_offsets section.
* There are now two attributes, DW_AT_addr_base and DW_AT_GNU_addr_base to read
address offset base. Likewise, there are two attributes, DW_AT_rnglists_base
and DW_AT_GNU_ranges_base to read ranges base. Since there is no guarantee which
ones the compiler will generate, create helper functions to handle all cases.
Tested with CC=/usr/bin/gcc (version 8.3.0) against master branch (also with
-gsplit-dwarf and -gdwarf-4 flags) and there was no increase in the set of
tests that fails. (gdb still cannot debug a 'hello world' program with DWARF 5,
so for the time being, this is all we care about).
This is part of an effort to support DWARF-5 in gdb.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2ec7a61..7a1c81d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,54 @@ + +2020-01-13 Ali Tamur <tamur@google.com> + + * dwarf2read.c (dwarf2_debug_sections): Add debug_str_offsets sections. + (dwarf2_cu): Add str_offsets_base field. Change the type of addr_base + to gdb::optional. Update comments. + (dwo_file): Update comments. + (read_attribute): Update API to take an additional out parameter, + need_reprocess. This is used to mark attributes that need other + attributes (e.g. str_offsets_base) for correct computation which may not + have been read yet. + (read_attribute_reprocess): New function declaration. + (read_addr_index): Likewise. + (read_dwo_str_index): Likewise. + (read_stub_str_index): Likewise. + (dwarf2_per_objfile::locate_sections): Handle debug_str_offsets section. + (lookup_addr_base): New function definition. + (lookup_ranges_base): Likewise. + (read_cutu_die_from_dwo): Use the new functions: lookup_addr_base, + lookup_ranges_base. + (init_cutu_and_read_dies): Update comments. + (init_cutu_and_read_dies_no_follow): Change API to take parent compile + unit. This is used to inherit parent's str_offsets_base and addr_base. + Update comments. + (init_cutu_and_read_dies_simple): Reflect API changes. + (skip_one_die): Reflect API changes. Handle DW_FORM_rnglistx. + (create_cus_hash_table): Change API to take parent compile unit. + Reflect API changes. + (open_and_init_dwo_file): Reflect API changes. + (dwarf2_get_pc_bounds): Update comments. + (dwarf2_record_block_ranges): Likewise. + (read_full_die_1): Change implementation to reprocess attributes that + need str_offsets_base and addr_base. + (partial_die_info::read): Likewise. + (read_attribute_reprocess): New function definition. + (read_attribute_value): Change API to take an additional out parameter, + need_reprocess. Handle DW_FORM_rnglistx. No longer trigger an error + when a non-dwo compile unit has index based attributes. + (read_attribute): Reflect API changes. + (read_addr_index_1): Reflect API changes. Update comments. + (dwarf2_read_addr_index_data): Reflect API changes. + (dwarf2_read_addr_index): Likewise. + (read_str_index): Change API and implementation. This becomes a helper + to be used by the new string index related methods. Update error + message and comments. + (read_dwo_str_index): New function definition. + (read_stub_str_index): Likewise. + * dwarf2read.h (dwarf2_per_objfile): Add str_offsets field. + * symfile.h (dwarf2_debug_sections): Likewise. + * xcoffread.c (dwarf2_debug_sections): Likewise. + 2020-01-13 Simon Marchi <simon.marchi@efficios.com> * gdbcore.h (struct core_fns) <core_read_registers>: Change |