diff options
Diffstat (limited to 'gdb/dwarf2/cu.h')
-rw-r--r-- | gdb/dwarf2/cu.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h index 5683291..9f76789 100644 --- a/gdb/dwarf2/cu.h +++ b/gdb/dwarf2/cu.h @@ -21,12 +21,14 @@ #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" #include "dwarf2/die.h" +struct field_info; + /* Type used for delaying computation of method physnames. See comments for compute_delayed_physnames. */ struct delayed_method_info @@ -99,8 +101,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; @@ -390,6 +401,15 @@ public: .debug_str_offsets section (8 or 4, depending on the address size). */ std::optional<ULONGEST> str_offsets_base; + /* We may encounter a DIE where a property refers to a field in some + outer type. For example, in Ada, an array length may depend on a + field in some outer record. In this case, we need to be able to + stash a pointer to the 'struct field' into the appropriate + dynamic property baton. However, the fields aren't created until + the type has been fully processed, so we need a temporary + back-link to this object. */ + struct field_info *field_info = nullptr; + /* Mark used when releasing cached dies. */ bool m_mark : 1; |