LLDB  mainline
SymbolFileDWARFDebugMap.h
Go to the documentation of this file.
1 //===-- SymbolFileDWARFDebugMap.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_SYMBOLFILEDWARFDEBUGMAP_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDEBUGMAP_H
11 
12 #include "lldb/Symbol/SymbolFile.h"
13 #include "lldb/Utility/RangeMap.h"
14 #include "llvm/Support/Chrono.h"
15 #include <bitset>
16 #include <map>
17 #include <vector>
18 
19 #include "UniqueDWARFASTType.h"
20 
21 class SymbolFileDWARF;
22 class DWARFCompileUnit;
23 class DWARFDebugAranges;
24 class DWARFDeclContext;
25 
27  /// LLVM RTTI support.
28  static char ID;
29 
30 public:
31  /// LLVM RTTI support.
32  /// \{
33  bool isA(const void *ClassID) const override {
34  return ClassID == &ID || SymbolFileCommon::isA(ClassID);
35  }
36  static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
37  /// \}
38 
39  // Static Functions
40  static void Initialize();
41 
42  static void Terminate();
43 
44  static llvm::StringRef GetPluginNameStatic() { return "dwarf-debugmap"; }
45 
46  static llvm::StringRef GetPluginDescriptionStatic();
47 
49  CreateInstance(lldb::ObjectFileSP objfile_sp);
50 
51  // Constructors and Destructors
52  SymbolFileDWARFDebugMap(lldb::ObjectFileSP objfile_sp);
53  ~SymbolFileDWARFDebugMap() override;
54 
55  uint32_t CalculateAbilities() override;
56  void InitializeObject() override;
57 
58  // Compile Unit function calls
60  ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
62  ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override;
63  size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
64  bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
65  bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
66 
68  lldb_private::CompileUnit &, llvm::DenseSet<lldb_private::SymbolFile *> &,
69  llvm::function_ref<bool(lldb_private::Module &)>) override;
70 
72  lldb_private::FileSpecList &support_files) override;
73 
74  bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override;
75 
76  size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
77 
80  std::vector<lldb_private::SourceModule> &imported_modules) override;
81  size_t ParseBlocksRecursive(lldb_private::Function &func) override;
82  size_t
84 
86  llvm::Optional<ArrayInfo> GetDynamicArrayInfoForUID(
87  lldb::user_id_t type_uid,
88  const lldb_private::ExecutionContext *exe_ctx) override;
89 
94  void
96 
97  bool CompleteType(lldb_private::CompilerType &compiler_type) override;
99  lldb::SymbolContextItem resolve_scope,
100  lldb_private::SymbolContext &sc) override;
102  const lldb_private::SourceLocationSpec &src_location_spec,
103  lldb::SymbolContextItem resolve_scope,
104  lldb_private::SymbolContextList &sc_list) override;
105 
108 
109  void
111  const lldb_private::CompilerDeclContext &parent_decl_ctx,
112  uint32_t max_matches,
113  lldb_private::VariableList &variables) override;
115  uint32_t max_matches,
116  lldb_private::VariableList &variables) override;
117  void FindFunctions(const lldb_private::Module::LookupInfo &lookup_info,
118  const lldb_private::CompilerDeclContext &parent_decl_ctx,
119  bool include_inlines,
120  lldb_private::SymbolContextList &sc_list) override;
122  bool include_inlines,
123  lldb_private::SymbolContextList &sc_list) override;
124  void
126  const lldb_private::CompilerDeclContext &parent_decl_ctx,
127  uint32_t max_matches,
128  llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
129  lldb_private::TypeMap &types) override;
130  void
131  FindTypes(llvm::ArrayRef<lldb_private::CompilerContext> context,
132  lldb_private::LanguageSet languages,
133  llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
134  lldb_private::TypeMap &types) override;
137  const lldb_private::CompilerDeclContext &parent_decl_ctx) override;
139  lldb::TypeClass type_mask,
140  lldb_private::TypeList &type_list) override;
141  std::vector<std::unique_ptr<lldb_private::CallEdge>>
143 
144  void DumpClangAST(lldb_private::Stream &s) override;
145 
146  // PluginInterface protocol
147  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
148 
149  // Statistics overrides.
151 
152 protected:
153  enum { kHaveInitializedOSOs = (1 << 0), kNumFlags };
154 
155  friend class DebugMapModule;
156  friend class DWARFASTParserClang;
157  friend class DWARFCompileUnit;
158  friend class SymbolFileDWARF;
159  struct OSOInfo {
160  lldb::ModuleSP module_sp;
161 
163  };
164 
165  typedef std::shared_ptr<OSOInfo> OSOInfoSP;
166 
168  lldb::addr_t>
170 
171  // Class specific types
175  llvm::sys::TimePoint<> oso_mod_time;
178  /// The compile units that an object file contains.
179  llvm::SmallVector<lldb::CompUnitSP, 2> compile_units_sps;
180  /// A map from the compile unit ID to its index in the vector.
181  llvm::SmallDenseMap<uint64_t, uint64_t, 2> id_to_index_map;
187  bool file_range_map_valid = false;
188 
189  CompileUnitInfo() = default;
190 
192  };
193 
194  // Protected Member Functions
195  void InitOSO();
196 
197  /// This function actually returns the number of object files, which may be
198  /// less than the actual number of compile units, since an object file may
199  /// contain more than one compile unit. SymbolFileDWARFDebugMap looks up the
200  /// number of compile units by reading the nlist symbol table, which
201  /// currently, on macOS, only reports one compile unit per object file, and
202  /// there's no efficient way to calculate the actual number of compile units
203  /// upfront.
205 
206  /// This function actually returns the first compile unit the object file at
207  /// the given index contains.
208  lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
209 
211  return (uint32_t)((uid >> 32ull) - 1ull);
212  }
213 
215 
216  bool GetFileSpecForSO(uint32_t oso_idx, lldb_private::FileSpec &file_spec);
217 
218  CompileUnitInfo *GetCompUnitInfo(const lldb_private::SymbolContext &sc);
219  CompileUnitInfo *GetCompUnitInfo(const lldb_private::CompileUnit &comp_unit);
220 
221  size_t GetCompUnitInfosForModule(const lldb_private::Module *oso_module,
222  std::vector<CompileUnitInfo *> &cu_infos);
223 
225  GetModuleByCompUnitInfo(CompileUnitInfo *comp_unit_info);
226 
228 
230  GetObjectFileByCompUnitInfo(CompileUnitInfo *comp_unit_info);
231 
233 
234  uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info);
235 
238 
239  SymbolFileDWARF *GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info);
240 
242 
243  // If closure returns "false", iteration continues. If it returns
244  // "true", iteration terminates.
245  void ForEachSymbolFile(std::function<bool(SymbolFileDWARF *)> closure) {
246  for (uint32_t oso_idx = 0, num_oso_idxs = m_compile_unit_infos.size();
247  oso_idx < num_oso_idxs; ++oso_idx) {
248  if (SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx)) {
249  if (closure(oso_dwarf))
250  return;
251  }
252  }
253  }
254 
255  CompileUnitInfo *GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx,
256  uint32_t *oso_idx_ptr);
257 
258  CompileUnitInfo *GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id,
259  uint32_t *oso_idx_ptr);
260 
261  static int
262  SymbolContainsSymbolWithIndex(uint32_t *symbol_idx_ptr,
263  const CompileUnitInfo *comp_unit_info);
264 
265  static int SymbolContainsSymbolWithID(lldb::user_id_t *symbol_idx_ptr,
266  const CompileUnitInfo *comp_unit_info);
267 
270  const lldb_private::CompilerDeclContext &parent_decl_ctx,
271  const std::vector<uint32_t> &name_symbol_indexes, uint32_t max_matches,
272  lldb_private::VariableList &variables);
273 
274  void SetCompileUnit(SymbolFileDWARF *oso_dwarf,
275  const lldb::CompUnitSP &cu_sp);
276 
277  /// Returns the compile unit associated with the dwarf compile unit. This may
278  /// be one of the extra compile units an object file contains which isn't
279  /// reachable by ParseCompileUnitAtIndex(uint32_t).
280  lldb::CompUnitSP GetCompileUnit(SymbolFileDWARF *oso_dwarf,
281  DWARFCompileUnit &dwarf_cu);
282 
283  CompileUnitInfo *GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf);
284 
285  lldb::TypeSP
287 
289 
291  const DWARFDIE &die, lldb_private::ConstString type_name,
292  bool must_be_implementation);
293 
295  return m_unique_ast_type_map;
296  }
297 
298  // OSOEntry
299  class OSOEntry {
300  public:
301  OSOEntry() = default;
302 
303  OSOEntry(uint32_t exe_sym_idx, lldb::addr_t oso_file_addr)
304  : m_exe_sym_idx(exe_sym_idx), m_oso_file_addr(oso_file_addr) {}
305 
307 
308  bool operator<(const OSOEntry &rhs) const {
309  return m_exe_sym_idx < rhs.m_exe_sym_idx;
310  }
311 
313 
314  void SetOSOFileAddress(lldb::addr_t oso_file_addr) {
315  m_oso_file_addr = oso_file_addr;
316  }
317 
318  protected:
321  };
322 
325 
326  // Member Variables
327  std::bitset<kNumFlags> m_flags;
328  std::vector<CompileUnitInfo> m_compile_unit_infos;
329  std::vector<uint32_t> m_func_indexes; // Sorted by address
330  std::vector<uint32_t> m_glob_indexes;
331  std::map<std::pair<lldb_private::ConstString, llvm::sys::TimePoint<>>,
332  OSOInfoSP>
337 
338  // When an object file from the debug map gets parsed in
339  // SymbolFileDWARF, it needs to tell the debug map about the object
340  // files addresses by calling this function once for each N_FUN,
341  // N_GSYM and N_STSYM and after all entries in the debug map have
342  // been matched up, FinalizeOSOFileRanges() should be called.
343  bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr,
344  lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr,
345  lldb::addr_t oso_byte_size);
346 
347  // Called after calling AddOSOFileRange() for each object file debug
348  // map entry to finalize the info for the unlinked compile unit.
349  void FinalizeOSOFileRanges(CompileUnitInfo *cu_info);
350 
351  /// Convert \a addr from a .o file address, to an executable address.
352  ///
353  /// \param[in] addr
354  /// A section offset address from a .o file
355  ///
356  /// \return
357  /// Returns true if \a addr was converted to be an executable
358  /// section/offset address, false otherwise.
360 
361  /// Convert a .o file "file address" to an executable "file address".
362  ///
363  /// \param[in] oso_symfile
364  /// The DWARF symbol file that contains \a oso_file_addr
365  ///
366  /// \param[in] oso_file_addr
367  /// A .o file "file address" to convert.
368  ///
369  /// \return
370  /// LLDB_INVALID_ADDRESS if \a oso_file_addr is not in the
371  /// linked executable, otherwise a valid "file address" from the
372  /// linked executable that contains the debug map.
374  lldb::addr_t oso_file_addr);
375 
376  /// Given a line table full of lines with "file addresses" that are
377  /// for a .o file represented by \a oso_symfile, link a new line table
378  /// and return it.
379  ///
380  /// \param[in] oso_symfile
381  /// The DWARF symbol file that produced the \a line_table
382  ///
383  /// \param[in] line_table
384  /// A pointer to the line table.
385  ///
386  /// \return
387  /// Returns a valid line table full of linked addresses, or NULL
388  /// if none of the line table addresses exist in the main
389  /// executable.
391  LinkOSOLineTable(SymbolFileDWARF *oso_symfile,
392  lldb_private::LineTable *line_table);
393 
394  size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data,
395  DWARFDebugAranges *debug_aranges);
396 };
397 
398 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDEBUGMAP_H
SymbolFileDWARFDebugMap::ParseCompileUnitAtIndex
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
This function actually returns the first compile unit the object file at the given index contains.
Definition: SymbolFileDWARFDebugMap.cpp:587
SymbolFileDWARFDebugMap::GetObjectFileByOSOIndex
lldb_private::ObjectFile * GetObjectFileByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:500
SymbolFileDWARFDebugMap::GetSymbolFile
SymbolFileDWARF * GetSymbolFile(const lldb_private::SymbolContext &sc)
Definition: SymbolFileDWARFDebugMap.cpp:508
SymbolFileDWARFDebugMap::CompileUnitInfo::file_range_map
FileRangeMap file_range_map
Definition: SymbolFileDWARFDebugMap.h:186
lldb_private::SymbolFile::SymbolFile
SymbolFile()=default
SymbolFileDWARFDebugMap::m_glob_indexes
std::vector< uint32_t > m_glob_indexes
Definition: SymbolFileDWARFDebugMap.h:330
SymbolFileDWARFDebugMap::GetPluginName
llvm::StringRef GetPluginName() override
Definition: SymbolFileDWARFDebugMap.h:147
lldb_private::SymbolFile
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:46
SymbolFileDWARFDebugMap::GetObjectFileByCompUnitInfo
lldb_private::ObjectFile * GetObjectFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:520
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
SymbolFileDWARFDebugMap::GetCompUnitInfo
CompileUnitInfo * GetCompUnitInfo(const lldb_private::SymbolContext &sc)
Definition: SymbolFileDWARFDebugMap.cpp:634
SymbolFileDWARFDebugMap::ParseXcodeSDK
lldb_private::XcodeSDK ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
Definition: SymbolFileDWARFDebugMap.cpp:673
SymbolFileDWARFDebugMap::SetCompileUnit
void SetCompileUnit(SymbolFileDWARF *oso_dwarf, const lldb::CompUnitSP &cu_sp)
Definition: SymbolFileDWARFDebugMap.cpp:1303
SymbolFileDWARFDebugMap::DebugMap
lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, OSOEntry > DebugMap
Definition: SymbolFileDWARFDebugMap.h:324
SymbolFileDWARFDebugMap::m_flags
std::bitset< kNumFlags > m_flags
Definition: SymbolFileDWARFDebugMap.h:327
lldb_private::RegularExpression
Definition: RegularExpression.h:18
SymbolFileDWARFDebugMap::CompileUnitInfo::first_symbol_index
uint32_t first_symbol_index
Definition: SymbolFileDWARFDebugMap.h:182
SymbolFileDWARFDebugMap::FindNamespace
lldb_private::CompilerDeclContext FindNamespace(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx) override
Definition: SymbolFileDWARFDebugMap.cpp:1241
SymbolFileDWARFDebugMap::GetSymbolFileAsSymbolFileDWARF
static SymbolFileDWARF * GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file)
Definition: SymbolFileDWARFDebugMap.cpp:549
DWARFDebugAranges
Definition: DWARFDebugAranges.h:16
lldb_private::SourceLocationSpec
Definition: SourceLocationSpec.h:27
SymbolFileDWARFDebugMap::OSOEntry::GetOSOFileAddress
lldb::addr_t GetOSOFileAddress() const
Definition: SymbolFileDWARFDebugMap.h:312
SymbolFileDWARFDebugMap::GetTypes
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
Definition: SymbolFileDWARFDebugMap.cpp:1092
SymbolFileDWARFDebugMap::CompleteType
bool CompleteType(lldb_private::CompilerType &compiler_type) override
Definition: SymbolFileDWARFDebugMap.cpp:790
lldb_private::UserID
Definition: UserID.h:31
SymbolFileDWARFDebugMap::SymbolContainsSymbolWithID
static int SymbolContainsSymbolWithID(lldb::user_id_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:973
SymbolFileDWARFDebugMap::ParseBlocksRecursive
size_t ParseBlocksRecursive(lldb_private::Function &func) override
Definition: SymbolFileDWARFDebugMap.cpp:742
SymbolFileDWARFDebugMap::OSOEntry::OSOEntry
OSOEntry()=default
SymbolFileDWARFDebugMap::CompileUnitInfo::last_symbol_id
uint32_t last_symbol_id
Definition: SymbolFileDWARFDebugMap.h:185
SymbolFileDWARFDebugMap::isA
bool isA(const void *ClassID) const override
LLVM RTTI support.
Definition: SymbolFileDWARFDebugMap.h:33
SymbolFileDWARFDebugMap::kNumFlags
@ kNumFlags
Definition: SymbolFileDWARFDebugMap.h:153
SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, lldb_private::ConstString type_name, bool must_be_implementation)
Definition: SymbolFileDWARFDebugMap.cpp:1153
SymbolFileDWARFDebugMap::GetOSOIndexFromUserID
static uint32_t GetOSOIndexFromUserID(lldb::user_id_t uid)
Definition: SymbolFileDWARFDebugMap.h:210
lldb_private::XcodeSDK
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition: XcodeSDK.h:24
SymbolFileDWARF
Definition: SymbolFileDWARF.h:60
SymbolFileDWARFDebugMap::ParseLineTable
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:689
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
SymbolFileDWARFDebugMap::InitializeObject
void InitializeObject() override
Initialize the SymbolFile object.
Definition: SymbolFileDWARFDebugMap.cpp:251
lldb_private::Module
Definition: Module.h:86
SymbolFileDWARFDebugMap::Supports_DW_AT_APPLE_objc_complete_type
bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso)
Definition: SymbolFileDWARFDebugMap.cpp:1137
SymbolFileDWARFDebugMap::m_oso_map
std::map< std::pair< lldb_private::ConstString, llvm::sys::TimePoint<> >, OSOInfoSP > m_oso_map
Definition: SymbolFileDWARFDebugMap.h:333
SymbolFileDWARFDebugMap::GetDynamicArrayInfoForUID
llvm::Optional< ArrayInfo > GetDynamicArrayInfoForUID(lldb::user_id_t type_uid, const lldb_private::ExecutionContext *exe_ctx) override
If type_uid points to an array type, return its characteristics.
Definition: SymbolFileDWARFDebugMap.cpp:781
SymbolFileDWARFDebugMap::CreateInstance
static lldb_private::SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFileDWARFDebugMap.cpp:240
SymbolFileDWARFDebugMap::CompileUnitInfo
Definition: SymbolFileDWARFDebugMap.h:172
SymbolFileDWARFDebugMap::OSOEntry::SetOSOFileAddress
void SetOSOFileAddress(lldb::addr_t oso_file_addr)
Definition: SymbolFileDWARFDebugMap.h:314
lldb_private::Stream
Definition: Stream.h:28
UniqueDWARFASTType.h
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
SymbolFileDWARFDebugMap::OSOEntry::m_exe_sym_idx
uint32_t m_exe_sym_idx
Definition: SymbolFileDWARFDebugMap.h:319
SymbolFileDWARFDebugMap::ParseCallEdgesInFunction
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(lldb_private::UserID func_id) override
Definition: SymbolFileDWARFDebugMap.cpp:1119
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
RangeMap.h
SymbolFileDWARFDebugMap::ParseImportedModules
bool ParseImportedModules(const lldb_private::SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
Definition: SymbolFileDWARFDebugMap.cpp:733
lldb_private::SymbolFileCommon
Containing protected virtual methods for child classes to override.
Definition: SymbolFile.h:424
SymbolFileDWARFDebugMap::ForEachExternalModule
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
Definition: SymbolFileDWARFDebugMap.cpp:705
lldb_private::SymbolContext
Definition: SymbolContext.h:33
SymbolFileDWARFDebugMap::FindFunctions
void FindFunctions(const lldb_private::Module::LookupInfo &lookup_info, const lldb_private::CompilerDeclContext &parent_decl_ctx, bool include_inlines, lldb_private::SymbolContextList &sc_list) override
Definition: SymbolFileDWARFDebugMap.cpp:1053
SymbolFileDWARFDebugMap::classof
static bool classof(const SymbolFile *obj)
Definition: SymbolFileDWARFDebugMap.h:36
SymbolFileDWARFDebugMap::AddOSOARanges
size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data, DWARFDebugAranges *debug_aranges)
Definition: SymbolFileDWARFDebugMap.cpp:1455
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithIndex
CompileUnitInfo * GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx, uint32_t *oso_idx_ptr)
Definition: SymbolFileDWARFDebugMap.cpp:987
lldb_private::VariableList
Definition: VariableList.h:18
SymbolFileDWARFDebugMap::GetDeclContextForUID
lldb_private::CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARFDebugMap.cpp:1330
lldb_private::CompileUnit
Definition: CompileUnit.h:38
DWARFDIE
Definition: DWARFDIE.h:16
SymbolFileDWARFDebugMap::OSOEntry::OSOEntry
OSOEntry(uint32_t exe_sym_idx, lldb::addr_t oso_file_addr)
Definition: SymbolFileDWARFDebugMap.h:303
SymbolFileDWARFDebugMap::ParseDeclsForContext
void ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override
Definition: SymbolFileDWARFDebugMap.cpp:1347
SymbolFileDWARFDebugMap::OSOInfoSP
std::shared_ptr< OSOInfo > OSOInfoSP
Definition: SymbolFileDWARFDebugMap.h:165
SymbolFileDWARFDebugMap::ParseIsOptimized
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:725
SymbolFileDWARFDebugMap::GetCompUnitInfoIndex
uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:528
lldb_private::Module::LookupInfo
Definition: Module.h:936
lldb_private::FileSpec
Definition: FileSpec.h:55
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_sp
OSOInfoSP oso_sp
Definition: SymbolFileDWARFDebugMap.h:177
DWARFCompileUnit
Definition: DWARFCompileUnit.h:15
SymbolFileDWARFDebugMap::Terminate
static void Terminate()
Definition: SymbolFileDWARFDebugMap.cpp:232
lldb_private::LineTable
Definition: LineTable.h:40
SymbolFileDWARFDebugMap::FindGlobalVariables
void FindGlobalVariables(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, lldb_private::VariableList &variables) override
Definition: SymbolFileDWARFDebugMap.cpp:899
lldb_private::Function
Definition: Function.h:409
SymbolFileDWARFDebugMap::CalculateFrameVariableError
lldb_private::Status CalculateFrameVariableError(lldb_private::StackFrame &frame) override
Subclasses will override this function to for GetFrameVariableError().
Definition: SymbolFileDWARFDebugMap.cpp:1490
lldb_private::ModuleList
Definition: ModuleList.h:82
SymbolFileDWARFDebugMap::FindDefinitionTypeForDWARFDeclContext
lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext &die_decl_ctx)
Definition: SymbolFileDWARFDebugMap.cpp:1127
SymbolFileDWARFDebugMap::ResolveSymbolContext
uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
SymbolFileDWARFDebugMap::GetCompileUnitInfo
CompileUnitInfo * GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf)
Definition: SymbolFileDWARFDebugMap.cpp:1289
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_path
lldb_private::ConstString oso_path
Definition: SymbolFileDWARFDebugMap.h:174
SymbolFileDWARFDebugMap::CalculateAbilities
uint32_t CalculateAbilities() override
Definition: SymbolFileDWARFDebugMap.cpp:563
DebugMapModule
Definition: SymbolFileDWARFDebugMap.cpp:170
SymbolFileDWARFDebugMap::GetPluginDescriptionStatic
static llvm::StringRef GetPluginDescriptionStatic()
Definition: SymbolFileDWARFDebugMap.cpp:236
SymbolFileDWARFDebugMap::m_func_indexes
std::vector< uint32_t > m_func_indexes
Definition: SymbolFileDWARFDebugMap.h:329
SymbolFileDWARFDebugMap::m_unique_ast_type_map
UniqueDWARFASTTypeMap m_unique_ast_type_map
Definition: SymbolFileDWARFDebugMap.h:334
SymbolFileDWARFDebugMap::GetDeclContextContainingUID
lldb_private::CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARFDebugMap.cpp:1339
SymbolFileDWARFDebugMap::ParseTypes
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:754
SymbolFileDWARFDebugMap::GetCompileUnit
lldb::CompUnitSP GetCompileUnit(SymbolFileDWARF *oso_dwarf, DWARFCompileUnit &dwarf_cu)
Returns the compile unit associated with the dwarf compile unit.
Definition: SymbolFileDWARFDebugMap.cpp:1267
lldb_private::ConstString
Definition: ConstString.h:39
SymbolFileDWARFDebugMap
Definition: SymbolFileDWARFDebugMap.h:26
SymbolFileDWARFDebugMap::OSOEntry::operator<
bool operator<(const OSOEntry &rhs) const
Definition: SymbolFileDWARFDebugMap.h:308
SymbolFileDWARFDebugMap::GetFileSpecForSO
bool GetFileSpecForSO(uint32_t oso_idx, lldb_private::FileSpec &file_spec)
Definition: SymbolFileDWARFDebugMap.cpp:489
SymbolFileDWARFDebugMap::GetDebugInfoModules
lldb_private::ModuleList GetDebugInfoModules() override
Get the additional modules that this symbol file uses to parse debug info.
Definition: SymbolFileDWARFDebugMap.cpp:1476
SymbolFileDWARFDebugMap::CompileUnitInfo::compile_units_sps
llvm::SmallVector< lldb::CompUnitSP, 2 > compile_units_sps
The compile units that an object file contains.
Definition: SymbolFileDWARFDebugMap.h:179
SymbolFileDWARFDebugMap::GetSymbolFileByOSOIndex
SymbolFileDWARF * GetSymbolFileByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:541
SymbolFileDWARFDebugMap::m_debug_map
DebugMap m_debug_map
Definition: SymbolFileDWARFDebugMap.h:336
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithID
CompileUnitInfo * GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id, uint32_t *oso_idx_ptr)
Definition: SymbolFileDWARFDebugMap.cpp:1008
SymbolFileDWARFDebugMap::OSOInfo::OSOInfo
OSOInfo()
Definition: SymbolFileDWARFDebugMap.h:162
SymbolFileDWARFDebugMap::CompileUnitInfo::id_to_index_map
llvm::SmallDenseMap< uint64_t, uint64_t, 2 > id_to_index_map
A map from the compile unit ID to its index in the vector.
Definition: SymbolFileDWARFDebugMap.h:181
SymbolFileDWARFDebugMap::AddOSOFileRange
bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr, lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr, lldb::addr_t oso_byte_size)
Definition: SymbolFileDWARFDebugMap.cpp:1355
SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo
lldb_private::Module * GetModuleByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:401
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_mod_time
llvm::sys::TimePoint oso_mod_time
Definition: SymbolFileDWARFDebugMap.h:175
SymbolFileDWARFDebugMap::CompileUnitInfo::last_symbol_index
uint32_t last_symbol_index
Definition: SymbolFileDWARFDebugMap.h:183
SymbolFileDWARFDebugMap::Initialize
static void Initialize()
Definition: SymbolFileDWARFDebugMap.cpp:227
SymbolFileDWARFDebugMap::ParseFunctions
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:681
lldb_private::TypeMap
Definition: TypeMap.h:20
UniqueDWARFASTTypeMap
Definition: UniqueDWARFASTType.h:71
lldb_private::CompilerDeclContext
Represents a generic declaration context in a program.
Definition: CompilerDeclContext.h:30
lldb_private::SymbolContextScope
Definition: SymbolContextScope.h:64
SymbolFileDWARFDebugMap::GetCompUnitInfosForModule
size_t GetCompUnitInfosForModule(const lldb_private::Module *oso_module, std::vector< CompileUnitInfo * > &cu_infos)
Definition: SymbolFileDWARFDebugMap.cpp:653
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_load_error
lldb_private::Status oso_load_error
Definition: SymbolFileDWARFDebugMap.h:176
SymbolFileDWARFDebugMap::OSOInfo::module_sp
lldb::ModuleSP module_sp
Definition: SymbolFileDWARFDebugMap.h:160
DWARFASTParserClang
Definition: DWARFASTParserClang.h:38
lldb_private::Status
Definition: Status.h:44
SymbolFileDWARFDebugMap::FinalizeOSOFileRanges
void FinalizeOSOFileRanges(CompileUnitInfo *cu_info)
Definition: SymbolFileDWARFDebugMap.cpp:1379
SymbolFileDWARFDebugMap::OSOInfo
Definition: SymbolFileDWARFDebugMap.h:159
SymbolFileDWARFDebugMap::SymbolContainsSymbolWithIndex
static int SymbolContainsSymbolWithIndex(uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:960
SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo
SymbolFileDWARF * GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:556
uint32_t
SymbolFileDWARFDebugMap::LinkOSOAddress
bool LinkOSOAddress(lldb_private::Address &addr)
Convert addr from a .o file address, to an executable address.
Definition: SymbolFileDWARFDebugMap.cpp:1418
lldb_private::Address
Definition: Address.h:59
SymbolFileDWARFDebugMap::GetUniqueDWARFASTTypeMap
UniqueDWARFASTTypeMap & GetUniqueDWARFASTTypeMap()
Definition: SymbolFileDWARFDebugMap.h:294
SymbolFileDWARFDebugMap::ID
static char ID
LLVM RTTI support.
Definition: SymbolFileDWARFDebugMap.h:28
lldb_private::RangeDataVector
Definition: RangeMap.h:440
SymbolFileDWARFDebugMap::DumpClangAST
void DumpClangAST(lldb_private::Stream &s) override
Definition: SymbolFileDWARFDebugMap.cpp:1256
SymbolFileDWARFDebugMap::SymbolFileDWARFDebugMap
SymbolFileDWARFDebugMap(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFileDWARFDebugMap.cpp:244
SymbolFileDWARFDebugMap::m_supports_DW_AT_APPLE_objc_complete_type
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type
Definition: SymbolFileDWARFDebugMap.h:335
lldb_private::Type
Definition: Type.h:66
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:19
SymbolFileDWARFDebugMap::ResolveTypeUID
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
Definition: SymbolFileDWARFDebugMap.cpp:771
SymbolFileDWARFDebugMap::CompileUnitInfo::so_file
lldb_private::FileSpec so_file
Definition: SymbolFileDWARFDebugMap.h:173
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
SymbolFileDWARFDebugMap::ForEachSymbolFile
void ForEachSymbolFile(std::function< bool(SymbolFileDWARF *)> closure)
Definition: SymbolFileDWARFDebugMap.h:245
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:35
SymbolFileDWARFDebugMap::InitOSO
void InitOSO()
Definition: SymbolFileDWARFDebugMap.cpp:253
SymbolFileDWARFDebugMap::ParseSupportFiles
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
Definition: SymbolFileDWARFDebugMap.cpp:716
SymbolFileDWARFDebugMap::FileRangeMap
lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, lldb::addr_t > FileRangeMap
Definition: SymbolFileDWARFDebugMap.h:169
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
SymbolFileDWARFDebugMap::ParseLanguage
lldb::LanguageType ParseLanguage(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:665
SymbolFileDWARFDebugMap::CompileUnitInfo::first_symbol_id
uint32_t first_symbol_id
Definition: SymbolFileDWARFDebugMap.h:184
SymbolFileDWARFDebugMap::GetModuleByOSOIndex
lldb_private::Module * GetModuleByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:394
DWARFDeclContext
Definition: DWARFDeclContext.h:23
SymbolFileDWARFDebugMap::CalculateNumCompileUnits
uint32_t CalculateNumCompileUnits() override
This function actually returns the number of object files, which may be less than the actual number o...
Definition: SymbolFileDWARFDebugMap.cpp:582
lldb_private::TypeList
Definition: TypeList.h:20
SymbolFileDWARFDebugMap::LinkOSOLineTable
lldb_private::LineTable * LinkOSOLineTable(SymbolFileDWARF *oso_symfile, lldb_private::LineTable *line_table)
Given a line table full of lines with "file addresses" that are for a .o file represented by oso_symf...
Definition: SymbolFileDWARFDebugMap.cpp:1446
SymbolFileDWARFDebugMap::CompileUnitInfo::file_range_map_valid
bool file_range_map_valid
Definition: SymbolFileDWARFDebugMap.h:187
SymbolFileDWARFDebugMap::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic()
Definition: SymbolFileDWARFDebugMap.h:44
SymbolFileDWARFDebugMap::OSOEntry::GetExeSymbolIndex
uint32_t GetExeSymbolIndex() const
Definition: SymbolFileDWARFDebugMap.h:306
SymbolFileDWARFDebugMap::LinkOSOFileAddress
lldb::addr_t LinkOSOFileAddress(SymbolFileDWARF *oso_symfile, lldb::addr_t oso_file_addr)
Convert a .o file "file address" to an executable "file address".
Definition: SymbolFileDWARFDebugMap.cpp:1397
SymbolFileDWARFDebugMap::OSOEntry
Definition: SymbolFileDWARFDebugMap.h:299
SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap
const FileRangeMap & GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile)
Definition: SymbolFileDWARFDebugMap.cpp:54
lldb_private::LanguageSet
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: TypeSystem.h:44
SymbolFileDWARFDebugMap::ParseDebugMacros
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:697
SymbolFileDWARFDebugMap::kHaveInitializedOSOs
@ kHaveInitializedOSOs
Definition: SymbolFileDWARFDebugMap.h:153
lldb_private::StackFrame
Definition: StackFrame.h:40
SymbolFileDWARFDebugMap::ParseVariablesForContext
size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override
Definition: SymbolFileDWARFDebugMap.cpp:763
SymbolFileDWARFDebugMap::m_compile_unit_infos
std::vector< CompileUnitInfo > m_compile_unit_infos
Definition: SymbolFileDWARFDebugMap.h:328
SymbolFileDWARFDebugMap::FindTypes
void FindTypes(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, llvm::DenseSet< lldb_private::SymbolFile * > &searched_symbol_files, lldb_private::TypeMap &types) override
SymbolFile.h
lldb_private::ObjectFile
Definition: ObjectFile.h:60
SymbolFileDWARFDebugMap::~SymbolFileDWARFDebugMap
~SymbolFileDWARFDebugMap() override
SymbolFileDWARFDebugMap::PrivateFindGlobalVariables
void PrivateFindGlobalVariables(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, const std::vector< uint32_t > &name_symbol_indexes, uint32_t max_matches, lldb_private::VariableList &variables)
Definition: SymbolFileDWARFDebugMap.cpp:877
SymbolFileDWARFDebugMap::OSOEntry::m_oso_file_addr
lldb::addr_t m_oso_file_addr
Definition: SymbolFileDWARFDebugMap.h:320
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:437
SymbolFileDWARFDebugMap::CompileUnitInfo::CompileUnitInfo
CompileUnitInfo()=default