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 DWARFDebugAranges;
23 class DWARFDeclContext;
24 
26  /// LLVM RTTI support.
27  static char ID;
28 
29 public:
30  /// LLVM RTTI support.
31  /// \{
32  bool isA(const void *ClassID) const override {
33  return ClassID == &ID || SymbolFile::isA(ClassID);
34  }
35  static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
36  /// \}
37 
38  // Static Functions
39  static void Initialize();
40 
41  static void Terminate();
42 
43  static llvm::StringRef GetPluginNameStatic() { return "dwarf-debugmap"; }
44 
45  static llvm::StringRef GetPluginDescriptionStatic();
46 
48  CreateInstance(lldb::ObjectFileSP objfile_sp);
49 
50  // Constructors and Destructors
51  SymbolFileDWARFDebugMap(lldb::ObjectFileSP objfile_sp);
52  ~SymbolFileDWARFDebugMap() override;
53 
54  uint32_t CalculateAbilities() override;
55  void InitializeObject() override;
56 
57  // Compile Unit function calls
59  ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
61  ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override;
62  size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
63  bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
64  bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
65 
67  lldb_private::CompileUnit &, llvm::DenseSet<lldb_private::SymbolFile *> &,
68  llvm::function_ref<bool(lldb_private::Module &)>) override;
69 
71  lldb_private::FileSpecList &support_files) override;
72 
73  bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override;
74 
75  size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
76 
79  std::vector<lldb_private::SourceModule> &imported_modules) override;
80  size_t ParseBlocksRecursive(lldb_private::Function &func) override;
81  size_t
83 
85  llvm::Optional<ArrayInfo> GetDynamicArrayInfoForUID(
86  lldb::user_id_t type_uid,
87  const lldb_private::ExecutionContext *exe_ctx) override;
88 
93  void
95 
96  bool CompleteType(lldb_private::CompilerType &compiler_type) override;
98  lldb::SymbolContextItem resolve_scope,
99  lldb_private::SymbolContext &sc) override;
101  const lldb_private::SourceLocationSpec &src_location_spec,
102  lldb::SymbolContextItem resolve_scope,
103  lldb_private::SymbolContextList &sc_list) override;
104  void
106  const lldb_private::CompilerDeclContext &parent_decl_ctx,
107  uint32_t max_matches,
108  lldb_private::VariableList &variables) override;
110  uint32_t max_matches,
111  lldb_private::VariableList &variables) override;
113  const lldb_private::CompilerDeclContext &parent_decl_ctx,
114  lldb::FunctionNameType name_type_mask,
115  bool include_inlines,
116  lldb_private::SymbolContextList &sc_list) override;
118  bool include_inlines,
119  lldb_private::SymbolContextList &sc_list) override;
120  void
122  const lldb_private::CompilerDeclContext &parent_decl_ctx,
123  uint32_t max_matches,
124  llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
125  lldb_private::TypeMap &types) override;
126  void
127  FindTypes(llvm::ArrayRef<lldb_private::CompilerContext> context,
128  lldb_private::LanguageSet languages,
129  llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
130  lldb_private::TypeMap &types) override;
133  const lldb_private::CompilerDeclContext &parent_decl_ctx) override;
135  lldb::TypeClass type_mask,
136  lldb_private::TypeList &type_list) override;
137  std::vector<std::unique_ptr<lldb_private::CallEdge>>
139 
140  void DumpClangAST(lldb_private::Stream &s) override;
141 
142  // PluginInterface protocol
143  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
144 
145  uint64_t GetDebugInfoSize() override;
148 
149 protected:
150  enum { kHaveInitializedOSOs = (1 << 0), kNumFlags };
151 
152  friend class DebugMapModule;
153  friend class DWARFASTParserClang;
154  friend class DWARFCompileUnit;
155  friend class SymbolFileDWARF;
156  struct OSOInfo {
157  lldb::ModuleSP module_sp;
158 
160  };
161 
162  typedef std::shared_ptr<OSOInfo> OSOInfoSP;
163 
165  lldb::addr_t>
167 
168  // Class specific types
172  llvm::sys::TimePoint<> oso_mod_time;
174  lldb::CompUnitSP compile_unit_sp;
180  bool file_range_map_valid = false;
181 
184 
185  file_range_map() {}
186 
188  };
189 
190  // Protected Member Functions
191  void InitOSO();
192 
194  lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
195 
197  return (uint32_t)((uid >> 32ull) - 1ull);
198  }
199 
201 
202  bool GetFileSpecForSO(uint32_t oso_idx, lldb_private::FileSpec &file_spec);
203 
204  CompileUnitInfo *GetCompUnitInfo(const lldb_private::SymbolContext &sc);
205  CompileUnitInfo *GetCompUnitInfo(const lldb_private::CompileUnit &comp_unit);
206 
207  size_t GetCompUnitInfosForModule(const lldb_private::Module *oso_module,
208  std::vector<CompileUnitInfo *> &cu_infos);
209 
211  GetModuleByCompUnitInfo(CompileUnitInfo *comp_unit_info);
212 
214 
216  GetObjectFileByCompUnitInfo(CompileUnitInfo *comp_unit_info);
217 
219 
220  uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info);
221 
224 
225  SymbolFileDWARF *GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info);
226 
228 
229  // If closure returns "false", iteration continues. If it returns
230  // "true", iteration terminates.
231  void ForEachSymbolFile(std::function<bool(SymbolFileDWARF *)> closure) {
232  for (uint32_t oso_idx = 0, num_oso_idxs = m_compile_unit_infos.size();
233  oso_idx < num_oso_idxs; ++oso_idx) {
234  if (SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx)) {
235  if (closure(oso_dwarf))
236  return;
237  }
238  }
239  }
240 
241  CompileUnitInfo *GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx,
242  uint32_t *oso_idx_ptr);
243 
244  CompileUnitInfo *GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id,
245  uint32_t *oso_idx_ptr);
246 
247  static int
248  SymbolContainsSymbolWithIndex(uint32_t *symbol_idx_ptr,
249  const CompileUnitInfo *comp_unit_info);
250 
251  static int SymbolContainsSymbolWithID(lldb::user_id_t *symbol_idx_ptr,
252  const CompileUnitInfo *comp_unit_info);
253 
256  const lldb_private::CompilerDeclContext &parent_decl_ctx,
257  const std::vector<uint32_t> &name_symbol_indexes, uint32_t max_matches,
258  lldb_private::VariableList &variables);
259 
260  void SetCompileUnit(SymbolFileDWARF *oso_dwarf,
261  const lldb::CompUnitSP &cu_sp);
262 
263  lldb::CompUnitSP GetCompileUnit(SymbolFileDWARF *oso_dwarf);
264 
265  CompileUnitInfo *GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf);
266 
267  lldb::TypeSP
269 
271 
273  const DWARFDIE &die, lldb_private::ConstString type_name,
274  bool must_be_implementation);
275 
277  return m_unique_ast_type_map;
278  }
279 
280  // OSOEntry
281  class OSOEntry {
282  public:
283  OSOEntry() = default;
284 
285  OSOEntry(uint32_t exe_sym_idx, lldb::addr_t oso_file_addr)
286  : m_exe_sym_idx(exe_sym_idx), m_oso_file_addr(oso_file_addr) {}
287 
289 
290  bool operator<(const OSOEntry &rhs) const {
291  return m_exe_sym_idx < rhs.m_exe_sym_idx;
292  }
293 
295 
296  void SetOSOFileAddress(lldb::addr_t oso_file_addr) {
297  m_oso_file_addr = oso_file_addr;
298  }
299 
300  protected:
303  };
304 
307 
308  // Member Variables
309  std::bitset<kNumFlags> m_flags;
310  std::vector<CompileUnitInfo> m_compile_unit_infos;
311  std::vector<uint32_t> m_func_indexes; // Sorted by address
312  std::vector<uint32_t> m_glob_indexes;
313  std::map<std::pair<lldb_private::ConstString, llvm::sys::TimePoint<>>,
314  OSOInfoSP>
319 
320  // When an object file from the debug map gets parsed in
321  // SymbolFileDWARF, it needs to tell the debug map about the object
322  // files addresses by calling this function once for each N_FUN,
323  // N_GSYM and N_STSYM and after all entries in the debug map have
324  // been matched up, FinalizeOSOFileRanges() should be called.
325  bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr,
326  lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr,
327  lldb::addr_t oso_byte_size);
328 
329  // Called after calling AddOSOFileRange() for each object file debug
330  // map entry to finalize the info for the unlinked compile unit.
331  void FinalizeOSOFileRanges(CompileUnitInfo *cu_info);
332 
333  /// Convert \a addr from a .o file address, to an executable address.
334  ///
335  /// \param[in] addr
336  /// A section offset address from a .o file
337  ///
338  /// \return
339  /// Returns true if \a addr was converted to be an executable
340  /// section/offset address, false otherwise.
342 
343  /// Convert a .o file "file address" to an executable "file address".
344  ///
345  /// \param[in] oso_symfile
346  /// The DWARF symbol file that contains \a oso_file_addr
347  ///
348  /// \param[in] oso_file_addr
349  /// A .o file "file address" to convert.
350  ///
351  /// \return
352  /// LLDB_INVALID_ADDRESS if \a oso_file_addr is not in the
353  /// linked executable, otherwise a valid "file address" from the
354  /// linked executable that contains the debug map.
356  lldb::addr_t oso_file_addr);
357 
358  /// Given a line table full of lines with "file addresses" that are
359  /// for a .o file represented by \a oso_symfile, link a new line table
360  /// and return it.
361  ///
362  /// \param[in] oso_symfile
363  /// The DWARF symbol file that produced the \a line_table
364  ///
365  /// \param[in] line_table
366  /// A pointer to the line table.
367  ///
368  /// \return
369  /// Returns a valid line table full of linked addresses, or NULL
370  /// if none of the line table addresses exist in the main
371  /// executable.
373  LinkOSOLineTable(SymbolFileDWARF *oso_symfile,
374  lldb_private::LineTable *line_table);
375 
376  size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data,
377  DWARFDebugAranges *debug_aranges);
378 };
379 
380 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDEBUGMAP_H
SymbolFileDWARFDebugMap::ParseCompileUnitAtIndex
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
Definition: SymbolFileDWARFDebugMap.cpp:563
lldb_private::SymbolFile::SymbolFile
SymbolFile(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFile.h:69
SymbolFileDWARFDebugMap::GetObjectFileByOSOIndex
lldb_private::ObjectFile * GetObjectFileByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:476
SymbolFileDWARFDebugMap::GetSymbolFile
SymbolFileDWARF * GetSymbolFile(const lldb_private::SymbolContext &sc)
Definition: SymbolFileDWARFDebugMap.cpp:484
SymbolFileDWARFDebugMap::CompileUnitInfo::file_range_map
FileRangeMap file_range_map
Definition: SymbolFileDWARFDebugMap.h:179
SymbolFileDWARFDebugMap::m_glob_indexes
std::vector< uint32_t > m_glob_indexes
Definition: SymbolFileDWARFDebugMap.h:312
SymbolFileDWARFDebugMap::GetPluginName
llvm::StringRef GetPluginName() override
Definition: SymbolFileDWARFDebugMap.h:143
lldb_private::SymbolFile
Definition: SymbolFile.h:38
SymbolFileDWARFDebugMap::GetObjectFileByCompUnitInfo
lldb_private::ObjectFile * GetObjectFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:496
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
SymbolFileDWARFDebugMap::GetCompUnitInfo
CompileUnitInfo * GetCompUnitInfo(const lldb_private::SymbolContext &sc)
Definition: SymbolFileDWARFDebugMap.cpp:593
SymbolFileDWARFDebugMap::ParseXcodeSDK
lldb_private::XcodeSDK ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
Definition: SymbolFileDWARFDebugMap.cpp:627
SymbolFileDWARFDebugMap::SetCompileUnit
void SetCompileUnit(SymbolFileDWARF *oso_dwarf, const lldb::CompUnitSP &cu_sp)
Definition: SymbolFileDWARFDebugMap.cpp:1266
SymbolFileDWARFDebugMap::DebugMap
lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, OSOEntry > DebugMap
Definition: SymbolFileDWARFDebugMap.h:306
SymbolFileDWARFDebugMap::m_flags
std::bitset< kNumFlags > m_flags
Definition: SymbolFileDWARFDebugMap.h:309
SymbolFileDWARFDebugMap::GetDebugInfoParseTime
lldb_private::StatsDuration GetDebugInfoParseTime() override
Return the time taken to parse the debug information.
Definition: SymbolFileDWARFDebugMap.cpp:1450
lldb_private::RegularExpression
Definition: RegularExpression.h:18
SymbolFileDWARFDebugMap::CompileUnitInfo::first_symbol_index
uint32_t first_symbol_index
Definition: SymbolFileDWARFDebugMap.h:175
SymbolFileDWARFDebugMap::FindNamespace
lldb_private::CompilerDeclContext FindNamespace(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx) override
Definition: SymbolFileDWARFDebugMap.cpp:1207
SymbolFileDWARFDebugMap::GetSymbolFileAsSymbolFileDWARF
static SymbolFileDWARF * GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file)
Definition: SymbolFileDWARFDebugMap.cpp:525
DWARFDebugAranges
Definition: DWARFDebugAranges.h:16
lldb_private::SourceLocationSpec
Definition: SourceLocationSpec.h:27
SymbolFileDWARFDebugMap::OSOEntry::GetOSOFileAddress
lldb::addr_t GetOSOFileAddress() const
Definition: SymbolFileDWARFDebugMap.h:294
SymbolFileDWARFDebugMap::GetTypes
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
Definition: SymbolFileDWARFDebugMap.cpp:1046
SymbolFileDWARFDebugMap::CompleteType
bool CompleteType(lldb_private::CompilerType &compiler_type) override
Definition: SymbolFileDWARFDebugMap.cpp:744
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:927
SymbolFileDWARFDebugMap::ParseBlocksRecursive
size_t ParseBlocksRecursive(lldb_private::Function &func) override
Definition: SymbolFileDWARFDebugMap.cpp:696
SymbolFileDWARFDebugMap::OSOEntry::OSOEntry
OSOEntry()=default
SymbolFileDWARFDebugMap::CompileUnitInfo::last_symbol_id
uint32_t last_symbol_id
Definition: SymbolFileDWARFDebugMap.h:178
SymbolFileDWARFDebugMap::isA
bool isA(const void *ClassID) const override
LLVM RTTI support.
Definition: SymbolFileDWARFDebugMap.h:32
SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, lldb_private::ConstString type_name, bool must_be_implementation)
Definition: SymbolFileDWARFDebugMap.cpp:1107
SymbolFileDWARFDebugMap::GetOSOIndexFromUserID
static uint32_t GetOSOIndexFromUserID(lldb::user_id_t uid)
Definition: SymbolFileDWARFDebugMap.h:196
lldb_private::XcodeSDK
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition: XcodeSDK.h:24
SymbolFileDWARF
Definition: SymbolFileDWARF.h:59
SymbolFileDWARFDebugMap::ParseLineTable
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:643
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
SymbolFileDWARFDebugMap::InitializeObject
void InitializeObject() override
Initialize the SymbolFile object.
Definition: SymbolFileDWARFDebugMap.cpp:246
lldb_private::Module
Definition: Module.h:85
SymbolFileDWARFDebugMap::Supports_DW_AT_APPLE_objc_complete_type
bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso)
Definition: SymbolFileDWARFDebugMap.cpp:1091
SymbolFileDWARFDebugMap::m_oso_map
std::map< std::pair< lldb_private::ConstString, llvm::sys::TimePoint<> >, OSOInfoSP > m_oso_map
Definition: SymbolFileDWARFDebugMap.h:315
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:735
SymbolFileDWARFDebugMap::CreateInstance
static lldb_private::SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFileDWARFDebugMap.cpp:235
SymbolFileDWARFDebugMap::CompileUnitInfo
Definition: SymbolFileDWARFDebugMap.h:169
SymbolFileDWARFDebugMap::OSOEntry::SetOSOFileAddress
void SetOSOFileAddress(lldb::addr_t oso_file_addr)
Definition: SymbolFileDWARFDebugMap.h:296
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:301
SymbolFileDWARFDebugMap::ParseCallEdgesInFunction
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(lldb_private::UserID func_id) override
Definition: SymbolFileDWARFDebugMap.cpp:1073
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:687
SymbolFileDWARFDebugMap::ForEachExternalModule
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
Definition: SymbolFileDWARFDebugMap.cpp:659
lldb_private::SymbolContext
Definition: SymbolContext.h:33
SymbolFileDWARFDebugMap::classof
static bool classof(const SymbolFile *obj)
Definition: SymbolFileDWARFDebugMap.h:35
SymbolFileDWARFDebugMap::AddOSOARanges
size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data, DWARFDebugAranges *debug_aranges)
Definition: SymbolFileDWARFDebugMap.cpp:1412
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithIndex
CompileUnitInfo * GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx, uint32_t *oso_idx_ptr)
Definition: SymbolFileDWARFDebugMap.cpp:941
lldb_private::VariableList
Definition: VariableList.h:18
SymbolFileDWARFDebugMap::GetDeclContextForUID
lldb_private::CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARFDebugMap.cpp:1287
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:285
SymbolFileDWARFDebugMap::ParseDeclsForContext
void ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override
Definition: SymbolFileDWARFDebugMap.cpp:1304
SymbolFileDWARFDebugMap::OSOInfoSP
std::shared_ptr< OSOInfo > OSOInfoSP
Definition: SymbolFileDWARFDebugMap.h:162
SymbolFileDWARFDebugMap::ParseIsOptimized
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:679
SymbolFileDWARFDebugMap::GetCompUnitInfoIndex
uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:504
lldb_private::FileSpec
Definition: FileSpec.h:56
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_sp
OSOInfoSP oso_sp
Definition: SymbolFileDWARFDebugMap.h:173
DWARFCompileUnit
Definition: DWARFCompileUnit.h:15
SymbolFileDWARFDebugMap::Terminate
static void Terminate()
Definition: SymbolFileDWARFDebugMap.cpp:227
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:853
lldb_private::Function
Definition: Function.h:413
SymbolFileDWARFDebugMap::kHaveInitializedOSOs
@ kHaveInitializedOSOs
Definition: SymbolFileDWARFDebugMap.h:150
SymbolFileDWARFDebugMap::FindDefinitionTypeForDWARFDeclContext
lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext &die_decl_ctx)
Definition: SymbolFileDWARFDebugMap.cpp:1081
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:1252
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_path
lldb_private::ConstString oso_path
Definition: SymbolFileDWARFDebugMap.h:171
SymbolFileDWARFDebugMap::CalculateAbilities
uint32_t CalculateAbilities() override
Definition: SymbolFileDWARFDebugMap.cpp:539
DebugMapModule
Definition: SymbolFileDWARFDebugMap.cpp:165
SymbolFileDWARFDebugMap::GetDebugInfoIndexTime
lldb_private::StatsDuration GetDebugInfoIndexTime() override
Return the time it took to index the debug information in the object file.
Definition: SymbolFileDWARFDebugMap.cpp:1467
SymbolFileDWARFDebugMap::GetPluginDescriptionStatic
static llvm::StringRef GetPluginDescriptionStatic()
Definition: SymbolFileDWARFDebugMap.cpp:231
SymbolFileDWARFDebugMap::m_func_indexes
std::vector< uint32_t > m_func_indexes
Definition: SymbolFileDWARFDebugMap.h:311
SymbolFileDWARFDebugMap::m_unique_ast_type_map
UniqueDWARFASTTypeMap m_unique_ast_type_map
Definition: SymbolFileDWARFDebugMap.h:316
SymbolFileDWARFDebugMap::GetCompileUnit
lldb::CompUnitSP GetCompileUnit(SymbolFileDWARF *oso_dwarf)
Definition: SymbolFileDWARFDebugMap.cpp:1233
SymbolFileDWARFDebugMap::GetDeclContextContainingUID
lldb_private::CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARFDebugMap.cpp:1296
SymbolFileDWARFDebugMap::CompileUnitInfo::compile_unit_sp
lldb::CompUnitSP compile_unit_sp
Definition: SymbolFileDWARFDebugMap.h:174
SymbolFileDWARFDebugMap::ParseTypes
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:708
lldb_private::ConstString
Definition: ConstString.h:40
SymbolFileDWARFDebugMap
Definition: SymbolFileDWARFDebugMap.h:25
SymbolFileDWARFDebugMap::OSOEntry::operator<
bool operator<(const OSOEntry &rhs) const
Definition: SymbolFileDWARFDebugMap.h:290
SymbolFileDWARFDebugMap::GetFileSpecForSO
bool GetFileSpecForSO(uint32_t oso_idx, lldb_private::FileSpec &file_spec)
Definition: SymbolFileDWARFDebugMap.cpp:465
SymbolFileDWARFDebugMap::GetSymbolFileByOSOIndex
SymbolFileDWARF * GetSymbolFileByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:517
SymbolFileDWARFDebugMap::m_debug_map
DebugMap m_debug_map
Definition: SymbolFileDWARFDebugMap.h:318
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithID
CompileUnitInfo * GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id, uint32_t *oso_idx_ptr)
Definition: SymbolFileDWARFDebugMap.cpp:962
SymbolFileDWARFDebugMap::OSOInfo::OSOInfo
OSOInfo()
Definition: SymbolFileDWARFDebugMap.h:159
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:1312
SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo
lldb_private::Module * GetModuleByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:396
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_mod_time
llvm::sys::TimePoint oso_mod_time
Definition: SymbolFileDWARFDebugMap.h:172
SymbolFileDWARFDebugMap::CompileUnitInfo::last_symbol_index
uint32_t last_symbol_index
Definition: SymbolFileDWARFDebugMap.h:176
SymbolFileDWARFDebugMap::Initialize
static void Initialize()
Definition: SymbolFileDWARFDebugMap.cpp:222
SymbolFileDWARFDebugMap::ParseFunctions
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:635
lldb_private::TypeMap
Definition: TypeMap.h:20
UniqueDWARFASTTypeMap
Definition: UniqueDWARFASTType.h:71
lldb_private::StatsDuration
std::chrono::duration< double > StatsDuration
Definition: Statistics.h:23
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:607
SymbolFileDWARFDebugMap::OSOInfo::module_sp
lldb::ModuleSP module_sp
Definition: SymbolFileDWARFDebugMap.h:157
DWARFASTParserClang
Definition: DWARFASTParserClang.h:37
SymbolFileDWARFDebugMap::FinalizeOSOFileRanges
void FinalizeOSOFileRanges(CompileUnitInfo *cu_info)
Definition: SymbolFileDWARFDebugMap.cpp:1336
SymbolFileDWARFDebugMap::OSOInfo
Definition: SymbolFileDWARFDebugMap.h:156
SymbolFileDWARFDebugMap::SymbolContainsSymbolWithIndex
static int SymbolContainsSymbolWithIndex(uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:914
SymbolFileDWARFDebugMap::GetDebugInfoSize
uint64_t GetDebugInfoSize() override
Metrics gathering functions.
Definition: SymbolFileDWARFDebugMap.cpp:1433
SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo
SymbolFileDWARF * GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:532
uint32_t
SymbolFileDWARFDebugMap::LinkOSOAddress
bool LinkOSOAddress(lldb_private::Address &addr)
Convert addr from a .o file address, to an executable address.
Definition: SymbolFileDWARFDebugMap.cpp:1375
lldb_private::Address
Definition: Address.h:59
SymbolFileDWARFDebugMap::GetUniqueDWARFASTTypeMap
UniqueDWARFASTTypeMap & GetUniqueDWARFASTTypeMap()
Definition: SymbolFileDWARFDebugMap.h:276
SymbolFileDWARFDebugMap::FindFunctions
void FindFunctions(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, lldb::FunctionNameType name_type_mask, bool include_inlines, lldb_private::SymbolContextList &sc_list) override
SymbolFileDWARFDebugMap::ID
static char ID
LLVM RTTI support.
Definition: SymbolFileDWARFDebugMap.h:27
lldb_private::RangeDataVector
Definition: RangeMap.h:398
SymbolFileDWARFDebugMap::DumpClangAST
void DumpClangAST(lldb_private::Stream &s) override
Definition: SymbolFileDWARFDebugMap.cpp:1222
SymbolFileDWARFDebugMap::SymbolFileDWARFDebugMap
SymbolFileDWARFDebugMap(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFileDWARFDebugMap.cpp:239
SymbolFileDWARFDebugMap::m_supports_DW_AT_APPLE_objc_complete_type
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type
Definition: SymbolFileDWARFDebugMap.h:317
lldb_private::Type
Definition: Type.h:66
SymbolFileDWARFDebugMap::kNumFlags
@ kNumFlags
Definition: SymbolFileDWARFDebugMap.h:150
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
SymbolFileDWARFDebugMap::ResolveTypeUID
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
Definition: SymbolFileDWARFDebugMap.cpp:725
SymbolFileDWARFDebugMap::CompileUnitInfo::so_file
lldb_private::FileSpec so_file
Definition: SymbolFileDWARFDebugMap.h:170
SymbolFileDWARFDebugMap::CompileUnitInfo::CompileUnitInfo
CompileUnitInfo()
Definition: SymbolFileDWARFDebugMap.h:182
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
SymbolFileDWARFDebugMap::ForEachSymbolFile
void ForEachSymbolFile(std::function< bool(SymbolFileDWARF *)> closure)
Definition: SymbolFileDWARFDebugMap.h:231
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
SymbolFileDWARFDebugMap::InitOSO
void InitOSO()
Definition: SymbolFileDWARFDebugMap.cpp:248
SymbolFileDWARFDebugMap::ParseSupportFiles
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
Definition: SymbolFileDWARFDebugMap.cpp:670
SymbolFileDWARFDebugMap::FileRangeMap
lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, lldb::addr_t > FileRangeMap
Definition: SymbolFileDWARFDebugMap.h:166
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:619
SymbolFileDWARFDebugMap::CompileUnitInfo::first_symbol_id
uint32_t first_symbol_id
Definition: SymbolFileDWARFDebugMap.h:177
SymbolFileDWARFDebugMap::GetModuleByOSOIndex
lldb_private::Module * GetModuleByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:389
DWARFDeclContext
Definition: DWARFDeclContext.h:23
SymbolFileDWARFDebugMap::CalculateNumCompileUnits
uint32_t CalculateNumCompileUnits() override
Definition: SymbolFileDWARFDebugMap.cpp:558
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:1403
SymbolFileDWARFDebugMap::CompileUnitInfo::file_range_map_valid
bool file_range_map_valid
Definition: SymbolFileDWARFDebugMap.h:180
SymbolFileDWARFDebugMap::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic()
Definition: SymbolFileDWARFDebugMap.h:43
SymbolFileDWARFDebugMap::OSOEntry::GetExeSymbolIndex
uint32_t GetExeSymbolIndex() const
Definition: SymbolFileDWARFDebugMap.h:288
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:1354
SymbolFileDWARFDebugMap::OSOEntry
Definition: SymbolFileDWARFDebugMap.h:281
SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap
const FileRangeMap & GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile)
Definition: SymbolFileDWARFDebugMap.cpp:49
lldb_private::LanguageSet
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: TypeSystem.h:40
SymbolFileDWARFDebugMap::ParseDebugMacros
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:651
SymbolFileDWARFDebugMap::ParseVariablesForContext
size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override
Definition: SymbolFileDWARFDebugMap.cpp:717
SymbolFileDWARFDebugMap::m_compile_unit_infos
std::vector< CompileUnitInfo > m_compile_unit_infos
Definition: SymbolFileDWARFDebugMap.h:310
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:59
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:831
SymbolFileDWARFDebugMap::OSOEntry::m_oso_file_addr
lldb::addr_t m_oso_file_addr
Definition: SymbolFileDWARFDebugMap.h:302