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;
47class DWARFDebugInfo;
49class DWARFDebugLine;
52class DWARFFormValue;
53class DWARFTypeUnit;
56class SymbolFileDWARFDwp;
57class UserID;
58
59#define DIE_IS_BEING_PARSED ((lldb_private::Type *)1)
60
62 /// LLVM RTTI support.
63 static char ID;
64
65public:
66 /// LLVM RTTI support.
67 /// \{
68 bool isA(const void *ClassID) const override {
69 return ClassID == &ID || SymbolFileCommon::isA(ClassID);
70 }
71 static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
72 /// \}
73
75 friend class SymbolFileDWARFDwo;
76 friend class DebugMapModule;
77 friend class DWARFCompileUnit;
78 friend class DWARFDIE;
79 friend class DWARFASTParserClang;
80
81 // Static Functions
82 static void Initialize();
83
84 static void Terminate();
85
86 static void DebuggerInitialize(lldb_private::Debugger &debugger);
87
88 static llvm::StringRef GetPluginNameStatic() { return "dwarf"; }
89
90 static llvm::StringRef GetPluginDescriptionStatic();
91
93 CreateInstance(lldb::ObjectFileSP objfile_sp);
94
95 // Constructors and Destructors
96
97 SymbolFileDWARF(lldb::ObjectFileSP objfile_sp,
98 lldb_private::SectionList *dwo_section_list);
99
101
102 uint32_t CalculateAbilities() override;
103
104 void InitializeObject() override;
105
106 // Compile Unit function calls
107
109 ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
110
112 ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override;
113
114 size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
115
116 bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
117
118 bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
119
121 lldb_private::CompileUnit &, llvm::DenseSet<lldb_private::SymbolFile *> &,
122 llvm::function_ref<bool(lldb_private::Module &)>) override;
123
125 lldb_private::FileSpecList &support_files) override;
126
127 bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override;
128
129 size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
130
133 std::vector<lldb_private::SourceModule> &imported_modules) override;
134
135 size_t ParseBlocksRecursive(lldb_private::Function &func) override;
136
137 size_t
139
141 std::optional<ArrayInfo> GetDynamicArrayInfoForUID(
142 lldb::user_id_t type_uid,
143 const lldb_private::ExecutionContext *exe_ctx) override;
144
145 bool CompleteType(lldb_private::CompilerType &compiler_type) override;
146
148 bool assert_not_being_parsed = true,
149 bool resolve_function_context = false);
150
152
155
158
159 void
161
163 lldb::SymbolContextItem resolve_scope,
164 lldb_private::SymbolContext &sc) override;
165
168
170 const lldb_private::SourceLocationSpec &src_location_spec,
171 lldb::SymbolContextItem resolve_scope,
172 lldb_private::SymbolContextList &sc_list) override;
173
174 void
176 const lldb_private::CompilerDeclContext &parent_decl_ctx,
177 uint32_t max_matches,
178 lldb_private::VariableList &variables) override;
179
181 uint32_t max_matches,
182 lldb_private::VariableList &variables) override;
183
184 void FindFunctions(const lldb_private::Module::LookupInfo &lookup_info,
185 const lldb_private::CompilerDeclContext &parent_decl_ctx,
186 bool include_inlines,
187 lldb_private::SymbolContextList &sc_list) override;
188
190 bool include_inlines,
191 lldb_private::SymbolContextList &sc_list) override;
192
194 const std::string &scope_qualified_name,
195 std::vector<lldb_private::ConstString> &mangled_names) override;
196
197 void
199 const lldb_private::CompilerDeclContext &parent_decl_ctx,
200 uint32_t max_matches,
201 llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
202 lldb_private::TypeMap &types) override;
203
204 void FindTypes(llvm::ArrayRef<lldb_private::CompilerContext> pattern,
206 llvm::DenseSet<SymbolFile *> &searched_symbol_files,
207 lldb_private::TypeMap &types) override;
208
210 lldb::TypeClass type_mask,
211 lldb_private::TypeList &type_list) override;
212
213 llvm::Expected<lldb::TypeSystemSP>
215
218 const lldb_private::CompilerDeclContext &parent_decl_ctx,
219 bool only_root_namespaces) 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
268 std::shared_ptr<SymbolFileDWARFDwo>
270 const DWARFDebugInfoEntry &cu_die);
271
272 /// If this is a DWARF object with a single CU, return its DW_AT_dwo_id.
273 std::optional<uint64_t> GetDWOId();
274
275 static bool
277 const DWARFDIE &die, bool only_root_namespaces = false);
278
279 std::vector<std::unique_ptr<lldb_private::CallEdge>>
281
282 void Dump(lldb_private::Stream &s) override;
283
284 void DumpClangAST(lldb_private::Stream &s) override;
285
287
288 const std::shared_ptr<SymbolFileDWARFDwo> &GetDwpSymbolFile();
289
290 lldb_private::FileSpec GetFile(DWARFUnit &unit, size_t file_idx);
291
292 static llvm::Expected<lldb::TypeSystemSP> GetTypeSystem(DWARFUnit &unit);
293
295
296 // CompilerDecl related functions
297
299
301
304
306
307 static lldb::LanguageType LanguageTypeFromDWARF(uint64_t val);
308
310 /// Same as GetLanguage() but reports all C++ versions as C++ (no version).
312
314 return m_parse_time;
315 }
317
319 return m_parse_time;
320 }
321
322 virtual lldb::offset_t
324 const lldb::offset_t data_offset,
325 const uint8_t op) const {
326 return LLDB_INVALID_OFFSET;
327 }
328
329 virtual bool
331 lldb::offset_t &offset,
332 std::vector<lldb_private::Value> &stack) const {
333 return false;
334 }
335
337
338 std::optional<uint64_t> GetFileIndex() const { return m_file_index; }
339 void SetFileIndex(std::optional<uint64_t> file_index) {
340 m_file_index = file_index;
341 }
342
343protected:
344 typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *>
346 typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb::VariableSP>
348 typedef llvm::DenseMap<const DWARFDebugInfoEntry *,
351 typedef llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef> ClangTypeToDIE;
352
354 const SymbolFileDWARF &operator=(const SymbolFileDWARF &) = delete;
355
356 virtual void LoadSectionData(lldb::SectionType sect_type,
358
360 const lldb_private::CompilerDeclContext &decl_ctx);
361
363
364 lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
365
367
368 lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit &dwarf_cu);
369
370 virtual DWARFCompileUnit *
372
374
376
378 const DWARFDIE &die);
379
381 lldb_private::Block *parent_block,
382 const DWARFDIE &die,
383 lldb::addr_t subprogram_low_pc, uint32_t depth);
384
385 size_t ParseTypes(const lldb_private::SymbolContext &sc, const DWARFDIE &die,
386 bool parse_siblings, bool parse_children);
387
388 lldb::TypeSP ParseType(const lldb_private::SymbolContext &sc,
389 const DWARFDIE &die, bool *type_is_new);
390
391 bool ParseSupportFiles(DWARFUnit &dwarf_cu, const lldb::ModuleSP &module,
392 lldb_private::FileSpecList &support_files);
393
395 bool assert_not_being_parsed);
396
398
399 lldb::VariableSP ParseVariableDIE(const lldb_private::SymbolContext &sc,
400 const DWARFDIE &die,
401 const lldb::addr_t func_low_pc);
402 lldb::VariableSP ParseVariableDIECached(const lldb_private::SymbolContext &sc,
403 const DWARFDIE &die);
404
405 void
407 const DWARFDIE &die,
408 lldb_private::VariableList &cc_variable_list);
409
411 const DWARFDIE &die,
412 const lldb::addr_t func_low_pc);
413
415 const lldb_private::SymbolContext &sc, const DWARFDIE &die,
416 lldb::addr_t func_low_pc, DIEArray &accumulator);
417
420 llvm::ArrayRef<DIERef> variable_dies,
421 lldb::addr_t func_low_pc);
422
424 DIEArray &&variable_dies);
425
426 bool ClassOrStructIsVirtual(const DWARFDIE &die);
427
428 // Given a die_offset, figure out the symbol context representing that die.
429 bool ResolveFunction(const DWARFDIE &die, bool include_inlines,
431
432 /// Resolve functions and (possibly) blocks for the given file address and a
433 /// compile unit. The compile unit comes from the sc argument and it must be
434 /// set. The results of the lookup (if any) are written back to the symbol
435 /// context.
436 void ResolveFunctionAndBlock(lldb::addr_t file_vm_addr, bool lookup_block,
438
439 virtual lldb::TypeSP
441
442 virtual lldb::TypeSP
445 bool must_be_implementation);
446
449
450 lldb::TypeSP GetTypeForDIE(const DWARFDIE &die,
451 bool resolve_function_context = false);
452
453 void SetDebugMapModule(const lldb::ModuleSP &module_sp) {
454 m_debug_map_module_wp = module_sp;
455 }
456
458
460 FindBlockContainingSpecification(const DIERef &func_die_ref,
461 dw_offset_t spec_block_die_offset);
462
465 dw_offset_t spec_block_die_offset);
466
468
469 bool DIEDeclContextsMatch(const DWARFDIE &die1, const DWARFDIE &die2);
470
471 bool ClassContainsSelector(const DWARFDIE &class_die,
473
474 /// Parse call site entries (DW_TAG_call_site), including any nested call site
475 /// parameters (DW_TAG_call_site_parameter).
476 std::vector<std::unique_ptr<lldb_private::CallEdge>>
477 CollectCallEdges(lldb::ModuleSP module, DWARFDIE function_die);
478
479 /// If this symbol file is linked to by a debug map (see
480 /// SymbolFileDWARFDebugMap), and \p file_addr is a file address relative to
481 /// an object file, adjust \p file_addr so that it is relative to the main
482 /// binary. Returns the adjusted address, or \p file_addr if no adjustment is
483 /// needed, on success and LLDB_INVALID_ADDRESS otherwise.
485
487
488 typedef llvm::SetVector<lldb_private::Type *> TypeSet;
489
490 void GetTypes(const DWARFDIE &die, dw_offset_t min_die_offset,
491 dw_offset_t max_die_offset, uint32_t type_mask,
492 TypeSet &type_set);
493
497
499
501
503
505
508 }
509
512 }
513
515 std::optional<uint32_t> GetDWARFUnitIndex(uint32_t cu_idx);
516
518
520
522 const lldb_private::SectionList &section_list);
523
525
527 std::unordered_map<lldb::CompUnitSP, lldb_private::Args> &args) override;
528
529 lldb::ModuleWP m_debug_map_module_wp;
531
532 llvm::once_flag m_dwp_symfile_once_flag;
533 std::shared_ptr<SymbolFileDWARFDwo> m_dwp_symfile;
534
536
537 llvm::once_flag m_info_once_flag;
538 std::unique_ptr<DWARFDebugInfo> m_info;
539
540 std::unique_ptr<DWARFDebugAbbrev> m_abbr;
541 std::unique_ptr<GlobalVariableMap> m_global_aranges_up;
542
543 typedef std::unordered_map<lldb::offset_t, lldb_private::DebugMacrosSP>
546
548 std::unique_ptr<lldb_private::DWARFIndex> m_index;
551
552 typedef std::set<DIERef> DIERefSet;
553 typedef llvm::StringMap<DIERefSet> NameToOffsetMap;
555 std::unique_ptr<DWARFDebugRanges> m_ranges;
561 llvm::DenseMap<dw_offset_t, lldb_private::FileSpecList>
563 std::vector<uint32_t> m_lldb_cu_to_dwarf_unit;
564 /// DWARF does not provide a good way for traditional (concatenating) linkers
565 /// to invalidate debug info describing dead-stripped code. These linkers will
566 /// keep the debug info but resolve any addresses referring to such code as
567 /// zero (BFD) or a small positive integer (zero + relocation addend -- GOLD).
568 /// Try to filter out this debug info by comparing it to the lowest code
569 /// address in the module.
572 std::atomic_flag m_dwo_warning_issued = ATOMIC_FLAG_INIT;
573 /// If this DWARF file a .DWO file or a DWARF .o file on mac when
574 /// no dSYM file is being used, this file index will be set to a
575 /// valid value that can be used in DIERef objects which will contain
576 /// an index that identifies the .DWO or .o file.
577 std::optional<uint64_t> m_file_index;
578};
579
580#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARF_H
std::vector< DIERef > DIEArray
Definition: DIERef.h:133
Identifies a DWARF debug info entry within a given Module.
Definition: DIERef.h:28
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
lldb_private::CompilerDeclContext FindNamespace(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, bool only_root_namespaces) override
Finds a namespace of name name and whose parent context is parent_decl_ctx.
static bool DIEInDeclContext(const lldb_private::CompilerDeclContext &parent_decl_ctx, const DWARFDIE &die, bool only_root_namespaces=false)
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
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::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()
std::optional< uint64_t > GetFileIndex() const
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()
void SetFileIndex(std::optional< uint64_t > file_index)
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 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()
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)
std::optional< uint64_t > m_file_index
If this DWARF file a .DWO file or a DWARF .o file on mac when no dSYM file is being used,...
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.
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
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(lldb_private::UserID func_id) override
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)
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
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:78
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file collection class.
Definition: FileSpecList.h:24
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:469
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:49
std::unordered_map< lldb::CompUnitSP, Args > GetCompileOptions()
Returns a map of compilation unit to the compile option arguments associated with that compilation un...
Definition: SymbolFile.h:450
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition: XcodeSDK.h:24
uint64_t dw_offset_t
Definition: dwarf.h:31
#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:86
uint64_t offset_t
Definition: lldb-types.h:83
LanguageType
Programming language type.
uint64_t user_id_t
Definition: lldb-types.h:80
uint64_t addr_t
Definition: lldb-types.h:79
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