LLDB mainline
SymbolFileDWARF.h
Go to the documentation of this file.
1//===-- SymbolFileDWARF.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_SYMBOLFILEDWARF_H
10#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARF_H
11
12#include <list>
13#include <map>
14#include <mutex>
15#include <optional>
16#include <unordered_map>
17#include <vector>
18
19#include "llvm/ADT/DenseMap.h"
20#include "llvm/ADT/SetVector.h"
21#include "llvm/Support/Threading.h"
22
24#include "lldb/Core/dwarf.h"
31#include "lldb/Utility/Flags.h"
33#include "lldb/lldb-private.h"
34
35#include "DWARFContext.h"
36#include "DWARFDataExtractor.h"
37#include "DWARFDefines.h"
38#include "DWARFIndex.h"
39#include "UniqueDWARFASTType.h"
40
41// Forward Declarations for this DWARF plugin
42class DebugMapModule;
48class DWARFDebugInfo;
50class DWARFDebugLine;
53class DWARFFormValue;
54class DWARFTypeUnit;
57class SymbolFileDWARFDwp;
58
59#define DIE_IS_BEING_PARSED ((lldb_private::Type *)1)
60
63 /// LLVM RTTI support.
64 static char ID;
65
66public:
67 /// LLVM RTTI support.
68 /// \{
69 bool isA(const void *ClassID) const override {
70 return ClassID == &ID || SymbolFileCommon::isA(ClassID);
71 }
72 static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
73 /// \}
74
76 friend class SymbolFileDWARFDwo;
77 friend class DebugMapModule;
78 friend class DWARFCompileUnit;
79 friend class DWARFDIE;
80 friend class DWARFASTParserClang;
81
82 // Static Functions
83 static void Initialize();
84
85 static void Terminate();
86
87 static void DebuggerInitialize(lldb_private::Debugger &debugger);
88
89 static llvm::StringRef GetPluginNameStatic() { return "dwarf"; }
90
91 static llvm::StringRef GetPluginDescriptionStatic();
92
94 CreateInstance(lldb::ObjectFileSP objfile_sp);
95
96 // Constructors and Destructors
97
98 SymbolFileDWARF(lldb::ObjectFileSP objfile_sp,
99 lldb_private::SectionList *dwo_section_list);
100
102
103 uint32_t CalculateAbilities() override;
104
105 void InitializeObject() override;
106
107 // Compile Unit function calls
108
110 ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
111
113 ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override;
114
115 size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
116
117 bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
118
119 bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
120
122 lldb_private::CompileUnit &, llvm::DenseSet<lldb_private::SymbolFile *> &,
123 llvm::function_ref<bool(lldb_private::Module &)>) override;
124
126 lldb_private::FileSpecList &support_files) override;
127
128 bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override;
129
130 size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
131
134 std::vector<lldb_private::SourceModule> &imported_modules) override;
135
136 size_t ParseBlocksRecursive(lldb_private::Function &func) override;
137
138 size_t
140
142 std::optional<ArrayInfo> GetDynamicArrayInfoForUID(
143 lldb::user_id_t type_uid,
144 const lldb_private::ExecutionContext *exe_ctx) override;
145
146 bool CompleteType(lldb_private::CompilerType &compiler_type) override;
147
149 bool assert_not_being_parsed = true,
150 bool resolve_function_context = false);
151
153
156
159
160 void
162
164 lldb::SymbolContextItem resolve_scope,
165 lldb_private::SymbolContext &sc) override;
166
169
171 const lldb_private::SourceLocationSpec &src_location_spec,
172 lldb::SymbolContextItem resolve_scope,
173 lldb_private::SymbolContextList &sc_list) override;
174
175 void
177 const lldb_private::CompilerDeclContext &parent_decl_ctx,
178 uint32_t max_matches,
179 lldb_private::VariableList &variables) override;
180
182 uint32_t max_matches,
183 lldb_private::VariableList &variables) override;
184
185 void FindFunctions(const lldb_private::Module::LookupInfo &lookup_info,
186 const lldb_private::CompilerDeclContext &parent_decl_ctx,
187 bool include_inlines,
188 lldb_private::SymbolContextList &sc_list) override;
189
191 bool include_inlines,
192 lldb_private::SymbolContextList &sc_list) override;
193
195 const std::string &scope_qualified_name,
196 std::vector<lldb_private::ConstString> &mangled_names) override;
197
198 void
200 const lldb_private::CompilerDeclContext &parent_decl_ctx,
201 uint32_t max_matches,
202 llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
203 lldb_private::TypeMap &types) override;
204
205 void FindTypes(llvm::ArrayRef<lldb_private::CompilerContext> pattern,
207 llvm::DenseSet<SymbolFile *> &searched_symbol_files,
208 lldb_private::TypeMap &types) override;
209
211 lldb::TypeClass type_mask,
212 lldb_private::TypeList &type_list) override;
213
214 llvm::Expected<lldb::TypeSystemSP>
216
219 const lldb_private::CompilerDeclContext &parent_decl_ctx) override;
220
221 void PreloadSymbols() override;
222
223 std::recursive_mutex &GetModuleMutex() const override;
224
225 // PluginInterface protocol
226 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
227
229
231
233
234 static bool SupportedVersion(uint16_t version);
235
238
239 bool
241
244
245 virtual void GetObjCMethods(lldb_private::ConstString class_name,
246 llvm::function_ref<bool(DWARFDIE die)> callback);
247
249
251
253
254 lldb::ModuleSP GetExternalModule(lldb_private::ConstString name);
255
256 typedef std::map<lldb_private::ConstString, lldb::ModuleSP>
258
259 /// Return the list of Clang modules imported by this SymbolFile.
262 }
263
264 virtual DWARFDIE GetDIE(const DIERef &die_ref);
265
267
269 return GetUID(die.GetDIERef());
270 }
271
272 lldb::user_id_t GetUID(const std::optional<DIERef> &ref) {
273 return ref ? GetUID(*ref) : LLDB_INVALID_UID;
274 }
275
277
278 std::shared_ptr<SymbolFileDWARFDwo>
280 const DWARFDebugInfoEntry &cu_die);
281
282 virtual std::optional<uint32_t> GetDwoNum() { return std::nullopt; }
283
284 /// If this is a DWARF object with a single CU, return its DW_AT_dwo_id.
285 std::optional<uint64_t> GetDWOId();
286
287 static bool
289 const DWARFDIE &die);
290
291 std::vector<std::unique_ptr<lldb_private::CallEdge>>
292 ParseCallEdgesInFunction(UserID func_id) override;
293
294 void Dump(lldb_private::Stream &s) override;
295
296 void DumpClangAST(lldb_private::Stream &s) override;
297
299
300 const std::shared_ptr<SymbolFileDWARFDwo> &GetDwpSymbolFile();
301
302 lldb_private::FileSpec GetFile(DWARFUnit &unit, size_t file_idx);
303
304 static llvm::Expected<lldb::TypeSystemSP> GetTypeSystem(DWARFUnit &unit);
305
307
308 // CompilerDecl related functions
309
311
313
316
318
319 static lldb::LanguageType LanguageTypeFromDWARF(uint64_t val);
320
322 /// Same as GetLanguage() but reports all C++ versions as C++ (no version).
324
326 return m_parse_time;
327 }
329
331 return m_parse_time;
332 }
333
334 virtual lldb::offset_t
336 const lldb::offset_t data_offset,
337 const uint8_t op) const {
338 return LLDB_INVALID_OFFSET;
339 }
340
341 virtual bool
343 lldb::offset_t &offset,
344 std::vector<lldb_private::Value> &stack) const {
345 return false;
346 }
347
349
350protected:
351 typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *>
353 typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb::VariableSP>
355 typedef llvm::DenseMap<const DWARFDebugInfoEntry *,
358 typedef llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef> ClangTypeToDIE;
359
361 const SymbolFileDWARF &operator=(const SymbolFileDWARF &) = delete;
362
363 virtual void LoadSectionData(lldb::SectionType sect_type,
365
367 const lldb_private::CompilerDeclContext &decl_ctx);
368
370
371 lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
372
374
375 lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit &dwarf_cu);
376
377 virtual DWARFCompileUnit *
379
381
383
385 const DWARFDIE &die);
386
388 lldb_private::Block *parent_block,
389 const DWARFDIE &die,
390 lldb::addr_t subprogram_low_pc, uint32_t depth);
391
392 size_t ParseTypes(const lldb_private::SymbolContext &sc, const DWARFDIE &die,
393 bool parse_siblings, bool parse_children);
394
395 lldb::TypeSP ParseType(const lldb_private::SymbolContext &sc,
396 const DWARFDIE &die, bool *type_is_new);
397
398 bool ParseSupportFiles(DWARFUnit &dwarf_cu, const lldb::ModuleSP &module,
399 lldb_private::FileSpecList &support_files);
400
402 bool assert_not_being_parsed);
403
405
406 lldb::VariableSP ParseVariableDIE(const lldb_private::SymbolContext &sc,
407 const DWARFDIE &die,
408 const lldb::addr_t func_low_pc);
409 lldb::VariableSP ParseVariableDIECached(const lldb_private::SymbolContext &sc,
410 const DWARFDIE &die);
411
412 void
414 const DWARFDIE &die,
415 lldb_private::VariableList &cc_variable_list);
416
418 const DWARFDIE &die,
419 const lldb::addr_t func_low_pc);
420
422 const lldb_private::SymbolContext &sc, const DWARFDIE &die,
423 lldb::addr_t func_low_pc, DIEArray &accumulator);
424
427 llvm::ArrayRef<DIERef> variable_dies,
428 lldb::addr_t func_low_pc);
429
431 DIEArray &&variable_dies);
432
433 bool ClassOrStructIsVirtual(const DWARFDIE &die);
434
435 // Given a die_offset, figure out the symbol context representing that die.
436 bool ResolveFunction(const DWARFDIE &die, bool include_inlines,
438
439 /// Resolve functions and (possibly) blocks for the given file address and a
440 /// compile unit. The compile unit comes from the sc argument and it must be
441 /// set. The results of the lookup (if any) are written back to the symbol
442 /// context.
443 void ResolveFunctionAndBlock(lldb::addr_t file_vm_addr, bool lookup_block,
445
446 virtual lldb::TypeSP
448
449 virtual lldb::TypeSP
452 bool must_be_implementation);
453
456
457 lldb::TypeSP GetTypeForDIE(const DWARFDIE &die,
458 bool resolve_function_context = false);
459
460 void SetDebugMapModule(const lldb::ModuleSP &module_sp) {
461 m_debug_map_module_wp = module_sp;
462 }
463
465
467 FindBlockContainingSpecification(const DIERef &func_die_ref,
468 dw_offset_t spec_block_die_offset);
469
472 dw_offset_t spec_block_die_offset);
473
475
476 bool DIEDeclContextsMatch(const DWARFDIE &die1, const DWARFDIE &die2);
477
478 bool ClassContainsSelector(const DWARFDIE &class_die,
480
481 /// Parse call site entries (DW_TAG_call_site), including any nested call site
482 /// parameters (DW_TAG_call_site_parameter).
483 std::vector<std::unique_ptr<lldb_private::CallEdge>>
484 CollectCallEdges(lldb::ModuleSP module, DWARFDIE function_die);
485
486 /// If this symbol file is linked to by a debug map (see
487 /// SymbolFileDWARFDebugMap), and \p file_addr is a file address relative to
488 /// an object file, adjust \p file_addr so that it is relative to the main
489 /// binary. Returns the adjusted address, or \p file_addr if no adjustment is
490 /// needed, on success and LLDB_INVALID_ADDRESS otherwise.
492
494
495 typedef llvm::SetVector<lldb_private::Type *> TypeSet;
496
497 void GetTypes(const DWARFDIE &die, dw_offset_t min_die_offset,
498 dw_offset_t max_die_offset, uint32_t type_mask,
499 TypeSet &type_set);
500
504
506
508
510
512
515 }
516
519 }
520
522 std::optional<uint32_t> GetDWARFUnitIndex(uint32_t cu_idx);
523
524 struct DecodedUID {
527 };
528 std::optional<DecodedUID> DecodeUID(lldb::user_id_t uid);
529
531
532 const lldb_private::FileSpecList &GetTypeUnitSupportFiles(DWARFTypeUnit &tu);
533
535 const lldb_private::SectionList &section_list);
536
538
539 lldb::ModuleWP m_debug_map_module_wp;
541
542 llvm::once_flag m_dwp_symfile_once_flag;
543 std::shared_ptr<SymbolFileDWARFDwo> m_dwp_symfile;
544
546
547 llvm::once_flag m_info_once_flag;
548 std::unique_ptr<DWARFDebugInfo> m_info;
549
550 std::unique_ptr<DWARFDebugAbbrev> m_abbr;
551 std::unique_ptr<GlobalVariableMap> m_global_aranges_up;
552
553 typedef std::unordered_map<lldb::offset_t, lldb_private::DebugMacrosSP>
556
558 std::unique_ptr<lldb_private::DWARFIndex> m_index;
561
562 typedef std::set<DIERef> DIERefSet;
563 typedef llvm::StringMap<DIERefSet> NameToOffsetMap;
565 std::unique_ptr<DWARFDebugRanges> m_ranges;
571 llvm::DenseMap<dw_offset_t, lldb_private::FileSpecList>
573 std::vector<uint32_t> m_lldb_cu_to_dwarf_unit;
574 /// DWARF does not provide a good way for traditional (concatenating) linkers
575 /// to invalidate debug info describing dead-stripped code. These linkers will
576 /// keep the debug info but resolve any addresses referring to such code as
577 /// zero (BFD) or a small positive integer (zero + relocation addend -- GOLD).
578 /// Try to filter out this debug info by comparing it to the lowest code
579 /// address in the module.
582 std::atomic_flag m_dwo_warning_issued = ATOMIC_FLAG_INIT;
583};
584
585#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARF_H
std::vector< DIERef > DIEArray
Definition: DIERef.h:96
Identifies a DWARF debug info entry within a given Module.
Definition: DIERef.h:26
std::optional< DIERef > GetDIERef() const
DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic o...
lldb_private::CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
static lldb_private::CompilerDeclContext GetContainingDeclContext(const DWARFDIE &die)
virtual lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, lldb_private::ConstString type_name, bool must_be_implementation)
static bool SupportedVersion(uint16_t version)
void FindTypes(llvm::ArrayRef< lldb_private::CompilerContext > pattern, lldb_private::LanguageSet languages, llvm::DenseSet< SymbolFile * > &searched_symbol_files, lldb_private::TypeMap &types) override
const SymbolFileDWARF & operator=(const SymbolFileDWARF &)=delete
std::optional< uint32_t > GetDWARFUnitIndex(uint32_t cu_idx)
virtual DIEToVariableSP & GetDIEToVariable()
uint32_t ResolveSymbolContext(const lldb_private::SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContextList &sc_list) override
llvm::DenseMap< const DWARFDebugInfoEntry *, lldb::VariableSP > DIEToVariableSP
lldb_private::CompileUnit * GetCompUnitForDWARFCompUnit(DWARFCompileUnit &dwarf_cu)
DWARFDebugRanges * GetDebugRanges()
void BuildCuTranslationTable()
size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override
SymbolFileDWARF(const SymbolFileDWARF &)=delete
DWARFDIE FindBlockContainingSpecification(const DIERef &func_die_ref, dw_offset_t spec_block_die_offset)
void Dump(lldb_private::Stream &s) override
size_t ParseVariablesInFunctionContext(const lldb_private::SymbolContext &sc, const DWARFDIE &die, const lldb::addr_t func_low_pc)
bool HasForwardDeclForClangType(const lldb_private::CompilerType &compiler_type)
void UpdateExternalModuleListIfNeeded()
DIEToVariableSP m_die_to_variable_sp
DebugMacrosMap m_debug_macros_map
static DWARFASTParser * GetDWARFParser(DWARFUnit &unit)
bool Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu)
static lldb::LanguageType GetLanguageFamily(DWARFUnit &unit)
Same as GetLanguage() but reports all C++ versions as C++ (no version).
const lldb_private::FileSpecList & GetTypeUnitSupportFiles(DWARFTypeUnit &tu)
bool ResolveFunction(const DWARFDIE &die, bool include_inlines, lldb_private::SymbolContextList &sc_list)
static char ID
LLVM RTTI support.
size_t ParseVariablesInFunctionContextRecursive(const lldb_private::SymbolContext &sc, const DWARFDIE &die, lldb::addr_t func_low_pc, DIEArray &accumulator)
lldb_private::StatsDuration & GetDebugInfoParseTimeRef()
std::map< lldb_private::ConstString, lldb::ModuleSP > ExternalTypeModuleMap
DWARFDebugAbbrev * DebugAbbrev()
lldb_private::Type * ResolveType(const DWARFDIE &die, bool assert_not_being_parsed=true, bool resolve_function_context=false)
llvm::DenseMap< const DWARFDebugInfoEntry *, lldb_private::Type * > DIEToTypePtr
virtual lldb::offset_t GetVendorDWARFOpcodeSize(const lldb_private::DataExtractor &data, const lldb::offset_t data_offset, const uint8_t op) const
lldb::user_id_t GetUID(const std::optional< DIERef > &ref)
ExternalTypeModuleMap m_external_type_modules
bool isA(const void *ClassID) const override
LLVM RTTI support.
std::unique_ptr< DWARFDebugAbbrev > m_abbr
size_t PopulateBlockVariableList(lldb_private::VariableList &variable_list, const lldb_private::SymbolContext &sc, llvm::ArrayRef< DIERef > variable_dies, lldb::addr_t func_low_pc)
lldb_private::Function * ParseFunction(lldb_private::CompileUnit &comp_unit, const DWARFDIE &die)
DWARFUnit * GetNextUnparsedDWARFCompileUnit(DWARFUnit *prev_cu)
lldb::ModuleSP GetExternalModule(lldb_private::ConstString name)
void InitializeFirstCodeAddressRecursive(const lldb_private::SectionList &section_list)
const std::shared_ptr< SymbolFileDWARFDwo > & GetDwpSymbolFile()
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
std::recursive_mutex & GetModuleMutex() const override
Symbols file subclasses should override this to return the Module that owns the TypeSystem that this ...
bool ClassContainsSelector(const DWARFDIE &class_die, lldb_private::ConstString selector)
virtual DWARFCompileUnit * GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit)
std::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.
lldb_private::CompilerDeclContext FindNamespace(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx) override
lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, lldb_private::Variable * > GlobalVariableMap
uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
bool CompleteType(lldb_private::CompilerType &compiler_type) override
GlobalVariableMap & GetGlobalAranges()
lldb::TypeSP GetTypeForDIE(const DWARFDIE &die, bool resolve_function_context=false)
NameToOffsetMap m_function_scope_qualified_name_map
bool ParseImportedModules(const lldb_private::SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
size_t ParseBlocksRecursive(lldb_private::Function &func) override
lldb::LanguageType ParseLanguage(lldb_private::CompileUnit &comp_unit) override
lldb_private::ConstString ConstructFunctionDemangledName(const DWARFDIE &die)
std::unique_ptr< GlobalVariableMap > m_global_aranges_up
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
virtual DIEToClangType & GetForwardDeclDieToClangType()
lldb_private::FileSpec GetFile(DWARFUnit &unit, size_t file_idx)
ClangTypeToDIE m_forward_decl_clang_type_to_die
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
static bool classof(const SymbolFile *obj)
virtual DWARFDIE GetDIE(const DIERef &die_ref)
SymbolFileDWARF(lldb::ObjectFileSP objfile_sp, lldb_private::SectionList *dwo_section_list)
static void Initialize()
void InitializeFirstCodeAddress()
virtual bool ParseVendorDWARFOpcode(uint8_t op, const lldb_private::DataExtractor &opcodes, lldb::offset_t &offset, std::vector< lldb_private::Value > &stack) const
bool DeclContextMatchesThisSymbolFile(const lldb_private::CompilerDeclContext &decl_ctx)
lldb::TypeSP ParseType(const lldb_private::SymbolContext &sc, const DWARFDIE &die, bool *type_is_new)
static bool DIEInDeclContext(const lldb_private::CompilerDeclContext &parent_decl_ctx, const DWARFDIE &die)
static lldb_private::CompilerDecl GetDecl(const DWARFDIE &die)
llvm::StringMap< DIERefSet > NameToOffsetMap
static void DebuggerInitialize(lldb_private::Debugger &debugger)
virtual void LoadSectionData(lldb::SectionType sect_type, lldb_private::DWARFDataExtractor &data)
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
uint32_t CalculateNumCompileUnits() override
static llvm::StringRef GetPluginNameStatic()
std::optional< DecodedUID > DecodeUID(lldb::user_id_t uid)
llvm::DenseMap< dw_offset_t, lldb_private::FileSpecList > m_type_unit_support_files
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
static lldb::LanguageType GetLanguage(DWARFUnit &unit)
bool ClassOrStructIsVirtual(const DWARFDIE &die)
std::shared_ptr< SymbolFileDWARFDwo > m_dwp_symfile
std::unique_ptr< DWARFDebugRanges > m_ranges
void FindGlobalVariables(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, lldb_private::VariableList &variables) override
bool GetFunction(const DWARFDIE &die, lldb_private::SymbolContext &sc)
static lldb_private::SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
lldb_private::XcodeSDK ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
std::unordered_map< lldb::offset_t, lldb_private::DebugMacrosSP > DebugMacrosMap
lldb_private::StatsDuration m_parse_time
std::optional< uint64_t > GetDWOId()
If this is a DWARF object with a single CU, return its DW_AT_dwo_id.
lldb::user_id_t GetUID(const DWARFBaseDIE &die)
uint32_t CalculateAbilities() override
SymbolFileDWARFDebugMap * GetDebugMapSymfile()
std::shared_ptr< SymbolFileDWARFDwo > GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die)
std::set< DIERef > DIERefSet
bool ParseSupportFiles(DWARFUnit &dwarf_cu, const lldb::ModuleSP &module, lldb_private::FileSpecList &support_files)
bool m_fetched_external_modules
lldb::addr_t m_first_code_address
DWARF does not provide a good way for traditional (concatenating) linkers to invalidate debug info de...
llvm::StringRef GetPluginName() override
static DWARFDeclContext GetDWARFDeclContext(const DWARFDIE &die)
~SymbolFileDWARF() override
lldb_private::StatsDuration::Duration GetDebugInfoIndexTime() override
Return the time it took to index the debug information in the object file.
lldb_private::DWARFContext m_context
DWARFDebugInfo & DebugInfo()
void FindDwpSymbolFile()
lldb_private::Status CalculateFrameVariableError(lldb_private::StackFrame &frame) override
Subclasses will override this function to for GetFrameVariableError().
virtual lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDIE &die)
static llvm::StringRef GetPluginDescriptionStatic()
std::vector< std::unique_ptr< lldb_private::CallEdge > > CollectCallEdges(lldb::ModuleSP module, DWARFDIE function_die)
Parse call site entries (DW_TAG_call_site), including any nested call site parameters (DW_TAG_call_si...
DIEArray MergeBlockAbstractParameters(const DWARFDIE &block_die, DIEArray &&variable_dies)
DWARFDIE GetDeclContextDIEContainingDIE(const DWARFDIE &die)
const ExternalTypeModuleMap & getExternalTypeModules() const
Return the list of Clang modules imported by this SymbolFile.
void ResolveFunctionAndBlock(lldb::addr_t file_vm_addr, bool lookup_block, lldb_private::SymbolContext &sc)
Resolve functions and (possibly) blocks for the given file address and a compile unit.
llvm::once_flag m_info_once_flag
void InitializeObject() override
Initialize the SymbolFile object.
static llvm::Expected< lldb::TypeSystemSP > GetTypeSystem(DWARFUnit &unit)
std::vector< uint32_t > m_lldb_cu_to_dwarf_unit
lldb_private::Symbol * GetObjCClassSymbol(lldb_private::ConstString objc_class_name)
DIEToClangType m_forward_decl_die_to_clang_type
void GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector< lldb_private::ConstString > &mangled_names) override
std::atomic_flag m_dwo_warning_issued
void PreloadSymbols() override
lldb::VariableSP ParseVariableDIE(const lldb_private::SymbolContext &sc, const DWARFDIE &die, const lldb::addr_t func_low_pc)
lldb_private::TypeList & GetTypeList() override
std::unique_ptr< lldb_private::DWARFIndex > m_index
llvm::once_flag m_dwp_symfile_once_flag
lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit &dwarf_cu)
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
llvm::SetVector< lldb_private::Type * > TypeSet
static lldb::LanguageType LanguageTypeFromDWARF(uint64_t val)
void DumpClangAST(lldb_private::Stream &s) override
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die)
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(UserID func_id) override
lldb::addr_t FixupAddress(lldb::addr_t file_addr)
If this symbol file is linked to by a debug map (see SymbolFileDWARFDebugMap), and file_addr is a fil...
static void Terminate()
llvm::Expected< lldb::TypeSystemSP > GetTypeSystemForLanguage(lldb::LanguageType language) override
llvm::DenseMap< const DWARFDebugInfoEntry *, lldb::opaque_compiler_type_t > DIEToClangType
virtual std::optional< uint32_t > GetDwoNum()
lldb_private::DWARFContext & GetDWARFContext()
lldb_private::CompilerDecl GetDeclForUID(lldb::user_id_t uid) override
std::unique_ptr< DWARFDebugInfo > m_info
virtual void GetObjCMethods(lldb_private::ConstString class_name, llvm::function_ref< bool(DWARFDIE die)> callback)
virtual DIEToTypePtr & GetDIEToType()
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
lldb_private::CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
void SetDebugMapModule(const lldb::ModuleSP &module_sp)
void ParseAndAppendGlobalVariable(const lldb_private::SymbolContext &sc, const DWARFDIE &die, lldb_private::VariableList &cc_variable_list)
virtual ClangTypeToDIE & GetForwardDeclClangTypeToDie()
lldb::ModuleWP m_debug_map_module_wp
lldb::VariableSP ParseVariableDIECached(const lldb_private::SymbolContext &sc, const DWARFDIE &die)
SymbolFileDWARFDebugMap * m_debug_map_symfile
DIEToTypePtr m_die_to_type
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
UniqueDWARFASTTypeMap m_unique_ast_type_map
void ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override
bool DIEDeclContextsMatch(const DWARFDIE &die1, const DWARFDIE &die2)
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
llvm::DenseMap< lldb::opaque_compiler_type_t, DIERef > ClangTypeToDIE
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type
static lldb_private::CompilerDeclContext GetDeclContext(const DWARFDIE &die)
lldb_private::StatsDuration::Duration GetDebugInfoParseTime() override
Return the time taken to parse the debug information.
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override
virtual UniqueDWARFASTTypeMap & GetUniqueDWARFASTTypeMap()
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
A section + offset based address class.
Definition: Address.h:59
A class that describes a single lexical block.
Definition: Block.h:41
A class that describes a compilation unit.
Definition: CompileUnit.h:41
Represents a generic declaration context in a program.
Represents a generic declaration such as a function declaration.
Definition: CompilerDecl.h:28
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A uniqued constant string class.
Definition: ConstString.h:39
An data extractor class.
Definition: DataExtractor.h:48
A class to manage flag bits.
Definition: Debugger.h:77
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file utility class.
Definition: FileSpec.h:56
A class that describes a function.
Definition: Function.h:409
A class that encapsulates name lookup information.
Definition: Module.h:950
A class that describes an executable image and its associated object and symbol files.
Definition: Module.h:88
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
This base class provides an interface to stack frames.
Definition: StackFrame.h:41
std::chrono::duration< double > Duration
Definition: Statistics.h:31
An error handling class.
Definition: Status.h:44
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
Defines a list of symbol context objects.
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:33
Containing protected virtual methods for child classes to override.
Definition: SymbolFile.h:436
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:47
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition: XcodeSDK.h:24
#define LLDB_INVALID_UID
Definition: lldb-defines.h:80
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
#define LLDB_INVALID_OFFSET
Definition: lldb-defines.h:85
std::shared_ptr< DebugMacros > DebugMacrosSP
Definition: DebugMacros.h:22
void * opaque_compiler_type_t
Definition: lldb-types.h:90
uint64_t offset_t
Definition: lldb-types.h:87
LanguageType
Programming language type.
uint64_t user_id_t
Definition: lldb-types.h:84
uint64_t addr_t
Definition: lldb-types.h:83
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: TypeSystem.h:45
A mix in class that contains a generic user ID.
Definition: UserID.h:31
UserID(lldb::user_id_t uid=LLDB_INVALID_UID)
Construct with optional user ID.
Definition: UserID.h:33