LLDB  mainline
DWARFUnit.h
Go to the documentation of this file.
1 //===-- DWARFUnit.h ---------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFUNIT_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFUNIT_H
11 
12 #include "DWARFDIE.h"
13 #include "DWARFDebugInfoEntry.h"
14 #include "lldb/Utility/XcodeSDK.h"
15 #include "lldb/lldb-enumerations.h"
16 #include "llvm/DebugInfo/DWARF/DWARFDebugRnglists.h"
17 #include "llvm/Support/RWMutex.h"
18 #include <atomic>
19 
20 class DWARFUnit;
21 class DWARFCompileUnit;
22 class NameToDIE;
23 class SymbolFileDWARF;
25 
26 typedef std::shared_ptr<DWARFUnit> DWARFUnitSP;
27 
35 };
36 
37 /// Base class describing the header of any kind of "unit." Some information
38 /// is specific to certain unit types. We separate this class out so we can
39 /// parse the header before deciding what specific kind of unit to construct.
45 
47 
48  uint8_t m_unit_type = 0;
49  uint8_t m_addr_size = 0;
50 
51  uint64_t m_type_hash = 0;
53 
54  uint64_t m_dwo_id = 0;
55 
56  DWARFUnitHeader() = default;
57 
58 public:
59  dw_offset_t GetOffset() const { return m_offset; }
60  uint16_t GetVersion() const { return m_version; }
62  dw_offset_t GetLength() const { return m_length; }
64  uint8_t GetUnitType() const { return m_unit_type; }
66  return m_index_entry;
67  }
68  uint64_t GetTypeHash() const { return m_type_hash; }
70  uint64_t GetDWOId() const { return m_dwo_id; }
71  bool IsTypeUnit() const {
72  return m_unit_type == llvm::dwarf::DW_UT_type ||
73  m_unit_type == llvm::dwarf::DW_UT_split_type;
74  }
75  uint32_t GetNextUnitOffset() const { return m_offset + m_length + 4; }
76 
77  static llvm::Expected<DWARFUnitHeader>
79  lldb_private::DWARFContext &dwarf_context,
80  lldb::offset_t *offset_ptr);
81 };
82 
84  using die_iterator_range =
85  llvm::iterator_range<DWARFDebugInfoEntry::collection::iterator>;
86 
87 public:
88  static llvm::Expected<DWARFUnitSP>
89  extract(SymbolFileDWARF &dwarf2Data, lldb::user_id_t uid,
90  const lldb_private::DWARFDataExtractor &debug_info,
91  DIERef::Section section, lldb::offset_t *offset_ptr);
92  virtual ~DWARFUnit();
93 
94  bool IsDWOUnit() { return m_is_dwo; }
95  uint64_t GetDWOId();
96 
99  void ExtractDIEsIfNeeded();
100 
103  public:
104  bool m_clear_dies = false;
107  ScopedExtractDIEs(const ScopedExtractDIEs &) = delete;
108  const ScopedExtractDIEs &operator=(const ScopedExtractDIEs &) = delete;
111  };
113 
114  bool Verify(lldb_private::Stream *s) const;
115  virtual void Dump(lldb_private::Stream *s) const = 0;
116  /// Get the data that contains the DIE information for this unit.
117  ///
118  /// This will return the correct bytes that contain the data for
119  /// this DWARFUnit. It could be .debug_info or .debug_types
120  /// depending on where the data for this unit originates.
121  ///
122  /// \return
123  /// The correct data for the DIE information in this unit.
125 
126  /// Get the size in bytes of the unit header.
127  ///
128  /// \return
129  /// Byte size of the unit header
130  uint32_t GetHeaderByteSize() const;
131 
132  // Offset of the initial length field.
133  dw_offset_t GetOffset() const { return m_header.GetOffset(); }
134  /// Get the size in bytes of the length field in the header.
135  ///
136  /// In DWARF32 this is just 4 bytes
137  ///
138  /// \return
139  /// Byte size of the compile unit header length field
140  size_t GetLengthByteSize() const { return 4; }
141 
142  bool ContainsDIEOffset(dw_offset_t die_offset) const {
143  return die_offset >= GetFirstDIEOffset() &&
144  die_offset < GetNextUnitOffset();
145  }
147  return GetOffset() + GetHeaderByteSize();
148  }
150  // Size of the CU data (without initial length and without header).
151  size_t GetDebugInfoSize() const;
152  // Size of the CU data incl. header but without initial length.
153  uint32_t GetLength() const { return m_header.GetLength(); }
154  uint16_t GetVersion() const { return m_header.GetVersion(); }
157  uint8_t GetAddressByteSize() const { return m_header.GetAddressByteSize(); }
158  dw_addr_t GetAddrBase() const { return m_addr_base.getValueOr(0); }
163  void SetAddrBase(dw_addr_t addr_base);
164  void SetLoclistsBase(dw_addr_t loclists_base);
165  void SetRangesBase(dw_addr_t ranges_base);
166  void SetStrOffsetsBase(dw_offset_t str_offsets_base);
167  virtual void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges) = 0;
168 
170 
172 
173  void SetBaseAddress(dw_addr_t base_addr);
174 
176 
177  DWARFDIE DIE() { return DWARFDIE(this, DIEPtr()); }
178 
179  DWARFDIE GetDIE(dw_offset_t die_offset);
180 
182 
183  static uint8_t GetAddressByteSize(const DWARFUnit *cu);
184 
185  static uint8_t GetDefaultAddressSize();
186 
187  void *GetUserData() const;
188 
189  void SetUserData(void *d);
190 
192 
194 
196 
198 
200 
201  llvm::VersionTuple GetProducerVersion();
202 
203  uint64_t GetDWARFLanguageType();
204 
205  bool GetIsOptimized();
206 
209  lldb_private::FileSpec GetFile(size_t file_idx);
211 
213 
216  return die_iterator_range(m_die_array.begin(), m_die_array.end());
217  }
218 
220 
221  uint8_t GetUnitType() const { return m_header.GetUnitType(); }
222  bool IsTypeUnit() const { return m_header.IsTypeUnit(); }
223 
224  llvm::Optional<uint64_t> GetStringOffsetSectionItem(uint32_t index) const;
225 
226  /// Return a list of address ranges resulting from a (possibly encoded)
227  /// range list starting at a given offset in the appropriate ranges section.
228  llvm::Expected<DWARFRangeList> FindRnglistFromOffset(dw_offset_t offset);
229 
230  /// Return a list of address ranges retrieved from an encoded range
231  /// list whose offset is found via a table lookup given an index (DWARF v5
232  /// and later).
233  llvm::Expected<DWARFRangeList> FindRnglistFromIndex(uint32_t index);
234 
235  /// Return a rangelist's offset based on an index. The index designates
236  /// an entry in the rangelist table's offset array and is supplied by
237  /// DW_FORM_rnglistx.
238  llvm::Expected<uint64_t> GetRnglistOffset(uint32_t Index);
239 
240  llvm::Optional<uint64_t> GetLoclistOffset(uint32_t Index) {
242  return llvm::None;
243 
244  llvm::Optional<uint64_t> Offset = m_loclist_table_header->getOffsetEntry(
246  if (!Offset)
247  return llvm::None;
248  return *Offset + m_loclists_base;
249  }
250 
251  /// Return the location table for parsing the given location list data. The
252  /// format is chosen according to the unit type. Never returns null.
253  std::unique_ptr<llvm::DWARFLocationTable>
255 
257 
258 protected:
260  const DWARFUnitHeader &header,
261  const DWARFAbbreviationDeclarationSet &abbrevs,
262  DIERef::Section section, bool is_dwo);
263 
266  lldb::offset_t *offset_ptr);
267 
268  // Get the DWARF unit DWARF debug information entry. Parse the single DIE
269  // if needed.
272  // m_first_die_mutex is not required as m_first_die is never cleared.
273  if (!m_first_die)
274  return nullptr;
275  return &m_first_die;
276  }
277 
278  // Get all DWARF debug informration entries. Parse all DIEs if needed.
281  if (m_die_array.empty())
282  return nullptr;
283  return &m_die_array[0];
284  }
285 
286  const llvm::Optional<llvm::DWARFDebugRnglistTable> &GetRnglistTable();
287 
289 
291  std::shared_ptr<DWARFUnit> m_dwo;
294  void *m_user_data = nullptr;
295  // The compile unit debug information entry item
297  mutable llvm::sys::RWMutex m_die_array_mutex;
298  // It is used for tracking of ScopedExtractDIEs instances.
299  mutable llvm::sys::RWMutex m_die_array_scoped_mutex;
300  // ScopedExtractDIEs instances should not call ClearDIEsRWLocked()
301  // as someone called ExtractDIEsIfNeeded().
302  std::atomic<bool> m_cancel_scopes;
303  // GetUnitDIEPtrOnly() needs to return pointer to the first DIE.
304  // But the first element of m_die_array after ExtractUnitDIEIfNeeded()
305  // would possibly move in memory after later ExtractDIEsIfNeeded().
307  llvm::sys::RWMutex m_first_die_mutex;
308  // A table similar to the .debug_aranges table, but this one points to the
309  // exact DW_TAG_subprogram DIEs
310  std::unique_ptr<DWARFDebugAranges> m_func_aranges_up;
313  llvm::VersionTuple m_producer_version;
314  llvm::Optional<uint64_t> m_language_type;
316  llvm::Optional<lldb_private::FileSpec> m_comp_dir;
317  llvm::Optional<lldb_private::FileSpec> m_file_spec;
318  llvm::Optional<dw_addr_t> m_addr_base; ///< Value of DW_AT_addr_base.
319  dw_addr_t m_loclists_base = 0; ///< Value of DW_AT_loclists_base.
320  dw_addr_t m_ranges_base = 0; ///< Value of DW_AT_rnglists_base.
321  llvm::Optional<uint64_t> m_gnu_addr_base;
322  llvm::Optional<uint64_t> m_gnu_ranges_base;
323 
324  /// Value of DW_AT_stmt_list.
326 
327  dw_offset_t m_str_offsets_base = 0; // Value of DW_AT_str_offsets_base.
328 
329  llvm::Optional<llvm::DWARFDebugRnglistTable> m_rnglist_table;
330  bool m_rnglist_table_done = false;
331  llvm::Optional<llvm::DWARFListTableHeader> m_loclist_table_header;
332 
334  bool m_is_dwo;
336  /// Value of DW_AT_GNU_dwo_id (v4) or dwo_id from CU header (v5).
337  uint64_t m_dwo_id;
338 
339 private:
340  void ParseProducerInfo();
341  void ExtractDIEsRWLocked();
342  void ClearDIEsRWLocked();
343 
344  void AddUnitDIE(const DWARFDebugInfoEntry &cu_die);
345  void SetDwoStrOffsetsBase();
346 
348  void ComputeAbsolutePath();
349 
350  DWARFUnit(const DWARFUnit &) = delete;
351  const DWARFUnit &operator=(const DWARFUnit &) = delete;
352 };
353 
354 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFUNIT_H
DWARFUnit::GetRnglistData
lldb_private::DWARFDataExtractor GetRnglistData() const
Definition: DWARFUnit.cpp:518
DWARFUnit::m_producer_version
llvm::VersionTuple m_producer_version
Definition: DWARFUnit.h:313
DWARFUnit::BuildAddressRangeTable
virtual void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges)=0
DWARFUnitHeader::GetVersion
uint16_t GetVersion() const
Definition: DWARFUnit.h:60
DWARFUnit::GetRnglistOffset
llvm::Expected< uint64_t > GetRnglistOffset(uint32_t Index)
Return a rangelist's offset based on an index.
Definition: DWARFUnit.cpp:559
DWARFUnit::SetUserData
void SetUserData(void *d)
Definition: DWARFUnit.cpp:647
DWARFUnit::GetData
const lldb_private::DWARFDataExtractor & GetData() const
Get the data that contains the DIE information for this unit.
Definition: DWARFUnit.cpp:968
DWARFUnit::m_addr_base
llvm::Optional< dw_addr_t > m_addr_base
Value of DW_AT_addr_base.
Definition: DWARFUnit.h:318
DWARFDIE.h
eProducerClang
@ eProducerClang
Definition: DWARFUnit.h:30
DWARFUnit::GetRnglistTable
const llvm::Optional< llvm::DWARFDebugRnglistTable > & GetRnglistTable()
Definition: DWARFUnit.cpp:543
DWARFDebugAranges
Definition: DWARFDebugAranges.h:16
DWARFUnit::DWARFUnit
DWARFUnit(SymbolFileDWARF &dwarf, lldb::user_id_t uid, const DWARFUnitHeader &header, const DWARFAbbreviationDeclarationSet &abbrevs, DIERef::Section section, bool is_dwo)
Definition: DWARFUnit.cpp:32
DWARFUnit::GetProducer
DWARFProducer GetProducer()
Definition: DWARFUnit.cpp:701
DWARFUnit::ScopedExtractDIEs::m_clear_dies
bool m_clear_dies
Definition: DWARFUnit.h:104
SymbolFileDWARF::GetDWARFContext
lldb_private::DWARFContext & GetDWARFContext()
Definition: SymbolFileDWARF.h:294
DWARFUnit::GetDWOId
uint64_t GetDWOId()
Definition: DWARFUnit.cpp:348
lldb_private::UserID
Definition: UserID.h:31
DWARFUnitHeader::m_type_hash
uint64_t m_type_hash
Definition: DWARFUnit.h:51
DWARFUnit::m_loclists_base
dw_addr_t m_loclists_base
Value of DW_AT_loclists_base.
Definition: DWARFUnit.h:319
DWARFUnit::GetDwoSymbolFile
SymbolFileDWARFDwo * GetDwoSymbolFile()
Definition: DWARFUnit.cpp:818
DWARFUnit::m_header
DWARFUnitHeader m_header
Definition: DWARFUnit.h:292
DWARFUnit::m_ranges_base
dw_addr_t m_ranges_base
Value of DW_AT_rnglists_base.
Definition: DWARFUnit.h:320
DWARFProducer
DWARFProducer
Definition: DWARFUnit.h:28
DWARFUnit::ExtractDIEsRWLocked
void ExtractDIEsRWLocked()
Definition: DWARFUnit.cpp:198
DWARFUnitHeader::m_version
uint16_t m_version
Definition: DWARFUnit.h:43
SymbolFileDWARF
Definition: SymbolFileDWARF.h:59
DWARFUnit::m_comp_dir
llvm::Optional< lldb_private::FileSpec > m_comp_dir
Definition: DWARFUnit.h:316
DWARFUnit::m_rnglist_table_done
bool m_rnglist_table_done
Definition: DWARFUnit.h:330
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
DWARFUnit::ComputeCompDirAndGuessPathStyle
void ComputeCompDirAndGuessPathStyle()
Definition: DWARFUnit.cpp:782
DWARFUnit::m_dwarf
SymbolFileDWARF & m_dwarf
Definition: DWARFUnit.h:290
DWARFUnit::GetDebugInfoSize
size_t GetDebugInfoSize() const
Definition: DWARFUnit.cpp:414
DWARFUnit::ClearDIEsRWLocked
void ClearDIEsRWLocked()
Definition: DWARFUnit.cpp:583
lldb_private::Stream
Definition: Stream.h:28
lldb_private::DWARFDataExtractor
Definition: DWARFDataExtractor.h:18
DWARFUnit::extract
static llvm::Expected< DWARFUnitSP > extract(SymbolFileDWARF &dwarf2Data, lldb::user_id_t uid, const lldb_private::DWARFDataExtractor &debug_info, DIERef::Section section, lldb::offset_t *offset_ptr)
Definition: DWARFUnit.cpp:932
DWARFUnit::m_is_optimized
lldb_private::LazyBool m_is_optimized
Definition: DWARFUnit.h:315
DWARFUnit::m_base_addr
dw_addr_t m_base_addr
Definition: DWARFUnit.h:311
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
DWARFUnitHeader::m_index_entry
const llvm::DWARFUnitIndex::Entry * m_index_entry
Definition: DWARFUnit.h:46
DWARFUnit::GetStrOffsetsBase
dw_addr_t GetStrOffsetsBase() const
Definition: DWARFUnit.h:162
DWARFDebugInfoEntry
DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic o...
Definition: DWARFDebugInfoEntry.h:31
DW_INVALID_OFFSET
#define DW_INVALID_OFFSET
Definition: dwarf.h:37
DWARFUnitHeader::m_offset
dw_offset_t m_offset
Definition: DWARFUnit.h:41
DWARFUnit::FindRnglistFromOffset
llvm::Expected< DWARFRangeList > FindRnglistFromOffset(dw_offset_t offset)
Return a list of address ranges resulting from a (possibly encoded) range list starting at a given of...
Definition: DWARFUnit.cpp:996
DWARFUnit::m_first_die
DWARFDebugInfoEntry m_first_die
Definition: DWARFUnit.h:306
DWARFUnit::SetLoclistsBase
void SetLoclistsBase(dw_addr_t loclists_base)
Definition: DWARFUnit.cpp:462
lldb_private::DWARFContext
Definition: DWARFContext.h:20
XcodeSDK.h
DWARFUnit::GetUnitDIEPtrOnly
const DWARFDebugInfoEntry * GetUnitDIEPtrOnly()
Definition: DWARFUnit.h:270
DWARFUnitHeader::DWARFUnitHeader
DWARFUnitHeader()=default
DWARFDIE
Definition: DWARFDIE.h:16
DWARFUnitHeader::GetOffset
dw_offset_t GetOffset() const
Definition: DWARFUnit.h:59
DWARFUnit::m_dwo
std::shared_ptr< DWARFUnit > m_dwo
Definition: DWARFUnit.h:291
DWARFUnit::GetDWARFLanguageType
uint64_t GetDWARFLanguageType()
Definition: DWARFUnit.cpp:713
lldb_private::FileSpec
Definition: FileSpec.h:56
DWARFCompileUnit
Definition: DWARFCompileUnit.h:15
eProducerSwift
@ eProducerSwift
Definition: DWARFUnit.h:33
DWARFUnit::GetAddressByteSize
uint8_t GetAddressByteSize() const
Definition: DWARFUnit.h:157
DWARFUnit::ScopedExtractDIEs
Definition: DWARFUnit.h:101
DWARFUnit::AddUnitDIE
void AddUnitDIE(const DWARFDebugInfoEntry &cu_die)
Definition: DWARFUnit.cpp:354
DWARFUnit
Definition: DWARFUnit.h:83
DWARFUnit::m_abbrevs
const DWARFAbbreviationDeclarationSet * m_abbrevs
Definition: DWARFUnit.h:293
DWARFUnitHeader::GetDWOId
uint64_t GetDWOId() const
Definition: DWARFUnit.h:70
DWARFUnit::GetCompilationDirectory
const lldb_private::FileSpec & GetCompilationDirectory()
Definition: DWARFUnit.cpp:745
DWARFUnit::GetLocationTable
std::unique_ptr< llvm::DWARFLocationTable > GetLocationTable(const lldb_private::DataExtractor &data) const
Return the location table for parsing the given location list data.
Definition: DWARFUnit.cpp:494
DWARFUnit::m_cancel_scopes
std::atomic< bool > m_cancel_scopes
Definition: DWARFUnit.h:302
DWARFUnit::ExtractUnitDIENoDwoIfNeeded
void ExtractUnitDIENoDwoIfNeeded()
Definition: DWARFUnit.cpp:43
dwarf
Definition: ABISysV_arc.cpp:61
DWARFUnit::GetNextUnitOffset
dw_offset_t GetNextUnitOffset() const
Definition: DWARFUnit.h:149
lldb_private::DataExtractor
Definition: DataExtractor.h:48
DWARFUnit::ScopedExtractDIEs::ScopedExtractDIEs
ScopedExtractDIEs(DWARFUnit &cu)
Definition: DWARFUnit.cpp:165
DWARFUnit::ParseProducerInfo
void ParseProducerInfo()
Definition: DWARFUnit.cpp:666
DWARFUnit::GetAddrBase
dw_addr_t GetAddrBase() const
Definition: DWARFUnit.h:158
DWARFUnitSP
std::shared_ptr< DWARFUnit > DWARFUnitSP
Definition: DWARFUnit.h:24
DWARFUnitHeader::GetNextUnitOffset
uint32_t GetNextUnitOffset() const
Definition: DWARFUnit.h:75
DWARFUnit::Dump
virtual void Dump(lldb_private::Stream *s) const =0
DWARFUnit::~DWARFUnit
virtual ~DWARFUnit()
DWARFUnitHeader::GetAbbrOffset
dw_offset_t GetAbbrOffset() const
Definition: DWARFUnit.h:63
DWARFUnit::GetPathStyle
lldb_private::FileSpec::Style GetPathStyle()
Definition: DWARFUnit.cpp:739
DWARFUnit::GetAbbrevOffset
dw_offset_t GetAbbrevOffset() const
Definition: DWARFUnit.cpp:422
DWARFUnitHeader::m_addr_size
uint8_t m_addr_size
Definition: DWARFUnit.h:49
DWARFUnit::ScopedExtractDIEs::m_cu
DWARFUnit * m_cu
Definition: DWARFUnit.h:102
DWARFUnit::GetStringOffsetSectionItem
llvm::Optional< uint64_t > GetStringOffsetSectionItem(uint32_t index) const
Definition: DWARFUnit.cpp:990
DWARFUnit::ScopedExtractDIEs::~ScopedExtractDIEs
~ScopedExtractDIEs()
Definition: DWARFUnit.cpp:169
DWARFUnit::GetFirstDIEOffset
dw_offset_t GetFirstDIEOffset() const
Definition: DWARFUnit.h:146
DWARFUnit::m_func_aranges_up
std::unique_ptr< DWARFDebugAranges > m_func_aranges_up
Definition: DWARFUnit.h:310
DWARFUnit::SetStrOffsetsBase
void SetStrOffsetsBase(dw_offset_t str_offsets_base)
Definition: DWARFUnit.cpp:578
DWARFUnit::m_str_offsets_base
dw_offset_t m_str_offsets_base
Definition: DWARFUnit.h:327
DWARFUnit::m_dwo_id
uint64_t m_dwo_id
Value of DW_AT_GNU_dwo_id (v4) or dwo_id from CU header (v5).
Definition: DWARFUnit.h:337
lldb-enumerations.h
DWARFUnitHeader::GetUnitType
uint8_t GetUnitType() const
Definition: DWARFUnit.h:64
DWARFUnit::Supports_unnamed_objc_bitfields
bool Supports_unnamed_objc_bitfields()
Definition: DWARFUnit.cpp:659
DWARFUnit::m_die_array_scoped_mutex
llvm::sys::RWMutex m_die_array_scoped_mutex
Definition: DWARFUnit.h:299
DWARFUnitHeader::IsTypeUnit
bool IsTypeUnit() const
Definition: DWARFUnit.h:71
DWARFUnitHeader
Base class describing the header of any kind of "unit." Some information is specific to certain unit ...
Definition: DWARFUnit.h:40
DWARFUnit::DIEPtr
const DWARFDebugInfoEntry * DIEPtr()
Definition: DWARFUnit.h:279
DWARFUnit::GetHeaderByteSize
uint32_t GetHeaderByteSize() const
Get the size in bytes of the unit header.
Definition: DWARFUnit.cpp:974
DWARFUnitHeader::m_type_offset
uint32_t m_type_offset
Definition: DWARFUnit.h:52
DWARFUnit::die_iterator_range
llvm::iterator_range< DWARFDebugInfoEntry::collection::iterator > die_iterator_range
Definition: DWARFUnit.h:85
DWARFUnit::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Definition: DWARFUnit.cpp:591
DWARFUnit::ScopedExtractDIEs::operator=
const ScopedExtractDIEs & operator=(const ScopedExtractDIEs &)=delete
DWARFUnit::GetBaseAddress
dw_addr_t GetBaseAddress() const
Definition: DWARFUnit.h:159
DWARFUnit::GetLineTableOffset
dw_offset_t GetLineTableOffset()
Definition: DWARFUnit.cpp:426
eProducerLLVMGCC
@ eProducerLLVMGCC
Definition: DWARFUnit.h:32
DWARFUnit::dies
die_iterator_range dies()
Definition: DWARFUnit.h:214
eProducerGCC
@ eProducerGCC
Definition: DWARFUnit.h:31
DWARFUnit::GetOffset
dw_offset_t GetOffset() const
Definition: DWARFUnit.h:133
DWARFUnit::IsDWOUnit
bool IsDWOUnit()
Definition: DWARFUnit.h:94
DWARFUnit::GetFunctionAranges
const DWARFDebugAranges & GetFunctionAranges()
Definition: DWARFUnit.cpp:825
lldb_private::FileSpec::Style
llvm::sys::path::Style Style
Definition: FileSpec.h:58
DWARFUnit::m_producer
DWARFProducer m_producer
Definition: DWARFUnit.h:312
DWARFUnit::m_is_dwo
bool m_is_dwo
Definition: DWARFUnit.h:334
DWARFUnit::operator=
const DWARFUnit & operator=(const DWARFUnit &)=delete
DWARFUnit::ExtractDIEsScoped
ScopedExtractDIEs ExtractDIEsScoped()
Definition: DWARFUnit.cpp:145
eProducerInvalid
@ eProducerInvalid
Definition: DWARFUnit.h:29
DWARFUnit::m_rnglist_table
llvm::Optional< llvm::DWARFDebugRnglistTable > m_rnglist_table
Definition: DWARFUnit.h:329
DWARFAbbreviationDeclarationSet
Definition: DWARFDebugAbbrev.h:27
DWARFUnit::SetRangesBase
void SetRangesBase(dw_addr_t ranges_base)
Definition: DWARFUnit.cpp:536
DWARFUnitHeader::m_unit_type
uint8_t m_unit_type
Definition: DWARFUnit.h:48
DWARFUnit::DW_AT_decl_file_attributes_are_invalid
bool DW_AT_decl_file_attributes_are_invalid()
Definition: DWARFUnit.cpp:653
DWARFUnit::GetLength
uint32_t GetLength() const
Definition: DWARFUnit.h:153
DWARFUnitHeader::GetAddressByteSize
uint16_t GetAddressByteSize() const
Definition: DWARFUnit.h:61
DWARFUnit::m_section
const DIERef::Section m_section
Definition: DWARFUnit.h:333
uint32_t
DWARFDebugInfoEntry.h
DWARFUnit::GetUnitDIEOnly
DWARFBaseDIE GetUnitDIEOnly()
Definition: DWARFUnit.h:175
DWARFUnit::SetBaseAddress
void SetBaseAddress(dw_addr_t base_addr)
Definition: DWARFUnit.cpp:595
DWARFUnit::GetVersion
uint16_t GetVersion() const
Definition: DWARFUnit.h:154
DWARFUnit::ExtractDIEsIfNeeded
void ExtractDIEsIfNeeded()
Definition: DWARFUnit.cpp:125
DWARFUnit::m_language_type
llvm::Optional< uint64_t > m_language_type
Definition: DWARFUnit.h:314
DWARFUnit::IsTypeUnit
bool IsTypeUnit() const
Definition: DWARFUnit.h:222
DWARFUnit::m_has_parsed_non_skeleton_unit
bool m_has_parsed_non_skeleton_unit
Definition: DWARFUnit.h:335
DWARFUnit::m_gnu_addr_base
llvm::Optional< uint64_t > m_gnu_addr_base
Definition: DWARFUnit.h:321
DWARFUnit::Verify
bool Verify(lldb_private::Stream *s) const
DWARFUnitHeader::m_abbr_offset
dw_offset_t m_abbr_offset
Definition: DWARFUnit.h:44
DWARFUnit::m_line_table_offset
dw_offset_t m_line_table_offset
Value of DW_AT_stmt_list.
Definition: DWARFUnit.h:325
DWARFUnit::m_user_data
void * m_user_data
Definition: DWARFUnit.h:294
SymbolFileDWARFDwo
Definition: SymbolFileDWARFDwo.h:14
DWARFUnit::GetNonSkeletonUnit
DWARFUnit & GetNonSkeletonUnit()
Definition: DWARFUnit.cpp:630
DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type
bool Supports_DW_AT_APPLE_objc_complete_type()
Definition: DWARFUnit.cpp:649
DWARFUnitHeader::m_length
dw_offset_t m_length
Definition: DWARFUnit.h:42
DWARFUnitHeader::GetIndexEntry
const llvm::DWARFUnitIndex::Entry * GetIndexEntry() const
Definition: DWARFUnit.h:65
DWARFUnit::GetLengthByteSize
size_t GetLengthByteSize() const
Get the size in bytes of the length field in the header.
Definition: DWARFUnit.h:140
lldb_private::DWARFDataExtractor::GetAsLLVM
llvm::DWARFDataExtractor GetAsLLVM() const
Definition: DWARFDataExtractor.cpp:24
uint16_t
DWARFUnitHeader::GetTypeOffset
dw_offset_t GetTypeOffset() const
Definition: DWARFUnit.h:69
DWARFUnit::m_first_die_mutex
llvm::sys::RWMutex m_first_die_mutex
Definition: DWARFUnit.h:307
DWARFUnit::GetLocationData
lldb_private::DWARFDataExtractor GetLocationData() const
Definition: DWARFUnit.cpp:504
DWARFUnit::GetUnitType
uint8_t GetUnitType() const
Definition: DWARFUnit.h:221
eProducerOther
@ eProducerOther
Definition: DWARFUnit.h:34
DWARFUnit::ComputeAbsolutePath
void ComputeAbsolutePath()
Definition: DWARFUnit.cpp:804
DWARFUnit::ExtractUnitDIEIfNeeded
void ExtractUnitDIEIfNeeded()
Definition: DWARFUnit.cpp:72
DWARFUnit::GetLoclistOffset
llvm::Optional< uint64_t > GetLoclistOffset(uint32_t Index)
Definition: DWARFUnit.h:240
DWARFUnit::GetUserData
void * GetUserData() const
Definition: DWARFUnit.cpp:645
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
DWARFUnit::m_die_array
DWARFDebugInfoEntry::collection m_die_array
Definition: DWARFUnit.h:296
DWARFUnit::GetProducerVersion
llvm::VersionTuple GetProducerVersion()
Definition: DWARFUnit.cpp:707
DWARFUnit::m_gnu_ranges_base
llvm::Optional< uint64_t > m_gnu_ranges_base
Definition: DWARFUnit.h:322
DWARFDebugInfoEntry::collection
std::vector< DWARFDebugInfoEntry > collection
Definition: DWARFDebugInfoEntry.h:33
lldb_private::eLazyBoolCalculate
@ eLazyBoolCalculate
Definition: lldb-private-enumerations.h:115
DWARFUnitHeader::extract
static llvm::Expected< DWARFUnitHeader > extract(const lldb_private::DWARFDataExtractor &data, DIERef::Section section, lldb_private::DWARFContext &dwarf_context, lldb::offset_t *offset_ptr)
Definition: DWARFUnit.cpp:846
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:30
DWARFUnit::DIE
DWARFDIE DIE()
Definition: DWARFUnit.h:177
DWARFUnitHeader::GetTypeHash
uint64_t GetTypeHash() const
Definition: DWARFUnit.h:68
DWARFUnit::SetAddrBase
void SetAddrBase(dw_addr_t addr_base)
Definition: DWARFUnit.cpp:431
Entry
FormatEntity::Entry Entry
Definition: FormatEntity.cpp:82
DWARFUnit::ContainsDIEOffset
bool ContainsDIEOffset(dw_offset_t die_offset) const
Definition: DWARFUnit.h:142
DWARFUnit::GetDefaultAddressSize
static uint8_t GetDefaultAddressSize()
Definition: DWARFUnit.cpp:643
DWARFUnit::GetRangesBase
dw_addr_t GetRangesBase() const
Definition: DWARFUnit.h:161
DWARFUnit::GetSymbolFileDWARF
SymbolFileDWARF & GetSymbolFileDWARF() const
Definition: DWARFUnit.h:197
DWARFUnit::m_die_array_mutex
llvm::sys::RWMutex m_die_array_mutex
Definition: DWARFUnit.h:297
DWARFUnit::GetAbbreviations
const DWARFAbbreviationDeclarationSet * GetAbbreviations() const
Definition: DWARFUnit.cpp:418
DWARFUnit::FindRnglistFromIndex
llvm::Expected< DWARFRangeList > FindRnglistFromIndex(uint32_t index)
Return a list of address ranges retrieved from an encoded range list whose offset is found via a tabl...
Definition: DWARFUnit.cpp:1042
DWARFUnit::GetDebugSection
DIERef::Section GetDebugSection() const
Definition: DWARFUnit.h:219
dw_addr_t
uint64_t dw_addr_t
Definition: dwarf.h:29
DWARFUnit::GetIsOptimized
bool GetIsOptimized()
Definition: DWARFUnit.cpp:725
DWARFUnit::SetDwoStrOffsetsBase
void SetDwoStrOffsetsBase()
Definition: DWARFUnit.cpp:319
DWARFUnit::m_loclist_table_header
llvm::Optional< llvm::DWARFListTableHeader > m_loclist_table_header
Definition: DWARFUnit.h:331
DWARFUnitHeader::m_dwo_id
uint64_t m_dwo_id
Definition: DWARFUnit.h:54
NameToDIE
Definition: NameToDIE.h:21
DWARFUnit::ExtractHeader
llvm::Error ExtractHeader(SymbolFileDWARF &dwarf, const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr)
DIERef::Section
Section
Definition: DIERef.h:28
DWARFUnit::GetFile
lldb_private::FileSpec GetFile(size_t file_idx)
Definition: DWARFUnit.cpp:757
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138
DWARFBaseDIE
Definition: DWARFBaseDIE.h:25
DWARFUnit::GetAbsolutePath
const lldb_private::FileSpec & GetAbsolutePath()
Definition: DWARFUnit.cpp:751
lldb_private::DWARFContext::getOrLoadLocListsData
const DWARFDataExtractor & getOrLoadLocListsData()
Definition: DWARFContext.cpp:88
DWARFUnitHeader::GetLength
dw_offset_t GetLength() const
Definition: DWARFUnit.h:62
DWARFUnit::m_file_spec
llvm::Optional< lldb_private::FileSpec > m_file_spec
Definition: DWARFUnit.h:317
DWARFUnit::GetDIE
DWARFDIE GetDIE(dw_offset_t die_offset)
Definition: DWARFUnit.cpp:609