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"
34#include "lldb/lldb-private.h"
35
36#include "DWARFContext.h"
37#include "DWARFDataExtractor.h"
38#include "DWARFDefines.h"
39#include "DWARFIndex.h"
40#include "UniqueDWARFASTType.h"
41
43
44namespace llvm {
45class DWARFDebugAbbrev;
46} // namespace llvm
47
48namespace lldb_private::plugin {
49namespace dwarf {
50// Forward Declarations for this DWARF plugin
51class DebugMapModule;
52class DWARFCompileUnit;
53class DWARFDebugAranges;
54class DWARFDebugInfo;
55class DWARFDebugInfoEntry;
56class DWARFDebugLine;
57class DWARFDebugRanges;
58class DWARFDeclContext;
59class DWARFFormValue;
60class DWARFTypeUnit;
61class SymbolFileDWARFDebugMap;
62class SymbolFileDWARFDwo;
63class SymbolFileDWARFDwp;
64
65#define DIE_IS_BEING_PARSED ((lldb_private::Type *)1)
66
68 /// LLVM RTTI support.
69 static char ID;
70
71public:
72 /// LLVM RTTI support.
73 /// \{
74 bool isA(const void *ClassID) const override {
75 return ClassID == &ID || SymbolFileCommon::isA(ClassID);
76 }
77 static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
78 /// \}
79
81 friend class SymbolFileDWARFDwo;
82 friend class DebugMapModule;
83 friend class DWARFCompileUnit;
84 friend class DWARFDIE;
85 friend class DWARFASTParser;
86
87 // Static Functions
88 static void Initialize();
89
90 static void Terminate();
91
92 static void DebuggerInitialize(Debugger &debugger);
93
94 static llvm::StringRef GetPluginNameStatic() { return "dwarf"; }
95
96 static llvm::StringRef GetPluginDescriptionStatic();
97
99
100 // Constructors and Destructors
101
102 SymbolFileDWARF(lldb::ObjectFileSP objfile_sp, SectionList *dwo_section_list);
103
105
106 uint32_t CalculateAbilities() override;
107
108 void InitializeObject() override;
109
110 // Compile Unit function calls
111
112 lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) override;
113
114 XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit) override;
115
116 size_t ParseFunctions(CompileUnit &comp_unit) override;
117
118 bool ParseLineTable(CompileUnit &comp_unit) override;
119
120 bool ParseDebugMacros(CompileUnit &comp_unit) override;
121
122 bool ForEachExternalModule(CompileUnit &, llvm::DenseSet<SymbolFile *> &,
123 llvm::function_ref<bool(Module &)>) override;
124
125 bool ParseSupportFiles(CompileUnit &comp_unit,
126 SupportFileList &support_files) override;
127
128 bool ParseIsOptimized(CompileUnit &comp_unit) override;
129
130 size_t ParseTypes(CompileUnit &comp_unit) override;
131
132 bool
134 std::vector<SourceModule> &imported_modules) override;
135
136 size_t ParseBlocksRecursive(Function &func) override;
137
138 size_t ParseVariablesForContext(const SymbolContext &sc) override;
139
140 std::optional<ArrayInfo>
142 const ExecutionContext *exe_ctx) override;
143
144 bool CompleteType(CompilerType &compiler_type) override;
145
146 Type *ResolveType(const DWARFDIE &die, bool assert_not_being_parsed = true,
147 bool resolve_function_context = false);
148
150
152
154
155 std::vector<CompilerContext>
157
158 void ParseDeclsForContext(CompilerDeclContext decl_ctx) override;
159
160 uint32_t ResolveSymbolContext(const Address &so_addr,
161 lldb::SymbolContextItem resolve_scope,
162 SymbolContext &sc) override;
163
165
166 uint32_t ResolveSymbolContext(const SourceLocationSpec &src_location_spec,
167 lldb::SymbolContextItem resolve_scope,
168 SymbolContextList &sc_list) override;
169
171 const CompilerDeclContext &parent_decl_ctx,
172 uint32_t max_matches,
173 VariableList &variables) override;
174
175 void FindGlobalVariables(const RegularExpression &regex, uint32_t max_matches,
176 VariableList &variables) override;
177
178 void FindFunctions(const Module::LookupInfo &lookup_info,
179 const CompilerDeclContext &parent_decl_ctx,
180 bool include_inlines, SymbolContextList &sc_list) override;
181
182 void FindFunctions(const RegularExpression &regex, bool include_inlines,
183 SymbolContextList &sc_list) override;
184
185 void
186 GetMangledNamesForFunction(const std::string &scope_qualified_name,
187 std::vector<ConstString> &mangled_names) override;
188
189 uint64_t GetDebugInfoSize(bool load_all_debug_info = false) override;
190
191 void FindTypes(const lldb_private::TypeQuery &match,
192 lldb_private::TypeResults &results) override;
193
194 void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask,
195 TypeList &type_list) override;
196
197 llvm::Expected<lldb::TypeSystemSP>
199
201 const CompilerDeclContext &parent_decl_ctx,
202 bool only_root_namespaces) override;
203
204 void PreloadSymbols() override;
205
206 std::recursive_mutex &GetModuleMutex() const override;
207
208 // PluginInterface protocol
209 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
210
211 llvm::DWARFDebugAbbrev *DebugAbbrev();
212
214
216
217 static bool SupportedVersion(uint16_t version);
218
221
222 bool HasForwardDeclForCompilerType(const CompilerType &compiler_type);
223
225
226 virtual void GetObjCMethods(ConstString class_name,
227 llvm::function_ref<bool(DWARFDIE die)> callback);
228
230
232
234
236
237 typedef std::map<ConstString, lldb::ModuleSP> ExternalTypeModuleMap;
238
239 /// Return the list of Clang modules imported by this SymbolFile.
242 }
243
244 virtual DWARFDIE GetDIE(const DIERef &die_ref);
245
247
248 std::shared_ptr<SymbolFileDWARFDwo>
250 const DWARFDebugInfoEntry &cu_die);
251
252 /// If this is a DWARF object with a single CU, return its DW_AT_dwo_id.
253 std::optional<uint64_t> GetDWOId();
254
255 /// Given a DWO DWARFUnit, find the corresponding skeleton DWARFUnit
256 /// in the main symbol file. DWP files can have their DWARFUnits
257 /// parsed without the skeleton compile units having been parsed, so
258 /// sometimes we need to find the skeleton compile unit for a DWO
259 /// DWARFUnit so we can fill in this link. Currently unless the
260 /// skeleton compile unit has been parsed _and_ the Unit DIE has been
261 /// parsed, the DWO unit will not have a backward link setup correctly
262 /// which was causing crashes due to an assertion that was firing
263 /// in SymbolFileDWARF::GetCompUnitForDWARFCompUnit().
265
266 static bool DIEInDeclContext(const CompilerDeclContext &parent_decl_ctx,
267 const DWARFDIE &die,
268 bool only_root_namespaces = false);
269
270 std::vector<std::unique_ptr<CallEdge>>
271 ParseCallEdgesInFunction(UserID func_id) override;
272
273 void Dump(Stream &s) override;
274
275 void DumpClangAST(Stream &s) override;
276
277 /// List separate dwo files.
279 bool errors_only) override;
280
282
283 const std::shared_ptr<SymbolFileDWARFDwo> &GetDwpSymbolFile();
284
285 FileSpec GetFile(DWARFUnit &unit, size_t file_idx);
286
287 static llvm::Expected<lldb::TypeSystemSP> GetTypeSystem(DWARFUnit &unit);
288
290
291 // CompilerDecl related functions
292
293 static CompilerDecl GetDecl(const DWARFDIE &die);
294
296
298
299 static lldb::LanguageType LanguageTypeFromDWARF(uint64_t val);
300
302 /// Same as GetLanguage() but reports all C++ versions as C++ (no version).
304
306 return m_parse_time;
307 }
309
311
312 virtual lldb::offset_t
314 const lldb::offset_t data_offset,
315 const uint8_t op) const {
316 return LLDB_INVALID_OFFSET;
317 }
318
319 virtual bool ParseVendorDWARFOpcode(uint8_t op, const DataExtractor &opcodes,
320 lldb::offset_t &offset,
321 std::vector<Value> &stack) const {
322 return false;
323 }
324
326
327 std::optional<uint64_t> GetFileIndex() const { return m_file_index; }
328 void SetFileIndex(std::optional<uint64_t> file_index) {
329 m_file_index = file_index;
330 }
331
332 typedef llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> DIEToTypePtr;
333
335
336 typedef llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef>
338
341 }
342
343 typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb::VariableSP>
345
347
349
350 bool ClassOrStructIsVirtual(const DWARFDIE &die);
351
353
354 virtual lldb::TypeSP
356
358 const DWARFDIE &die, ConstString type_name, bool must_be_implementation);
359
360 Type *ResolveTypeUID(lldb::user_id_t type_uid) override;
361
362 Type *ResolveTypeUID(const DWARFDIE &die, bool assert_not_being_parsed);
363
364 Type *ResolveTypeUID(const DIERef &die_ref);
365
366 /// Returns the DWARFIndex for this symbol, if it exists.
367 DWARFIndex *getIndex() { return m_index.get(); }
368
369protected:
371 const SymbolFileDWARF &operator=(const SymbolFileDWARF &) = delete;
372
373 virtual void LoadSectionData(lldb::SectionType sect_type,
374 DWARFDataExtractor &data);
375
377
378 uint32_t CalculateNumCompileUnits() override;
379
380 lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
381
382 TypeList &GetTypeList() override;
383
385
387
389
390 bool GetFunction(const DWARFDIE &die, SymbolContext &sc);
391
392 Function *ParseFunction(CompileUnit &comp_unit, const DWARFDIE &die);
393
394 size_t ParseBlocksRecursive(CompileUnit &comp_unit, Block *parent_block,
395 const DWARFDIE &die,
396 lldb::addr_t subprogram_low_pc, uint32_t depth);
397
398 size_t ParseTypes(const SymbolContext &sc, const DWARFDIE &die,
399 bool parse_siblings, bool parse_children);
400
401 lldb::TypeSP ParseType(const SymbolContext &sc, const DWARFDIE &die,
402 bool *type_is_new);
403
404 bool ParseSupportFiles(DWARFUnit &dwarf_cu, const lldb::ModuleSP &module,
405 SupportFileList &support_files);
406
408 const DWARFDIE &die,
409 const lldb::addr_t func_low_pc);
411 const DWARFDIE &die);
412
414 const DWARFDIE &die,
415 VariableList &cc_variable_list);
416
418 const DWARFDIE &die,
419 const lldb::addr_t func_low_pc);
420
422 const DWARFDIE &die,
423 lldb::addr_t func_low_pc,
424 DIEArray &accumulator);
425
426 size_t PopulateBlockVariableList(VariableList &variable_list,
427 const SymbolContext &sc,
428 llvm::ArrayRef<DIERef> variable_dies,
429 lldb::addr_t func_low_pc);
430
432 DIEArray &&variable_dies);
433
434 // Given a die_offset, figure out the symbol context representing that die.
435 bool ResolveFunction(const DWARFDIE &die, bool include_inlines,
436 SymbolContextList &sc_list);
437
438 /// Resolve functions and (possibly) blocks for the given file address and a
439 /// compile unit. The compile unit comes from the sc argument and it must be
440 /// set. The results of the lookup (if any) are written back to the symbol
441 /// context.
442 void ResolveFunctionAndBlock(lldb::addr_t file_vm_addr, bool lookup_block,
443 SymbolContext &sc);
444
445 Symbol *GetObjCClassSymbol(ConstString objc_class_name);
446
448 bool resolve_function_context = false);
449
450 void SetDebugMapModule(const lldb::ModuleSP &module_sp) {
451 m_debug_map_module_wp = module_sp;
452 }
453
455 FindBlockContainingSpecification(const DIERef &func_die_ref,
456 dw_offset_t spec_block_die_offset);
457
460 dw_offset_t spec_block_die_offset);
461
462 bool ClassContainsSelector(const DWARFDIE &class_die, ConstString selector);
463
464 /// Parse call site entries (DW_TAG_call_site), including any nested call site
465 /// parameters (DW_TAG_call_site_parameter).
466 std::vector<std::unique_ptr<CallEdge>>
467 CollectCallEdges(lldb::ModuleSP module, DWARFDIE function_die);
468
469 /// If this symbol file is linked to by a debug map (see
470 /// SymbolFileDWARFDebugMap), and \p file_addr is a file address relative to
471 /// an object file, adjust \p file_addr so that it is relative to the main
472 /// binary. Returns the adjusted address, or \p file_addr if no adjustment is
473 /// needed, on success and LLDB_INVALID_ADDRESS otherwise.
475
476 bool FixupAddress(Address &addr);
477
478 typedef llvm::SetVector<Type *> TypeSet;
479
480 void GetTypes(const DWARFDIE &die, dw_offset_t min_die_offset,
481 dw_offset_t max_die_offset, uint32_t type_mask,
482 TypeSet &type_set);
483
486
488
490
492 std::optional<uint32_t> GetDWARFUnitIndex(uint32_t cu_idx);
493
495
497
498 void InitializeFirstCodeAddressRecursive(const SectionList &section_list);
499
501
502 void
503 GetCompileOptions(std::unordered_map<lldb::CompUnitSP, Args> &args) override;
504
507
508 llvm::once_flag m_dwp_symfile_once_flag;
509 std::shared_ptr<SymbolFileDWARFDwo> m_dwp_symfile;
510
512
513 llvm::once_flag m_info_once_flag;
514 std::unique_ptr<DWARFDebugInfo> m_info;
515
516 std::unique_ptr<llvm::DWARFDebugAbbrev> m_abbr;
517 std::unique_ptr<GlobalVariableMap> m_global_aranges_up;
518
519 typedef std::unordered_map<lldb::offset_t, DebugMacrosSP> DebugMacrosMap;
521
523 std::unique_ptr<DWARFIndex> m_index;
526
527 typedef std::set<DIERef> DIERefSet;
528 typedef llvm::StringMap<DIERefSet> NameToOffsetMap;
530 std::unique_ptr<DWARFDebugRanges> m_ranges;
535 llvm::DenseMap<dw_offset_t, std::unique_ptr<SupportFileList>>
537 std::vector<uint32_t> m_lldb_cu_to_dwarf_unit;
538 /// DWARF does not provide a good way for traditional (concatenating) linkers
539 /// to invalidate debug info describing dead-stripped code. These linkers will
540 /// keep the debug info but resolve any addresses referring to such code as
541 /// zero (BFD) or a small positive integer (zero + relocation addend -- GOLD).
542 /// Try to filter out this debug info by comparing it to the lowest code
543 /// address in the module.
546 std::atomic_flag m_dwo_warning_issued = ATOMIC_FLAG_INIT;
547 /// If this DWARF file a .DWO file or a DWARF .o file on mac when
548 /// no dSYM file is being used, this file index will be set to a
549 /// valid value that can be used in DIERef objects which will contain
550 /// an index that identifies the .DWO or .o file.
551 std::optional<uint64_t> m_file_index;
552};
553} // namespace dwarf
554} // namespace lldb_private::plugin
555
556#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARF_H
A section + offset based address class.
Definition: Address.h:62
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:40
An data extractor class.
Definition: DataExtractor.h:48
A class to manage flag bits.
Definition: Debugger.h:80
"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:399
A class that encapsulates name lookup information.
Definition: Module.h:904
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:43
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
A list of support files for a CompileUnit.
Definition: FileSpecList.h:23
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:34
Containing protected virtual methods for child classes to override.
Definition: SymbolFile.h:496
bool isA(const void *ClassID) const override
LLVM RTTI support.
Definition: SymbolFile.h:503
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:50
virtual bool isA(const void *ClassID) const
LLVM RTTI support.
Definition: SymbolFile.h:57
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:477
A class that contains all state required for type lookups.
Definition: Type.h:100
This class tracks the state and results of a TypeQuery.
Definition: Type.h:308
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition: XcodeSDK.h:24
Identifies a DWARF debug info entry within a given Module.
Definition: DIERef.h:30
DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic o...
CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
static CompilerDeclContext GetContainingDeclContext(const DWARFDIE &die)
static bool SupportedVersion(uint16_t version)
llvm::DenseMap< lldb::opaque_compiler_type_t, DIERef > CompilerTypeToDIE
std::optional< uint32_t > GetDWARFUnitIndex(uint32_t cu_idx)
CompileUnit * GetCompUnitForDWARFCompUnit(DWARFCompileUnit &dwarf_cu)
lldb::ModuleSP GetExternalModule(ConstString name)
void FindGlobalVariables(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, VariableList &variables) override
DWARFDIE FindBlockContainingSpecification(const DIERef &func_die_ref, dw_offset_t spec_block_die_offset)
llvm::DenseMap< const DWARFDebugInfoEntry *, Type * > DIEToTypePtr
lldb::VariableSP ParseVariableDIE(const SymbolContext &sc, const DWARFDIE &die, const lldb::addr_t func_low_pc)
static DWARFASTParser * GetDWARFParser(DWARFUnit &unit)
static lldb::LanguageType GetLanguageFamily(DWARFUnit &unit)
Same as GetLanguage() but reports all C++ versions as C++ (no version).
bool ForEachExternalModule(CompileUnit &, llvm::DenseSet< SymbolFile * > &, llvm::function_ref< bool(Module &)>) override
static bool classof(const SymbolFile *obj)
std::unique_ptr< DWARFDebugInfo > m_info
bool DeclContextMatchesThisSymbolFile(const CompilerDeclContext &decl_ctx)
void GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector< ConstString > &mangled_names) override
std::map< ConstString, lldb::ModuleSP > ExternalTypeModuleMap
size_t PopulateBlockVariableList(VariableList &variable_list, const SymbolContext &sc, llvm::ArrayRef< DIERef > variable_dies, lldb::addr_t func_low_pc)
Type * ResolveType(const DWARFDIE &die, bool assert_not_being_parsed=true, bool resolve_function_context=false)
llvm::DenseMap< const DWARFDebugInfoEntry *, lldb::VariableSP > DIEToVariableSP
size_t ParseVariablesInFunctionContextRecursive(const SymbolContext &sc, const DWARFDIE &die, lldb::addr_t func_low_pc, DIEArray &accumulator)
virtual lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, ConstString type_name, bool must_be_implementation)
const std::shared_ptr< SymbolFileDWARFDwo > & GetDwpSymbolFile()
std::recursive_mutex & GetModuleMutex() const override
Symbols file subclasses should override this to return the Module that owns the TypeSystem that this ...
uint32_t ResolveSymbolContext(const SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) override
virtual DWARFCompileUnit * GetDWARFCompileUnit(CompileUnit *comp_unit)
Function * ParseFunction(CompileUnit &comp_unit, const DWARFDIE &die)
lldb::TypeSP GetTypeForDIE(const DWARFDIE &die, bool resolve_function_context=false)
virtual bool ParseVendorDWARFOpcode(uint8_t op, const DataExtractor &opcodes, lldb::offset_t &offset, std::vector< Value > &stack) const
lldb::addr_t m_first_code_address
DWARF does not provide a good way for traditional (concatenating) linkers to invalidate debug info de...
ConstString ConstructFunctionDemangledName(const DWARFDIE &die)
void SetDebugMapModule(const lldb::ModuleSP &module_sp)
DWARFUnit * GetSkeletonUnit(DWARFUnit *dwo_unit)
Given a DWO DWARFUnit, find the corresponding skeleton DWARFUnit in the main symbol file.
FileSpec GetFile(DWARFUnit &unit, size_t file_idx)
std::shared_ptr< SymbolFileDWARFDwo > m_dwp_symfile
void InitializeFirstCodeAddressRecursive(const SectionList &section_list)
std::unique_ptr< llvm::DWARFDebugAbbrev > m_abbr
DWARFUnit * GetNextUnparsedDWARFCompileUnit(DWARFUnit *prev_cu)
std::vector< CompilerContext > GetCompilerContextForUID(lldb::user_id_t uid) override
virtual void GetObjCMethods(ConstString class_name, llvm::function_ref< bool(DWARFDIE die)> callback)
virtual DWARFDIE GetDIE(const DIERef &die_ref)
std::unique_ptr< GlobalVariableMap > m_global_aranges_up
virtual lldb::offset_t GetVendorDWARFOpcodeSize(const DataExtractor &data, const lldb::offset_t data_offset, const uint8_t op) const
DWARFIndex * getIndex()
Returns the DWARFIndex for this symbol, if it exists.
uint64_t GetDebugInfoSize(bool load_all_debug_info=false) override
Metrics gathering functions.
void FindTypes(const lldb_private::TypeQuery &match, lldb_private::TypeResults &results) override
Find types using a type-matching object that contains all search parameters.
static CompilerDecl GetDecl(const DWARFDIE &die)
void ResolveFunctionAndBlock(lldb::addr_t file_vm_addr, bool lookup_block, SymbolContext &sc)
Resolve functions and (possibly) blocks for the given file address and a compile unit.
size_t ParseVariablesForContext(const SymbolContext &sc) override
std::optional< ArrayInfo > GetDynamicArrayInfoForUID(lldb::user_id_t type_uid, const ExecutionContext *exe_ctx) override
If type_uid points to an array type, return its characteristics.
size_t ParseBlocksRecursive(Function &func) override
Type * ResolveTypeUID(lldb::user_id_t type_uid) override
static lldb::LanguageType GetLanguage(DWARFUnit &unit)
llvm::DenseMap< dw_offset_t, std::unique_ptr< SupportFileList > > m_type_unit_support_files
size_t ParseFunctions(CompileUnit &comp_unit) override
bool ParseDebugMacros(CompileUnit &comp_unit) override
static SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
bool ClassContainsSelector(const DWARFDIE &class_die, ConstString selector)
bool ParseSupportFiles(CompileUnit &comp_unit, SupportFileList &support_files) override
XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
bool ParseImportedModules(const SymbolContext &sc, std::vector< SourceModule > &imported_modules) override
std::optional< uint64_t > GetDWOId()
If this is a DWARF object with a single CU, return its DW_AT_dwo_id.
void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask, TypeList &type_list) override
void ParseDeclsForContext(CompilerDeclContext decl_ctx) override
std::unordered_map< lldb::offset_t, DebugMacrosSP > DebugMacrosMap
size_t ParseTypes(CompileUnit &comp_unit) override
std::shared_ptr< SymbolFileDWARFDwo > GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die)
lldb::VariableSP ParseVariableDIECached(const SymbolContext &sc, const DWARFDIE &die)
StatsDuration::Duration GetDebugInfoIndexTime() override
Return the time it took to index the debug information in the object file.
bool CompleteType(CompilerType &compiler_type) override
bool ParseLineTable(CompileUnit &comp_unit) override
bool GetSeparateDebugInfo(StructuredData::Dictionary &d, bool errors_only) override
List separate dwo files.
bool ResolveFunction(const DWARFDIE &die, bool include_inlines, SymbolContextList &sc_list)
bool ParseIsOptimized(CompileUnit &comp_unit) override
virtual lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDIE &die)
std::vector< std::unique_ptr< 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)
std::unique_ptr< DWARFDebugRanges > m_ranges
DWARFDIE GetDeclContextDIEContainingDIE(const DWARFDIE &die)
virtual CompilerTypeToDIE & GetForwardDeclCompilerTypeToDIE()
void SetFileIndex(std::optional< uint64_t > file_index)
void InitializeObject() override
Initialize the SymbolFile object.
void ParseAndAppendGlobalVariable(const SymbolContext &sc, const DWARFDIE &die, VariableList &cc_variable_list)
static llvm::Expected< lldb::TypeSystemSP > GetTypeSystem(DWARFUnit &unit)
void FindFunctions(const Module::LookupInfo &lookup_info, const CompilerDeclContext &parent_decl_ctx, bool include_inlines, SymbolContextList &sc_list) override
static bool DIEInDeclContext(const CompilerDeclContext &parent_decl_ctx, const DWARFDIE &die, bool only_root_namespaces=false)
uint32_t ResolveSymbolContext(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) override
bool HasForwardDeclForCompilerType(const CompilerType &compiler_type)
StatsDuration::Duration GetDebugInfoParseTime() override
Return the time taken to parse the debug information.
const SymbolFileDWARF & operator=(const SymbolFileDWARF &)=delete
lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit &dwarf_cu)
CompilerDeclContext FindNamespace(ConstString name, const CompilerDeclContext &parent_decl_ctx, bool only_root_namespaces) override
Finds a namespace of name name and whose parent context is parent_decl_ctx.
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
static lldb::LanguageType LanguageTypeFromDWARF(uint64_t val)
lldb::TypeSP ParseType(const SymbolContext &sc, const DWARFDIE &die, bool *type_is_new)
static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die)
std::vector< std::unique_ptr< 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...
llvm::Expected< lldb::TypeSystemSP > GetTypeSystemForLanguage(lldb::LanguageType language) override
bool isA(const void *ClassID) const override
LLVM RTTI support.
CompilerDecl GetDeclForUID(lldb::user_id_t uid) override
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,...
lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) override
CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
static void DebuggerInitialize(Debugger &debugger)
RangeDataVector< lldb::addr_t, lldb::addr_t, Variable * > GlobalVariableMap
size_t ParseVariablesInFunctionContext(const SymbolContext &sc, const DWARFDIE &die, const lldb::addr_t func_low_pc)
const ExternalTypeModuleMap & getExternalTypeModules() const
Return the list of Clang modules imported by this SymbolFile.
SymbolFileDWARF(const SymbolFileDWARF &)=delete
bool GetFunction(const DWARFDIE &die, SymbolContext &sc)
const SupportFileList * GetTypeUnitSupportFiles(DWARFTypeUnit &tu)
llvm::StringMap< DIERefSet > NameToOffsetMap
virtual DIEToVariableSP & GetDIEToVariable()
std::optional< uint64_t > GetFileIndex() const
Symbol * GetObjCClassSymbol(ConstString objc_class_name)
static CompilerDeclContext GetDeclContext(const DWARFDIE &die)
virtual UniqueDWARFASTTypeMap & GetUniqueDWARFASTTypeMap()
virtual void LoadSectionData(lldb::SectionType sect_type, DWARFDataExtractor &data)
Status CalculateFrameVariableError(StackFrame &frame) override
Subclasses will override this function to for GetFrameVariableError().
uint64_t dw_offset_t
Definition: dwarf.h:31
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:82
#define LLDB_INVALID_OFFSET
Definition: lldb-defines.h:93
std::vector< DIERef > DIEArray
Definition: DIERef.h:135
std::shared_ptr< DebugMacros > DebugMacrosSP
Definition: DebugMacros.h:22
std::weak_ptr< lldb_private::Module > ModuleWP
Definition: lldb-forward.h:369
uint64_t offset_t
Definition: lldb-types.h:85
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
Definition: lldb-forward.h:370
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Type > TypeSP
Definition: lldb-forward.h:452
std::shared_ptr< lldb_private::Variable > VariableSP
Definition: lldb-forward.h:477
uint64_t user_id_t
Definition: lldb-types.h:82
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:368
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
Definition: lldb-forward.h:330
Definition: Debugger.h:54
A mix in class that contains a generic user ID.
Definition: UserID.h:31