aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.h
diff options
context:
space:
mode:
authorAli Tamur <tamur@google.com>2019-12-23 19:31:24 -0800
committerAli Tamur <tamur@google.com>2020-01-13 15:35:35 -0800
commit18a8505e38fc2de4b0730b6e13cbd23db5984de9 (patch)
treef122269b54afe1509c4e855301a489108ddb2d2c /gdb/dwarf2read.h
parent0cac9354bfb07a5cf53d70dbefaa35c6afa7da0a (diff)
downloadfsf-binutils-gdb-18a8505e38fc2de4b0730b6e13cbd23db5984de9.zip
fsf-binutils-gdb-18a8505e38fc2de4b0730b6e13cbd23db5984de9.tar.gz
fsf-binutils-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/dwarf2read.h')
-rw-r--r--gdb/dwarf2read.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/dwarf2read.h b/gdb/dwarf2read.h
index ae1f74a..bc8087b 100644
--- a/gdb/dwarf2read.h
+++ b/gdb/dwarf2read.h
@@ -156,6 +156,7 @@ public:
dwarf2_section_info macinfo {};
dwarf2_section_info macro {};
dwarf2_section_info str {};
+ dwarf2_section_info str_offsets {};
dwarf2_section_info line_str {};
dwarf2_section_info ranges {};
dwarf2_section_info rnglists {};