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/lldb-enumerations.h"
15 #include "lldb/Utility/XcodeSDK.h"
16 #include "llvm/Support/RWMutex.h"
17 #include <atomic>
18 
19 class DWARFUnit;
20 class DWARFCompileUnit;
21 class NameToDIE;
22 class SymbolFileDWARF;
24 
25 typedef std::shared_ptr<DWARFUnit> DWARFUnitSP;
26 
33 };
34 
35 /// Base class describing the header of any kind of "unit." Some information
36 /// is specific to certain unit types. We separate this class out so we can
37 /// parse the header before deciding what specific kind of unit to construct.
43 
45 
46  uint8_t m_unit_type = 0;
47  uint8_t m_addr_size = 0;
48 
49  uint64_t m_type_hash = 0;
51 
52  uint64_t m_dwo_id = 0;
53 
54  DWARFUnitHeader() = default;
55 
56 public:
57  dw_offset_t GetOffset() const { return m_offset; }
58  uint16_t GetVersion() const { return m_version; }
60  dw_offset_t GetLength() const { return m_length; }
62  uint8_t GetUnitType() const { return m_unit_type; }
64  return m_index_entry;
65  }
66  uint64_t GetTypeHash() const { return m_type_hash; }
68  uint64_t GetDWOId() const { return m_dwo_id; }
69  bool IsTypeUnit() const {
70  return m_unit_type == DW_UT_type || m_unit_type == DW_UT_split_type;
71  }
72  uint32_t GetNextUnitOffset() const { return m_offset + m_length + 4; }
73 
74  static llvm::Expected<DWARFUnitHeader>
76  lldb_private::DWARFContext &dwarf_context,
77  lldb::offset_t *offset_ptr);
78 };
79 
81  using die_iterator_range =
82  llvm::iterator_range<DWARFDebugInfoEntry::collection::iterator>;
83 
84 public:
85  static llvm::Expected<DWARFUnitSP>
86  extract(SymbolFileDWARF &dwarf2Data, lldb::user_id_t uid,
87  const lldb_private::DWARFDataExtractor &debug_info,
88  DIERef::Section section, lldb::offset_t *offset_ptr);
89  virtual ~DWARFUnit();
90 
91  bool IsDWOUnit() { return m_is_dwo; }
92  uint64_t GetDWOId();
93 
95  void ExtractDIEsIfNeeded();
96 
99  public:
100  bool m_clear_dies = false;
103  ScopedExtractDIEs(const ScopedExtractDIEs &) = delete;
104  const ScopedExtractDIEs &operator=(const ScopedExtractDIEs &) = delete;
107  };
109 
110  bool Verify(lldb_private::Stream *s) const;
111  virtual void Dump(lldb_private::Stream *s) const = 0;
112  /// Get the data that contains the DIE information for this unit.
113  ///
114  /// This will return the correct bytes that contain the data for
115  /// this DWARFUnit. It could be .debug_info or .debug_types
116  /// depending on where the data for this unit originates.
117  ///
118  /// \return
119  /// The correct data for the DIE information in this unit.
121 
122  /// Get the size in bytes of the unit header.
123  ///
124  /// \return
125  /// Byte size of the unit header
126  uint32_t GetHeaderByteSize() const;
127 
128  // Offset of the initial length field.
129  dw_offset_t GetOffset() const { return m_header.GetOffset(); }
130  /// Get the size in bytes of the length field in the header.
131  ///
132  /// In DWARF32 this is just 4 bytes
133  ///
134  /// \return
135  /// Byte size of the compile unit header length field
136  size_t GetLengthByteSize() const { return 4; }
137 
138  bool ContainsDIEOffset(dw_offset_t die_offset) const {
139  return die_offset >= GetFirstDIEOffset() &&
140  die_offset < GetNextUnitOffset();
141  }
143  return GetOffset() + GetHeaderByteSize();
144  }
146  // Size of the CU data (without initial length and without header).
147  size_t GetDebugInfoSize() const;
148  // Size of the CU data incl. header but without initial length.
149  uint32_t GetLength() const { return m_header.GetLength(); }
150  uint16_t GetVersion() const { return m_header.GetVersion(); }
153  uint8_t GetAddressByteSize() const { return m_header.GetAddressByteSize(); }
154  dw_addr_t GetAddrBase() const { return m_addr_base; }
159  void SetAddrBase(dw_addr_t addr_base);
160  void SetLoclistsBase(dw_addr_t loclists_base);
161  void SetRangesBase(dw_addr_t ranges_base);
162  void SetStrOffsetsBase(dw_offset_t str_offsets_base);
163  virtual void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges) = 0;
164 
166 
168 
169  void SetBaseAddress(dw_addr_t base_addr);
170 
172 
173  DWARFDIE DIE() { return DWARFDIE(this, DIEPtr()); }
174 
175  DWARFDIE GetDIE(dw_offset_t die_offset);
176 
178 
179  static uint8_t GetAddressByteSize(const DWARFUnit *cu);
180 
181  static uint8_t GetDefaultAddressSize();
182 
183  void *GetUserData() const;
184 
185  void SetUserData(void *d);
186 
188 
190 
192 
194 
196 
198 
200 
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 NULL;
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 NULL;
283  return &m_die_array[0];
284  }
285 
286  const llvm::Optional<llvm::DWARFDebugRnglistTable> &GetRnglist();
287 
289  std::shared_ptr<DWARFUnit> m_dwo;
292  void *m_user_data = nullptr;
293  // The compile unit debug information entry item
295  mutable llvm::sys::RWMutex m_die_array_mutex;
296  // It is used for tracking of ScopedExtractDIEs instances.
297  mutable llvm::sys::RWMutex m_die_array_scoped_mutex;
298  // ScopedExtractDIEs instances should not call ClearDIEsRWLocked()
299  // as someone called ExtractDIEsIfNeeded().
300  std::atomic<bool> m_cancel_scopes;
301  // GetUnitDIEPtrOnly() needs to return pointer to the first DIE.
302  // But the first element of m_die_array after ExtractUnitDIEIfNeeded()
303  // would possibly move in memory after later ExtractDIEsIfNeeded().
305  llvm::sys::RWMutex m_first_die_mutex;
306  // A table similar to the .debug_aranges table, but this one points to the
307  // exact DW_TAG_subprogram DIEs
308  std::unique_ptr<DWARFDebugAranges> m_func_aranges_up;
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  dw_addr_t m_addr_base = 0; ///< 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 
322  /// Value of DW_AT_stmt_list.
324 
325  dw_offset_t m_str_offsets_base = 0; // Value of DW_AT_str_offsets_base.
326 
327  llvm::Optional<llvm::DWARFDebugRnglistTable> m_rnglist_table;
328  bool m_rnglist_table_done = false;
329  llvm::Optional<llvm::DWARFListTableHeader> m_loclist_table_header;
330 
332  bool m_is_dwo;
333  /// Value of DW_AT_GNU_dwo_id (v4) or dwo_id from CU header (v5).
334  uint64_t m_dwo_id;
335 
336 private:
337  void ParseProducerInfo();
338  void ExtractDIEsRWLocked();
339  void ClearDIEsRWLocked();
340 
341  void AddUnitDIE(const DWARFDebugInfoEntry &cu_die);
342  void SetDwoStrOffsetsBase();
343 
345  void ComputeAbsolutePath();
346 
347  DWARFUnit(const DWARFUnit &) = delete;
348  const DWARFUnit &operator=(const DWARFUnit &) = delete;
349 };
350 
351 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFUNIT_H
DWARFUnit::BuildAddressRangeTable
virtual void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges)=0
DWARFUnitHeader::GetVersion
uint16_t GetVersion() const
Definition: DWARFUnit.h:58
DWARFUnit::GetRnglistOffset
llvm::Expected< uint64_t > GetRnglistOffset(uint32_t Index)
Return a rangelist's offset based on an index.
Definition: DWARFUnit.cpp:510
DWARFUnit::SetUserData
void SetUserData(void *d)
Definition: DWARFUnit.cpp:598
DWARFUnit::GetData
const lldb_private::DWARFDataExtractor & GetData() const
Get the data that contains the DIE information for this unit.
Definition: DWARFUnit.cpp:931
DWARFDIE.h
eProducerClang
@ eProducerClang
Definition: DWARFUnit.h:29
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:659
DWARFUnit::ScopedExtractDIEs::m_clear_dies
bool m_clear_dies
Definition: DWARFUnit.h:100
SymbolFileDWARF::GetDWARFContext
lldb_private::DWARFContext & GetDWARFContext()
Definition: SymbolFileDWARF.h:295
DWARFUnit::GetDWOId
uint64_t GetDWOId()
Definition: DWARFUnit.cpp:293
lldb_private::UserID
Definition: UserID.h:31
DWARFUnitHeader::m_type_hash
uint64_t m_type_hash
Definition: DWARFUnit.h:49
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:787
DWARFUnit::m_header
DWARFUnitHeader m_header
Definition: DWARFUnit.h:290
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:27
DWARFUnit::ExtractDIEsRWLocked
void ExtractDIEsRWLocked()
Definition: DWARFUnit.cpp:144
DWARFUnitHeader::m_version
uint16_t m_version
Definition: DWARFUnit.h:41
SymbolFileDWARF
Definition: SymbolFileDWARF.h:58
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:328
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
DWARFUnit::ComputeCompDirAndGuessPathStyle
void ComputeCompDirAndGuessPathStyle()
Definition: DWARFUnit.cpp:751
DWARFUnit::m_dwarf
SymbolFileDWARF & m_dwarf
Definition: DWARFUnit.h:288
DWARFUnit::GetDebugInfoSize
size_t GetDebugInfoSize() const
Definition: DWARFUnit.cpp:402
DWARFUnit::ClearDIEsRWLocked
void ClearDIEsRWLocked()
Definition: DWARFUnit.cpp:534
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:895
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:309
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
DWARFUnit::GetProducerVersionMajor
uint32_t GetProducerVersionMajor()
Definition: DWARFUnit.cpp:665
DWARFUnitHeader::m_index_entry
const llvm::DWARFUnitIndex::Entry * m_index_entry
Definition: DWARFUnit.h:44
DWARFUnit::GetStrOffsetsBase
dw_addr_t GetStrOffsetsBase() const
Definition: DWARFUnit.h:158
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:34
DWARFUnitHeader::m_offset
dw_offset_t m_offset
Definition: DWARFUnit.h:39
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:959
DWARFUnit::m_first_die
DWARFDebugInfoEntry m_first_die
Definition: DWARFUnit.h:304
DWARFUnit::SetLoclistsBase
void SetLoclistsBase(dw_addr_t loclists_base)
Definition: DWARFUnit.cpp:445
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:15
DWARFUnitHeader::GetOffset
dw_offset_t GetOffset() const
Definition: DWARFUnit.h:57
DWARFUnit::m_dwo
std::shared_ptr< DWARFUnit > m_dwo
Definition: DWARFUnit.h:289
DWARFUnit::GetDWARFLanguageType
uint64_t GetDWARFLanguageType()
Definition: DWARFUnit.cpp:683
lldb_private::FileSpec
Definition: FileSpec.h:56
DWARFCompileUnit
Definition: DWARFCompileUnit.h:15
DWARFUnit::GetAddressByteSize
uint8_t GetAddressByteSize() const
Definition: DWARFUnit.h:153
DWARFUnit::ScopedExtractDIEs
Definition: DWARFUnit.h:97
DWARFUnit::AddUnitDIE
void AddUnitDIE(const DWARFDebugInfoEntry &cu_die)
Definition: DWARFUnit.cpp:299
DWARFUnit
Definition: DWARFUnit.h:80
DWARFUnit::m_abbrevs
const DWARFAbbreviationDeclarationSet * m_abbrevs
Definition: DWARFUnit.h:291
DWARFUnitHeader::GetDWOId
uint64_t GetDWOId() const
Definition: DWARFUnit.h:68
DWARFUnit::GetCompilationDirectory
const lldb_private::FileSpec & GetCompilationDirectory()
Definition: DWARFUnit.cpp:715
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:464
DWARFUnit::m_cancel_scopes
std::atomic< bool > m_cancel_scopes
Definition: DWARFUnit.h:300
dwarf
Definition: ABISysV_arc.cpp:61
DWARFUnit::GetNextUnitOffset
dw_offset_t GetNextUnitOffset() const
Definition: DWARFUnit.h:145
lldb_private::DataExtractor
Definition: DataExtractor.h:48
DWARFUnit::m_producer_version_major
uint32_t m_producer_version_major
Definition: DWARFUnit.h:311
DWARFUnit::ScopedExtractDIEs::ScopedExtractDIEs
ScopedExtractDIEs(DWARFUnit &cu)
Definition: DWARFUnit.cpp:111
DWARFUnit::ParseProducerInfo
void ParseProducerInfo()
Definition: DWARFUnit.cpp:620
DWARFUnit::GetAddrBase
dw_addr_t GetAddrBase() const
Definition: DWARFUnit.h:154
DWARFUnitSP
std::shared_ptr< DWARFUnit > DWARFUnitSP
Definition: DWARFUnit.h:23
DWARFUnitHeader::GetNextUnitOffset
uint32_t GetNextUnitOffset() const
Definition: DWARFUnit.h:72
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:61
DWARFUnit::GetPathStyle
lldb_private::FileSpec::Style GetPathStyle()
Definition: DWARFUnit.cpp:709
DWARFUnit::GetAbbrevOffset
dw_offset_t GetAbbrevOffset() const
Definition: DWARFUnit.cpp:410
DWARFUnitHeader::m_addr_size
uint8_t m_addr_size
Definition: DWARFUnit.h:47
DWARFUnit::ScopedExtractDIEs::m_cu
DWARFUnit * m_cu
Definition: DWARFUnit.h:98
DWARFUnit::GetStringOffsetSectionItem
llvm::Optional< uint64_t > GetStringOffsetSectionItem(uint32_t index) const
Definition: DWARFUnit.cpp:953
DWARFUnit::ScopedExtractDIEs::~ScopedExtractDIEs
~ScopedExtractDIEs()
Definition: DWARFUnit.cpp:115
DWARFUnit::GetFirstDIEOffset
dw_offset_t GetFirstDIEOffset() const
Definition: DWARFUnit.h:142
DWARFUnit::m_func_aranges_up
std::unique_ptr< DWARFDebugAranges > m_func_aranges_up
Definition: DWARFUnit.h:308
DWARFUnit::SetStrOffsetsBase
void SetStrOffsetsBase(dw_offset_t str_offsets_base)
Definition: DWARFUnit.cpp:529
DWARFUnit::m_str_offsets_base
dw_offset_t m_str_offsets_base
Definition: DWARFUnit.h:325
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:334
DWARFUnit::GetProducerVersionUpdate
uint32_t GetProducerVersionUpdate()
Definition: DWARFUnit.cpp:677
lldb-enumerations.h
DWARFUnitHeader::GetUnitType
uint8_t GetUnitType() const
Definition: DWARFUnit.h:62
DWARFUnit::Supports_unnamed_objc_bitfields
bool Supports_unnamed_objc_bitfields()
Definition: DWARFUnit.cpp:610
DWARFUnit::GetProducerVersionMinor
uint32_t GetProducerVersionMinor()
Definition: DWARFUnit.cpp:671
DWARFUnit::m_die_array_scoped_mutex
llvm::sys::RWMutex m_die_array_scoped_mutex
Definition: DWARFUnit.h:297
DWARFUnitHeader::IsTypeUnit
bool IsTypeUnit() const
Definition: DWARFUnit.h:69
DWARFUnitHeader
Base class describing the header of any kind of "unit." Some information is specific to certain unit ...
Definition: DWARFUnit.h:38
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:937
DWARFUnit::m_producer_version_minor
uint32_t m_producer_version_minor
Definition: DWARFUnit.h:312
DWARFUnitHeader::m_type_offset
uint32_t m_type_offset
Definition: DWARFUnit.h:50
DWARFUnit::die_iterator_range
llvm::iterator_range< DWARFDebugInfoEntry::collection::iterator > die_iterator_range
Definition: DWARFUnit.h:82
DWARFUnit::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Definition: DWARFUnit.cpp:542
DWARFUnit::ScopedExtractDIEs::operator=
const ScopedExtractDIEs & operator=(const ScopedExtractDIEs &)=delete
DWARFUnit::GetBaseAddress
dw_addr_t GetBaseAddress() const
Definition: DWARFUnit.h:155
DWARFUnit::GetLineTableOffset
dw_offset_t GetLineTableOffset()
Definition: DWARFUnit.cpp:414
eProducerLLVMGCC
@ eProducerLLVMGCC
Definition: DWARFUnit.h:31
DWARFUnit::dies
die_iterator_range dies()
Definition: DWARFUnit.h:214
eProducerGCC
@ eProducerGCC
Definition: DWARFUnit.h:30
DWARFUnit::GetOffset
dw_offset_t GetOffset() const
Definition: DWARFUnit.h:129
DWARFUnit::m_addr_base
dw_addr_t m_addr_base
Value of DW_AT_addr_base.
Definition: DWARFUnit.h:318
DWARFUnit::IsDWOUnit
bool IsDWOUnit()
Definition: DWARFUnit.h:91
DWARFUnit::GetFunctionAranges
const DWARFDebugAranges & GetFunctionAranges()
Definition: DWARFUnit.cpp:794
lldb_private::FileSpec::Style
llvm::sys::path::Style Style
Definition: FileSpec.h:58
DWARFUnit::m_producer
DWARFProducer m_producer
Definition: DWARFUnit.h:310
DWARFUnit::m_is_dwo
bool m_is_dwo
Definition: DWARFUnit.h:332
DWARFUnit::operator=
const DWARFUnit & operator=(const DWARFUnit &)=delete
DWARFUnit::ExtractDIEsScoped
ScopedExtractDIEs ExtractDIEsScoped()
Definition: DWARFUnit.cpp:91
eProducerInvalid
@ eProducerInvalid
Definition: DWARFUnit.h:28
DWARFUnit::m_rnglist_table
llvm::Optional< llvm::DWARFDebugRnglistTable > m_rnglist_table
Definition: DWARFUnit.h:327
DWARFAbbreviationDeclarationSet
Definition: DWARFDebugAbbrev.h:27
DWARFUnit::SetRangesBase
void SetRangesBase(dw_addr_t ranges_base)
Definition: DWARFUnit.cpp:487
DWARFUnitHeader::m_unit_type
uint8_t m_unit_type
Definition: DWARFUnit.h:46
DWARFUnit::DW_AT_decl_file_attributes_are_invalid
bool DW_AT_decl_file_attributes_are_invalid()
Definition: DWARFUnit.cpp:604
DWARFUnit::GetLength
uint32_t GetLength() const
Definition: DWARFUnit.h:149
DWARFUnitHeader::GetAddressByteSize
uint16_t GetAddressByteSize() const
Definition: DWARFUnit.h:59
DWARFUnit::m_section
const DIERef::Section m_section
Definition: DWARFUnit.h:331
uint32_t
DWARFDebugInfoEntry.h
DWARFUnit::GetUnitDIEOnly
DWARFBaseDIE GetUnitDIEOnly()
Definition: DWARFUnit.h:171
DWARFUnit::SetBaseAddress
void SetBaseAddress(dw_addr_t base_addr)
Definition: DWARFUnit.cpp:546
DWARFUnit::GetVersion
uint16_t GetVersion() const
Definition: DWARFUnit.h:150
DWARFUnit::ExtractDIEsIfNeeded
void ExtractDIEsIfNeeded()
Definition: DWARFUnit.cpp:71
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::Verify
bool Verify(lldb_private::Stream *s) const
DWARFUnitHeader::m_abbr_offset
dw_offset_t m_abbr_offset
Definition: DWARFUnit.h:42
DWARFUnit::m_line_table_offset
dw_offset_t m_line_table_offset
Value of DW_AT_stmt_list.
Definition: DWARFUnit.h:323
DWARFUnit::m_user_data
void * m_user_data
Definition: DWARFUnit.h:292
SymbolFileDWARFDwo
Definition: SymbolFileDWARFDwo.h:14
DWARFUnit::GetNonSkeletonUnit
DWARFUnit & GetNonSkeletonUnit()
Definition: DWARFUnit.cpp:581
DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type
bool Supports_DW_AT_APPLE_objc_complete_type()
Definition: DWARFUnit.cpp:600
DWARFUnitHeader::m_length
dw_offset_t m_length
Definition: DWARFUnit.h:40
DWARFUnitHeader::GetIndexEntry
const llvm::DWARFUnitIndex::Entry * GetIndexEntry() const
Definition: DWARFUnit.h:63
DWARFUnit::GetLengthByteSize
size_t GetLengthByteSize() const
Get the size in bytes of the length field in the header.
Definition: DWARFUnit.h:136
lldb_private::DWARFDataExtractor::GetAsLLVM
llvm::DWARFDataExtractor GetAsLLVM() const
Definition: DWARFDataExtractor.cpp:24
uint16_t
DWARFUnitHeader::GetTypeOffset
dw_offset_t GetTypeOffset() const
Definition: DWARFUnit.h:67
DWARFUnit::m_first_die_mutex
llvm::sys::RWMutex m_first_die_mutex
Definition: DWARFUnit.h:305
DWARFUnit::GetLocationData
lldb_private::DWARFDataExtractor GetLocationData() const
Definition: DWARFUnit.cpp:474
DWARFUnit::GetUnitType
uint8_t GetUnitType() const
Definition: DWARFUnit.h:221
DWARFUnit::m_producer_version_update
uint32_t m_producer_version_update
Definition: DWARFUnit.h:313
DWARFUnit::ComputeAbsolutePath
void ComputeAbsolutePath()
Definition: DWARFUnit.cpp:773
DWARFUnit::ExtractUnitDIEIfNeeded
void ExtractUnitDIEIfNeeded()
Definition: DWARFUnit.cpp:43
DWARFUnit::GetLoclistOffset
llvm::Optional< uint64_t > GetLoclistOffset(uint32_t Index)
Definition: DWARFUnit.h:240
DWARFUnit::GetUserData
void * GetUserData() const
Definition: DWARFUnit.cpp:596
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:294
eProcucerOther
@ eProcucerOther
Definition: DWARFUnit.h:32
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:815
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:29
DWARFUnit::DIE
DWARFDIE DIE()
Definition: DWARFUnit.h:173
DWARFUnitHeader::GetTypeHash
uint64_t GetTypeHash() const
Definition: DWARFUnit.h:66
DWARFUnit::SetAddrBase
void SetAddrBase(dw_addr_t addr_base)
Definition: DWARFUnit.cpp:419
Entry
FormatEntity::Entry Entry
Definition: FormatEntity.cpp:82
DWARFUnit::ContainsDIEOffset
bool ContainsDIEOffset(dw_offset_t die_offset) const
Definition: DWARFUnit.h:138
DWARFUnit::GetDefaultAddressSize
static uint8_t GetDefaultAddressSize()
Definition: DWARFUnit.cpp:594
DWARFUnit::GetRangesBase
dw_addr_t GetRangesBase() const
Definition: DWARFUnit.h:157
DWARFUnit::GetSymbolFileDWARF
SymbolFileDWARF & GetSymbolFileDWARF() const
Definition: DWARFUnit.h:193
DWARFUnit::m_die_array_mutex
llvm::sys::RWMutex m_die_array_mutex
Definition: DWARFUnit.h:295
DWARFUnit::GetAbbreviations
const DWARFAbbreviationDeclarationSet * GetAbbreviations() const
Definition: DWARFUnit.cpp:406
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:1002
DWARFUnit::GetDebugSection
DIERef::Section GetDebugSection() const
Definition: DWARFUnit.h:219
dw_addr_t
uint64_t dw_addr_t
Definition: dwarf.h:26
DWARFUnit::GetIsOptimized
bool GetIsOptimized()
Definition: DWARFUnit.cpp:695
DWARFUnit::SetDwoStrOffsetsBase
void SetDwoStrOffsetsBase()
Definition: DWARFUnit.cpp:264
DWARFUnit::m_loclist_table_header
llvm::Optional< llvm::DWARFListTableHeader > m_loclist_table_header
Definition: DWARFUnit.h:329
DWARFUnitHeader::m_dwo_id
uint64_t m_dwo_id
Definition: DWARFUnit.h:52
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::GetRnglist
const llvm::Optional< llvm::DWARFDebugRnglistTable > & GetRnglist()
Definition: DWARFUnit.cpp:493
DWARFUnit::GetFile
lldb_private::FileSpec GetFile(size_t file_idx)
Definition: DWARFUnit.cpp:727
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:721
lldb_private::DWARFContext::getOrLoadLocListsData
const DWARFDataExtractor & getOrLoadLocListsData()
Definition: DWARFContext.cpp:88
DWARFUnitHeader::GetLength
dw_offset_t GetLength() const
Definition: DWARFUnit.h:60
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:560