diff options
Diffstat (limited to 'gdb/dwarf2/cu.h')
-rw-r--r-- | gdb/dwarf2/cu.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h index 5683291..69f396c 100644 --- a/gdb/dwarf2/cu.h +++ b/gdb/dwarf2/cu.h @@ -21,7 +21,7 @@ #define GDB_DWARF2_CU_H #include "buildsym.h" -#include "dwarf2/comp-unit-head.h" +#include "dwarf2/unit-head.h" #include <optional> #include "language.h" #include "gdbsupport/unordered_set.h" @@ -99,8 +99,17 @@ struct dwarf2_cu void add_dependence (dwarf2_per_cu *ref_per_cu) { m_dependencies.emplace (ref_per_cu); } + /* Find the DIE at section offset SECT_OFF. + + Return nullptr if not found. */ + die_info *find_die (sect_offset sect_off) const + { + auto it = die_hash.find (sect_off); + return it != die_hash.end () ? *it : nullptr; + } + /* The header of the compilation unit. */ - struct comp_unit_head header; + struct unit_head header; /* Base address of this compilation unit. */ std::optional<unrelocated_addr> base_address; @@ -360,7 +369,7 @@ public: right place. And since the DW_TAG_compile_unit DIE in the split-unit can't have a DW_AT_ranges attribute, we can use the - die->tag != DW_AT_compile_unit + die->tag != DW_TAG_compile_unit to determine whether the base should be added or not. */ ULONGEST gnu_ranges_base = 0; |