diff options
author | Tom de Vries <tdevries@suse.de> | 2019-06-18 18:59:51 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2019-06-18 18:59:51 +0200 |
commit | 3360b6e7963e3c579e50078e78d226ea63e2960f (patch) | |
tree | 84158a0558a031d1b8396efbaf3730ac0359b694 /gdb/dwarf2read.h | |
parent | 4ed4690fc21b1d052092299f820f48694f3ef3eb (diff) | |
download | gdb-3360b6e7963e3c579e50078e78d226ea63e2960f.zip gdb-3360b6e7963e3c579e50078e78d226ea63e2960f.tar.gz gdb-3360b6e7963e3c579e50078e78d226ea63e2960f.tar.bz2 |
[gdb] Fix abstract_to_concrete type
The test-case varval.exp fails here:
...
FAIL: gdb.dwarf2/varval.exp: print varval2
...
with boards readnow/cc-with-gdb-index/cc-with-debug-names, as well as if gdb
is build with -fsanitize=address -lasan.
The problem is that the abstract_to_concrete map in which we track the
association of abstract to concrete DIEs (for DW_OP_GNU_variable_value
support) has type std::unordered_map<die_info_ptr, std::vector<die_info_ptr>>,
and the die_info_ptrs that we register in the map may be invalid by the time
that we start to lookup DIEs in the map.
Fix this by using the sect_offset instead to identify the DIEs in the map.
Build and tested on x86_64-linux.
gdb/ChangeLog:
2019-06-18 Tom de Vries <tdevries@suse.de>
PR gdb/24515
* dwarf2read.h (abstract_to_concrete): Change type from
std::unordered_map<die_info_ptr, std::vector<die_info_ptr>> to
std::unordered_map<sect_offset, std::vector<sect_offset>>.
* dwarf2read.c (read_variable): Update.
(dwarf2_fetch_die_loc_sect_off): Update.
Diffstat (limited to 'gdb/dwarf2read.h')
-rw-r--r-- | gdb/dwarf2read.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/dwarf2read.h b/gdb/dwarf2read.h index e865895..776860e 100644 --- a/gdb/dwarf2read.h +++ b/gdb/dwarf2read.h @@ -256,7 +256,7 @@ public: /* Mapping from abstract origin DIE to concrete DIEs that reference it as DW_AT_abstract_origin. */ - std::unordered_map<die_info_ptr, std::vector<die_info_ptr>> + std::unordered_map<sect_offset, std::vector<sect_offset>> abstract_to_concrete; }; |