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  llvm::Optional<uint64_t> m_dwo_id;
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  llvm::Optional<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  llvm::Optional<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.value_or(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 
174 
175  void SetBaseAddress(dw_addr_t base_addr);
176 
178 
179  DWARFDIE DIE() { return DWARFDIE(this, DIEPtr()); }
180 
181  DWARFDIE GetDIE(dw_offset_t die_offset);
182 
184 
185  static uint8_t GetAddressByteSize(const DWARFUnit *cu);
186 
187  static uint8_t GetDefaultAddressSize();
188 
189  void *GetUserData() const;
190 
191  void SetUserData(void *d);
192 
194 
196 
198 
200 
202 
203  llvm::VersionTuple GetProducerVersion();
204 
205  uint64_t GetDWARFLanguageType();
206 
207  bool GetIsOptimized();
208 
211  lldb_private::FileSpec GetFile(size_t file_idx);
213 
215 
218  return die_iterator_range(m_die_array.begin(), m_die_array.end());
219  }
220 
222 
223  uint8_t GetUnitType() const { return m_header.GetUnitType(); }
224  bool IsTypeUnit() const { return m_header.IsTypeUnit(); }
225 
226  llvm::Optional<uint64_t> GetStringOffsetSectionItem(uint32_t index) const;
227 
228  /// Return a list of address ranges resulting from a (possibly encoded)
229  /// range list starting at a given offset in the appropriate ranges section.
230  llvm::Expected<DWARFRangeList> FindRnglistFromOffset(dw_offset_t offset);
231 
232  /// Return a list of address ranges retrieved from an encoded range
233  /// list whose offset is found via a table lookup given an index (DWARF v5
234  /// and later).
235  llvm::Expected<DWARFRangeList> FindRnglistFromIndex(uint32_t index);
236 
237  /// Return a rangelist's offset based on an index. The index designates
238  /// an entry in the rangelist table's offset array and is supplied by
239  /// DW_FORM_rnglistx.
240  llvm::Expected<uint64_t> GetRnglistOffset(uint32_t Index);
241 
242  llvm::Optional<uint64_t> GetLoclistOffset(uint32_t Index) {
244  return llvm::None;
245 
246  llvm::Optional<uint64_t> Offset = m_loclist_table_header->getOffsetEntry(
248  if (!Offset)
249  return llvm::None;
250  return *Offset + m_loclists_base;
251  }
252 
253  /// Return the location table for parsing the given location list data. The
254  /// format is chosen according to the unit type. Never returns null.
255  std::unique_ptr<llvm::DWARFLocationTable>
257 
259 
260  /// Returns true if any DIEs in the unit match any DW_TAG values in \a tags.
261  ///
262  /// \param[in] tags
263  /// An array of dw_tag_t values to check all abbrevitions for.
264  ///
265  /// \returns
266  /// True if any DIEs match any tag in \a tags, false otherwise.
267  bool HasAny(llvm::ArrayRef<dw_tag_t> tags);
268 
269 
270  /// Get the fission .dwo file specific error for this compile unit.
271  ///
272  /// The skeleton compile unit only can have a DWO error. Any other type
273  /// of DWARFUnit will not have a valid DWO error.
274  ///
275  /// \returns
276  /// A valid DWO error if there is a problem with anything in the
277  /// locating or parsing inforamtion in the .dwo file
278  const lldb_private::Status &GetDwoError() const { return m_dwo_error; }
279 
280  /// Set the fission .dwo file specific error for this compile unit.
281  ///
282  /// This helps tracks issues that arise when trying to locate or parse a
283  /// .dwo file. Things like a missing .dwo file, DWO ID mismatch, and other
284  /// .dwo errors can be stored in each compile unit so the issues can be
285  /// communicated to the user.
287 
288 protected:
290  const DWARFUnitHeader &header,
291  const DWARFAbbreviationDeclarationSet &abbrevs,
292  DIERef::Section section, bool is_dwo);
293 
296  lldb::offset_t *offset_ptr);
297 
298  // Get the DWARF unit DWARF debug information entry. Parse the single DIE
299  // if needed.
302  // m_first_die_mutex is not required as m_first_die is never cleared.
303  if (!m_first_die)
304  return nullptr;
305  return &m_first_die;
306  }
307 
308  // Get all DWARF debug informration entries. Parse all DIEs if needed.
311  if (m_die_array.empty())
312  return nullptr;
313  return &m_die_array[0];
314  }
315 
316  const llvm::Optional<llvm::DWARFDebugRnglistTable> &GetRnglistTable();
317 
319 
321  std::shared_ptr<DWARFUnit> m_dwo;
324  void *m_user_data = nullptr;
325  // The compile unit debug information entry item
327  mutable llvm::sys::RWMutex m_die_array_mutex;
328  // It is used for tracking of ScopedExtractDIEs instances.
329  mutable llvm::sys::RWMutex m_die_array_scoped_mutex;
330  // ScopedExtractDIEs instances should not call ClearDIEsRWLocked()
331  // as someone called ExtractDIEsIfNeeded().
332  std::atomic<bool> m_cancel_scopes;
333  // GetUnitDIEPtrOnly() needs to return pointer to the first DIE.
334  // But the first element of m_die_array after ExtractUnitDIEIfNeeded()
335  // would possibly move in memory after later ExtractDIEsIfNeeded().
337  llvm::sys::RWMutex m_first_die_mutex;
338  // A table similar to the .debug_aranges table, but this one points to the
339  // exact DW_TAG_subprogram DIEs
340  std::unique_ptr<DWARFDebugAranges> m_func_aranges_up;
343  llvm::VersionTuple m_producer_version;
344  llvm::Optional<uint64_t> m_language_type;
346  llvm::Optional<lldb_private::FileSpec> m_comp_dir;
347  llvm::Optional<lldb_private::FileSpec> m_file_spec;
348  llvm::Optional<dw_addr_t> m_addr_base; ///< Value of DW_AT_addr_base.
349  dw_addr_t m_loclists_base = 0; ///< Value of DW_AT_loclists_base.
350  dw_addr_t m_ranges_base = 0; ///< Value of DW_AT_rnglists_base.
351  llvm::Optional<uint64_t> m_gnu_addr_base;
352  llvm::Optional<uint64_t> m_gnu_ranges_base;
353 
354  /// Value of DW_AT_stmt_list.
356 
357  dw_offset_t m_str_offsets_base = 0; // Value of DW_AT_str_offsets_base.
358 
359  llvm::Optional<llvm::DWARFDebugRnglistTable> m_rnglist_table;
360  bool m_rnglist_table_done = false;
361  llvm::Optional<llvm::DWARFListTableHeader> m_loclist_table_header;
362 
364  bool m_is_dwo;
366  /// Value of DW_AT_GNU_dwo_id (v4) or dwo_id from CU header (v5).
367  llvm::Optional<uint64_t> m_dwo_id;
368  /// If we get an error when trying to load a .dwo file, save that error here.
369  /// Errors include .dwo/.dwp file not found, or the .dwp/.dwp file was found
370  /// but DWO ID doesn't match, etc.
372 
373 private:
374  void ParseProducerInfo();
375  void ExtractDIEsRWLocked();
376  void ClearDIEsRWLocked();
377 
378  void AddUnitDIE(const DWARFDebugInfoEntry &cu_die);
379  void SetDwoStrOffsetsBase();
380 
382  void ComputeAbsolutePath();
383 
384  DWARFUnit(const DWARFUnit &) = delete;
385  const DWARFUnit &operator=(const DWARFUnit &) = delete;
386 };
387 
388 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFUNIT_H
DWARFUnit::GetRnglistData
lldb_private::DWARFDataExtractor GetRnglistData() const
Definition: DWARFUnit.cpp:531
DWARFUnit::m_producer_version
llvm::VersionTuple m_producer_version
Definition: DWARFUnit.h:343
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:572
DWARFUnit::SetUserData
void SetUserData(void *d)
Definition: DWARFUnit.cpp:671
DWARFUnit::GetData
const lldb_private::DWARFDataExtractor & GetData() const
Get the data that contains the DIE information for this unit.
Definition: DWARFUnit.cpp:992
DWARFUnit::m_addr_base
llvm::Optional< dw_addr_t > m_addr_base
Value of DW_AT_addr_base.
Definition: DWARFUnit.h:348
DWARFDIE.h
eProducerClang
@ eProducerClang
Definition: DWARFUnit.h:30
DWARFUnit::GetRnglistTable
const llvm::Optional< llvm::DWARFDebugRnglistTable > & GetRnglistTable()
Definition: DWARFUnit.cpp:556
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:725
DWARFUnit::ScopedExtractDIEs::m_clear_dies
bool m_clear_dies
Definition: DWARFUnit.h:104
SymbolFileDWARF::GetDWARFContext
lldb_private::DWARFContext & GetDWARFContext()
Definition: SymbolFileDWARF.h:297
lldb_private::UserID
Definition: UserID.h:31
DWARFUnitHeader::m_dwo_id
llvm::Optional< uint64_t > m_dwo_id
Definition: DWARFUnit.h:54
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:349
DWARFUnit::GetDwoSymbolFile
SymbolFileDWARFDwo * GetDwoSymbolFile()
Definition: DWARFUnit.cpp:842
DWARFUnit::m_header
DWARFUnitHeader m_header
Definition: DWARFUnit.h:322
DWARFUnit::m_ranges_base
dw_addr_t m_ranges_base
Value of DW_AT_rnglists_base.
Definition: DWARFUnit.h:350
DWARFProducer
DWARFProducer
Definition: DWARFUnit.h:28
DWARFUnit::ExtractDIEsRWLocked
void ExtractDIEsRWLocked()
Definition: DWARFUnit.cpp:211
DWARFUnitHeader::m_version
uint16_t m_version
Definition: DWARFUnit.h:43
SymbolFileDWARF
Definition: SymbolFileDWARF.h:60
DWARFUnit::HasAny
bool HasAny(llvm::ArrayRef< dw_tag_t > tags)
Returns true if any DIEs in the unit match any DW_TAG values in tags.
Definition: DWARFUnit.cpp:1075
DWARFUnit::m_comp_dir
llvm::Optional< lldb_private::FileSpec > m_comp_dir
Definition: DWARFUnit.h:346
DWARFUnit::m_rnglist_table_done
bool m_rnglist_table_done
Definition: DWARFUnit.h:360
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
DWARFUnit::ComputeCompDirAndGuessPathStyle
void ComputeCompDirAndGuessPathStyle()
Definition: DWARFUnit.cpp:806
DWARFUnit::SetDwoError
void SetDwoError(const lldb_private::Status &error)
Set the fission .dwo file specific error for this compile unit.
Definition: DWARFUnit.h:286
DWARFUnit::m_dwarf
SymbolFileDWARF & m_dwarf
Definition: DWARFUnit.h:320
DWARFUnit::GetDebugInfoSize
size_t GetDebugInfoSize() const
Definition: DWARFUnit.cpp:427
DWARFUnit::ClearDIEsRWLocked
void ClearDIEsRWLocked()
Definition: DWARFUnit.cpp:607
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:956
DWARFUnit::m_is_optimized
lldb_private::LazyBool m_is_optimized
Definition: DWARFUnit.h:345
DWARFUnit::m_base_addr
dw_addr_t m_base_addr
Definition: DWARFUnit.h:341
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:1020
DWARFUnit::m_first_die
DWARFDebugInfoEntry m_first_die
Definition: DWARFUnit.h:336
DWARFUnit::SetLoclistsBase
void SetLoclistsBase(dw_addr_t loclists_base)
Definition: DWARFUnit.cpp:475
lldb_private::DWARFContext
Definition: DWARFContext.h:20
XcodeSDK.h
DWARFUnit::GetUnitDIEPtrOnly
const DWARFDebugInfoEntry * GetUnitDIEPtrOnly()
Definition: DWARFUnit.h:300
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:321
DWARFUnit::GetDWARFLanguageType
uint64_t GetDWARFLanguageType()
Definition: DWARFUnit.cpp:737
lldb_private::FileSpec
Definition: FileSpec.h:55
DWARFCompileUnit
Definition: DWARFCompileUnit.h:15
eProducerSwift
@ eProducerSwift
Definition: DWARFUnit.h:33
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
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:367
DWARFUnit
Definition: DWARFUnit.h:83
DWARFUnit::m_abbrevs
const DWARFAbbreviationDeclarationSet * m_abbrevs
Definition: DWARFUnit.h:323
DWARFUnit::GetCompilationDirectory
const lldb_private::FileSpec & GetCompilationDirectory()
Definition: DWARFUnit.cpp:769
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:507
DWARFUnit::m_cancel_scopes
std::atomic< bool > m_cancel_scopes
Definition: DWARFUnit.h:332
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:178
DWARFUnit::ParseProducerInfo
void ParseProducerInfo()
Definition: DWARFUnit.cpp:690
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::GetDWOId
llvm::Optional< uint64_t > GetDWOId()
Definition: DWARFUnit.cpp:361
DWARFUnit::GetPathStyle
lldb_private::FileSpec::Style GetPathStyle()
Definition: DWARFUnit.cpp:763
DWARFUnit::GetAbbrevOffset
dw_offset_t GetAbbrevOffset() const
Definition: DWARFUnit.cpp:435
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:1014
DWARFUnit::ScopedExtractDIEs::~ScopedExtractDIEs
~ScopedExtractDIEs()
Definition: DWARFUnit.cpp:182
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:340
DWARFUnit::SetStrOffsetsBase
void SetStrOffsetsBase(dw_offset_t str_offsets_base)
Definition: DWARFUnit.cpp:591
DWARFUnit::m_str_offsets_base
dw_offset_t m_str_offsets_base
Definition: DWARFUnit.h:357
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:683
DWARFUnit::m_die_array_scoped_mutex
llvm::sys::RWMutex m_die_array_scoped_mutex
Definition: DWARFUnit.h:329
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:309
DWARFUnit::m_dwo_error
lldb_private::Status m_dwo_error
If we get an error when trying to load a .dwo file, save that error here.
Definition: DWARFUnit.h:371
DWARFUnit::GetHeaderByteSize
uint32_t GetHeaderByteSize() const
Get the size in bytes of the unit header.
Definition: DWARFUnit.cpp:998
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:615
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:439
eProducerLLVMGCC
@ eProducerLLVMGCC
Definition: DWARFUnit.h:32
DWARFUnit::dies
die_iterator_range dies()
Definition: DWARFUnit.h:216
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:849
lldb_private::FileSpec::Style
llvm::sys::path::Style Style
Definition: FileSpec.h:57
DWARFUnit::m_producer
DWARFProducer m_producer
Definition: DWARFUnit.h:342
DWARFUnit::m_is_dwo
bool m_is_dwo
Definition: DWARFUnit.h:364
DWARFUnit::operator=
const DWARFUnit & operator=(const DWARFUnit &)=delete
DWARFUnit::ExtractDIEsScoped
ScopedExtractDIEs ExtractDIEsScoped()
Definition: DWARFUnit.cpp:158
eProducerInvalid
@ eProducerInvalid
Definition: DWARFUnit.h:29
DWARFUnit::m_rnglist_table
llvm::Optional< llvm::DWARFDebugRnglistTable > m_rnglist_table
Definition: DWARFUnit.h:359
DWARFAbbreviationDeclarationSet
Definition: DWARFDebugAbbrev.h:27
lldb_private::Status
Definition: Status.h:44
DWARFUnit::SetRangesBase
void SetRangesBase(dw_addr_t ranges_base)
Definition: DWARFUnit.cpp:549
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:677
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:363
DWARFUnitHeader::GetDWOId
llvm::Optional< uint64_t > GetDWOId() const
Definition: DWARFUnit.h:70
uint32_t
DWARFDebugInfoEntry.h
DWARFUnit::GetUnitDIEOnly
DWARFBaseDIE GetUnitDIEOnly()
Definition: DWARFUnit.h:177
DWARFUnit::SetBaseAddress
void SetBaseAddress(dw_addr_t base_addr)
Definition: DWARFUnit.cpp:619
DWARFUnit::GetVersion
uint16_t GetVersion() const
Definition: DWARFUnit.h:154
DWARFUnit::ExtractDIEsIfNeeded
void ExtractDIEsIfNeeded()
Definition: DWARFUnit.cpp:138
DWARFUnit::m_language_type
llvm::Optional< uint64_t > m_language_type
Definition: DWARFUnit.h:344
DWARFUnit::IsTypeUnit
bool IsTypeUnit() const
Definition: DWARFUnit.h:224
DWARFUnit::m_has_parsed_non_skeleton_unit
bool m_has_parsed_non_skeleton_unit
Definition: DWARFUnit.h:365
DWARFUnit::m_gnu_addr_base
llvm::Optional< uint64_t > m_gnu_addr_base
Definition: DWARFUnit.h:351
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:355
DWARFUnit::m_user_data
void * m_user_data
Definition: DWARFUnit.h:324
DWARFUnit::m_dwo_id
llvm::Optional< uint64_t > m_dwo_id
Value of DW_AT_GNU_dwo_id (v4) or dwo_id from CU header (v5).
Definition: DWARFUnit.h:367
SymbolFileDWARFDwo
Definition: SymbolFileDWARFDwo.h:14
DWARFUnit::GetNonSkeletonUnit
DWARFUnit & GetNonSkeletonUnit()
Definition: DWARFUnit.cpp:654
DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type
bool Supports_DW_AT_APPLE_objc_complete_type()
Definition: DWARFUnit.cpp:673
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::GetDwoError
const lldb_private::Status & GetDwoError() const
Get the fission .dwo file specific error for this compile unit.
Definition: DWARFUnit.h:278
DWARFUnit::m_first_die_mutex
llvm::sys::RWMutex m_first_die_mutex
Definition: DWARFUnit.h:337
DWARFUnit::GetLocationData
lldb_private::DWARFDataExtractor GetLocationData() const
Definition: DWARFUnit.cpp:517
DWARFUnit::GetUnitType
uint8_t GetUnitType() const
Definition: DWARFUnit.h:223
eProducerOther
@ eProducerOther
Definition: DWARFUnit.h:34
DWARFUnit::ComputeAbsolutePath
void ComputeAbsolutePath()
Definition: DWARFUnit.cpp:828
DWARFUnit::ExtractUnitDIEIfNeeded
void ExtractUnitDIEIfNeeded()
Definition: DWARFUnit.cpp:70
DWARFUnit::GetLoclistOffset
llvm::Optional< uint64_t > GetLoclistOffset(uint32_t Index)
Definition: DWARFUnit.h:242
DWARFUnit::GetUserData
void * GetUserData() const
Definition: DWARFUnit.cpp:669
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:326
DWARFUnit::GetProducerVersion
llvm::VersionTuple GetProducerVersion()
Definition: DWARFUnit.cpp:731
DWARFUnit::m_gnu_ranges_base
llvm::Optional< uint64_t > m_gnu_ranges_base
Definition: DWARFUnit.h:352
DWARFDebugInfoEntry::collection
std::vector< DWARFDebugInfoEntry > collection
Definition: DWARFDebugInfoEntry.h:33
lldb_private::eLazyBoolCalculate
@ eLazyBoolCalculate
Definition: lldb-private-enumerations.h:115
DWARFUnit::ReadAddressFromDebugAddrSection
dw_addr_t ReadAddressFromDebugAddrSection(uint32_t index) const
Definition: DWARFUnit.cpp:595
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:870
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:34
DWARFUnit::DIE
DWARFDIE DIE()
Definition: DWARFUnit.h:179
DWARFUnitHeader::GetTypeHash
uint64_t GetTypeHash() const
Definition: DWARFUnit.h:68
DWARFUnit::SetAddrBase
void SetAddrBase(dw_addr_t addr_base)
Definition: DWARFUnit.cpp:444
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:667
DWARFUnit::GetRangesBase
dw_addr_t GetRangesBase() const
Definition: DWARFUnit.h:161
DWARFUnit::GetSymbolFileDWARF
SymbolFileDWARF & GetSymbolFileDWARF() const
Definition: DWARFUnit.h:199
DWARFUnit::m_die_array_mutex
llvm::sys::RWMutex m_die_array_mutex
Definition: DWARFUnit.h:327
DWARFUnit::GetAbbreviations
const DWARFAbbreviationDeclarationSet * GetAbbreviations() const
Definition: DWARFUnit.cpp:431
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:1067
DWARFUnit::GetDebugSection
DIERef::Section GetDebugSection() const
Definition: DWARFUnit.h:221
dw_addr_t
uint64_t dw_addr_t
Definition: dwarf.h:29
DWARFUnit::GetIsOptimized
bool GetIsOptimized()
Definition: DWARFUnit.cpp:749
DWARFUnit::SetDwoStrOffsetsBase
void SetDwoStrOffsetsBase()
Definition: DWARFUnit.cpp:332
DWARFUnit::m_loclist_table_header
llvm::Optional< llvm::DWARFListTableHeader > m_loclist_table_header
Definition: DWARFUnit.h:361
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:781
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:139
DWARFBaseDIE
Definition: DWARFBaseDIE.h:25
DWARFUnit::GetAbsolutePath
const lldb_private::FileSpec & GetAbsolutePath()
Definition: DWARFUnit.cpp:775
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:347
DWARFUnit::GetDIE
DWARFDIE GetDIE(dw_offset_t die_offset)
Definition: DWARFUnit.cpp:633