Go to the documentation of this file.
9 #ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARF_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARF_H
15 #include <unordered_map>
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/SetVector.h"
20 #include "llvm/Support/Threading.h"
55 class SymbolFileDWARFDwp;
57 #define DIE_IS_BEING_PARSED ((lldb_private::Type *)1)
67 bool isA(
const void *ClassID)
const override {
68 return ClassID == &
ID || SymbolFileCommon::isA(ClassID);
124 lldb_private::FileSpecList &support_files)
override;
132 std::vector<lldb_private::SourceModule> &imported_modules)
override;
147 bool assert_not_being_parsed =
true,
148 bool resolve_function_context =
false);
162 lldb::SymbolContextItem resolve_scope,
167 lldb::SymbolContextItem resolve_scope,
182 lldb::FunctionNameType name_type_mask,
183 bool include_inlines,
187 bool include_inlines,
192 std::vector<lldb_private::ConstString> &mangled_names)
override;
198 llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
201 void FindTypes(llvm::ArrayRef<lldb_private::CompilerContext> pattern,
203 llvm::DenseSet<SymbolFile *> &searched_symbol_files,
207 lldb::TypeClass type_mask,
210 llvm::Expected<lldb_private::TypeSystem &>
242 llvm::function_ref<
bool(
DWARFDIE die)> callback);
252 typedef std::map<lldb_private::ConstString, lldb::ModuleSP>
274 std::shared_ptr<SymbolFileDWARFDwo>
278 virtual llvm::Optional<uint32_t>
GetDwoNum() {
return llvm::None; }
281 llvm::Optional<uint64_t>
GetDWOId();
287 std::vector<std::unique_ptr<lldb_private::CallEdge>>
300 static llvm::Expected<lldb_private::TypeSystem &>
332 typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *>
334 typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb::VariableSP>
374 bool parse_siblings,
bool parse_children);
377 const DWARFDIE &die,
bool *type_is_new);
380 lldb_private::FileSpecList &support_files);
383 bool assert_not_being_parsed);
408 llvm::ArrayRef<DIERef> variable_dies,
433 bool must_be_implementation);
439 bool resolve_function_context =
false);
464 std::vector<std::unique_ptr<lldb_private::CallEdge>>
476 typedef llvm::SetVector<lldb_private::Type *>
TypeSet;
531 std::unique_ptr<DWARFDebugAbbrev>
m_abbr;
534 typedef std::unordered_map<lldb::offset_t, lldb_private::DebugMacrosSP>
539 std::unique_ptr<lldb_private::DWARFIndex>
m_index;
552 llvm::DenseMap<dw_offset_t, lldb_private::FileSpecList>
566 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARF_H
lldb_private::CompileUnit * GetCompUnitForDWARFCompUnit(DWARFCompileUnit &dwarf_cu)
uint32_t CalculateNumCompileUnits() override
static bool classof(const SymbolFile *obj)
llvm::Optional< DecodedUID > DecodeUID(lldb::user_id_t uid)
DebugMacrosMap m_debug_macros_map
lldb_private::StatsDuration::Duration GetDebugInfoIndexTime() override
Return the time it took to index the debug information in the object file.
Identifies a DWARF debug info entry within a given Module.
Provides public interface for all SymbolFiles.
std::map< lldb_private::ConstString, lldb::ModuleSP > ExternalTypeModuleMap
bool GetFunction(const DWARFDIE &die, lldb_private::SymbolContext &sc)
bool DIEDeclContextsMatch(const DWARFDIE &die1, const DWARFDIE &die2)
void InitializeFirstCodeAddressRecursive(const lldb_private::SectionList §ion_list)
std::atomic_flag m_dwo_warning_issued
std::unique_ptr< DWARFDebugAbbrev > m_abbr
ExternalTypeModuleMap m_external_type_modules
lldb_private::FileSpec GetFile(DWARFUnit &unit, size_t file_idx)
llvm::Optional< DIERef > GetDIERef() const
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
lldb_private::StatsDuration m_parse_time
lldb::TypeSP ParseType(const lldb_private::SymbolContext &sc, const DWARFDIE &die, bool *type_is_new)
lldb::VariableSP ParseVariableDIE(const lldb_private::SymbolContext &sc, const DWARFDIE &die, const lldb::addr_t func_low_pc)
virtual DIEToClangType & GetForwardDeclDieToClangType()
static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die)
static llvm::StringRef GetPluginNameStatic()
void ParseAndAppendGlobalVariable(const lldb_private::SymbolContext &sc, const DWARFDIE &die, lldb_private::VariableList &cc_variable_list)
lldb_private::DWARFContext & GetDWARFContext()
static llvm::Expected< lldb_private::TypeSystem & > GetTypeSystem(DWARFUnit &unit)
lldb::LanguageType ParseLanguage(lldb_private::CompileUnit &comp_unit) override
UniqueDWARFASTTypeMap m_unique_ast_type_map
std::chrono::duration< double > Duration
std::set< DIERef > DIERefSet
llvm::once_flag m_dwp_symfile_once_flag
llvm::DenseMap< const DWARFDebugInfoEntry *, lldb::opaque_compiler_type_t > DIEToClangType
std::vector< uint32_t > m_lldb_cu_to_dwarf_unit
const lldb_private::FileSpecList & GetTypeUnitSupportFiles(DWARFTypeUnit &tu)
const ExternalTypeModuleMap & getExternalTypeModules() const
Return the list of Clang modules imported by this SymbolFile.
An abstraction for Xcode-style SDKs that works like ArchSpec.
bool ParseImportedModules(const lldb_private::SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
LanguageType
Programming language type.
Represents a generic declaration such as a function declaration.
virtual DWARFCompileUnit * GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit)
static char ID
LLVM RTTI support.
ClangTypeToDIE m_forward_decl_clang_type_to_die
DWARFDebugRanges * GetDebugRanges()
void SetDebugMapModule(const lldb::ModuleSP &module_sp)
virtual DIEToVariableSP & GetDIEToVariable()
bool isA(const void *ClassID) const override
LLVM RTTI support.
llvm::Optional< uint32_t > GetDWARFUnitIndex(uint32_t cu_idx)
lldb::user_id_t GetUID(const llvm::Optional< DIERef > &ref)
lldb_private::CompilerDeclContext FindNamespace(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx) override
bool Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu)
DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic o...
Containing protected virtual methods for child classes to override.
void InitializeFirstCodeAddress()
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.
virtual void GetObjCMethods(lldb_private::ConstString class_name, llvm::function_ref< bool(DWARFDIE die)> callback)
SymbolFileDWARFDebugMap * GetDebugMapSymfile()
void FindGlobalVariables(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, lldb_private::VariableList &variables) override
std::vector< DIERef > DIEArray
lldb::VariableSP ParseVariableDIECached(const lldb_private::SymbolContext &sc, const DWARFDIE &die)
static void DebuggerInitialize(lldb_private::Debugger &debugger)
llvm::Expected< lldb_private::TypeSystem & > GetTypeSystemForLanguage(lldb::LanguageType language) override
void GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector< lldb_private::ConstString > &mangled_names) override
lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit &dwarf_cu)
lldb_private::CompilerDecl GetDeclForUID(lldb::user_id_t uid) override
bool ClassContainsSelector(const DWARFDIE &class_die, lldb_private::ConstString selector)
lldb::addr_t m_first_code_address
DWARF does not provide a good way for traditional (concatenating) linkers to invalidate debug info de...
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
void UpdateExternalModuleListIfNeeded()
static lldb_private::SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
SymbolFileDWARF(lldb::ObjectFileSP objfile_sp, lldb_private::SectionList *dwo_section_list)
virtual ClangTypeToDIE & GetForwardDeclClangTypeToDie()
bool ResolveFunction(const DWARFDIE &die, bool include_inlines, lldb_private::SymbolContextList &sc_list)
lldb_private::StatsDuration & GetDebugInfoParseTimeRef()
std::unordered_map< lldb::offset_t, lldb_private::DebugMacrosSP > DebugMacrosMap
std::shared_ptr< SymbolFileDWARFDwo > GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die)
bool DeclContextMatchesThisSymbolFile(const lldb_private::CompilerDeclContext &decl_ctx)
GlobalVariableMap & GetGlobalAranges()
DIEToClangType m_forward_decl_die_to_clang_type
virtual void LoadSectionData(lldb::SectionType sect_type, lldb_private::DWARFDataExtractor &data)
static lldb::LanguageType GetLanguageFamily(DWARFUnit &unit)
Same as GetLanguage() but reports all C++ versions as C++ (no version).
DWARFDIE FindBlockContainingSpecification(const DIERef &func_die_ref, dw_offset_t spec_block_die_offset)
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.
std::shared_ptr< DebugMacros > DebugMacrosSP
std::recursive_mutex & GetModuleMutex() const override
Symbols file subclasses should override this to return the Module that owns the TypeSystem that this ...
virtual lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext &die_decl_ctx)
static DWARFDeclContext GetDWARFDeclContext(const DWARFDIE &die)
llvm::DenseMap< const DWARFDebugInfoEntry *, lldb_private::Type * > DIEToTypePtr
virtual DIEToTypePtr & GetDIEToType()
const std::shared_ptr< SymbolFileDWARFDwo > & GetDwpSymbolFile()
SymbolFileDWARFDebugMap * m_debug_map_symfile
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
void Dump(lldb_private::Stream &s) override
static bool SupportedVersion(uint16_t version)
static bool DIEInDeclContext(const lldb_private::CompilerDeclContext &parent_decl_ctx, const DWARFDIE &die)
lldb::TypeSP GetTypeForDIE(const DWARFDIE &die, bool resolve_function_context=false)
std::shared_ptr< SymbolFileDWARFDwo > m_dwp_symfile
llvm::DenseMap< lldb::opaque_compiler_type_t, DIERef > ClangTypeToDIE
lldb_private::CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
llvm::StringMap< DIERefSet > NameToOffsetMap
string(SUBSTRING ${p} 10 -1 pStripped) if($
lldb::ModuleSP GetExternalModule(lldb_private::ConstString name)
lldb_private::Symbol * GetObjCClassSymbol(lldb_private::ConstString objc_class_name)
DWARFUnit * GetNextUnparsedDWARFCompileUnit(DWARFUnit *prev_cu)
lldb_private::XcodeSDK ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
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...
static DWARFASTParser * GetDWARFParser(DWARFUnit &unit)
Represents a generic declaration context in a program.
llvm::once_flag m_info_once_flag
size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override
NameToOffsetMap m_function_scope_qualified_name_map
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override
DIEArray MergeBlockAbstractParameters(const DWARFDIE &block_die, DIEArray &&variable_dies)
llvm::SetVector< lldb_private::Type * > TypeSet
lldb_private::DWARFContext m_context
lldb_private::Type * ResolveType(const DWARFDIE &die, bool assert_not_being_parsed=true, bool resolve_function_context=false)
bool CompleteType(lldb_private::CompilerType &compiler_type) override
llvm::DenseMap< const DWARFDebugInfoEntry *, lldb::VariableSP > DIEToVariableSP
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...
std::unique_ptr< lldb_private::DWARFIndex > m_index
static lldb_private::CompilerDecl GetDecl(const DWARFDIE &die)
static lldb::LanguageType LanguageTypeFromDWARF(uint64_t val)
lldb_private::Function * ParseFunction(lldb_private::CompileUnit &comp_unit, const DWARFDIE &die)
static lldb::LanguageType GetLanguage(DWARFUnit &unit)
std::unique_ptr< GlobalVariableMap > m_global_aranges_up
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
llvm::StringRef GetPluginName() override
static llvm::StringRef GetPluginDescriptionStatic()
lldb_private::TypeList & GetTypeList() override
bool m_fetched_external_modules
const SymbolFileDWARF & operator=(const SymbolFileDWARF &)=delete
lldb::ModuleWP m_debug_map_module_wp
std::unique_ptr< DWARFDebugRanges > m_ranges
static lldb_private::CompilerDeclContext GetDeclContext(const DWARFDIE &die)
void InitializeObject() override
Initialize the SymbolFile object.
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type
static lldb_private::CompilerDeclContext GetContainingDeclContext(const DWARFDIE &die)
llvm::DenseMap< dw_offset_t, lldb_private::FileSpecList > m_type_unit_support_files
std::unique_ptr< DWARFDebugInfo > m_info
void ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override
DWARFDebugInfo & DebugInfo()
#define LLDB_INVALID_ADDRESS
Generic representation of a type in a programming language.
DIEToVariableSP m_die_to_variable_sp
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
DIEToTypePtr m_die_to_type
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
virtual lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, lldb_private::ConstString type_name, bool must_be_implementation)
size_t ParseBlocksRecursive(lldb_private::Function &func) override
virtual UniqueDWARFASTTypeMap & GetUniqueDWARFASTTypeMap()
DWARFDebugAbbrev * DebugAbbrev()
size_t PopulateBlockVariableList(lldb_private::VariableList &variable_list, const lldb_private::SymbolContext &sc, llvm::ArrayRef< DIERef > variable_dies, lldb::addr_t func_low_pc)
virtual llvm::Optional< uint32_t > GetDwoNum()
llvm::Optional< uint64_t > GetDWOId()
If this is a DWARF object with a single CU, return its DW_AT_dwo_id.
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
void PreloadSymbols() override
lldb_private::CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
lldb_private::StatsDuration::Duration GetDebugInfoParseTime() override
Return the time taken to parse the debug information.
lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, lldb_private::Variable * > GlobalVariableMap
size_t ParseVariablesInFunctionContextRecursive(const lldb_private::SymbolContext &sc, const DWARFDIE &die, lldb::addr_t func_low_pc, DIEArray &accumulator)
UserID(lldb::user_id_t uid=LLDB_INVALID_UID)
Construct with optional user ID.
virtual DWARFDIE GetDIE(const DIERef &die_ref)
~SymbolFileDWARF() override
size_t ParseVariablesInFunctionContext(const lldb_private::SymbolContext &sc, const DWARFDIE &die, const lldb::addr_t func_low_pc)
DWARFDIE GetDeclContextDIEContainingDIE(const DWARFDIE &die)
bool HasForwardDeclForClangType(const lldb_private::CompilerType &compiler_type)
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(UserID func_id) override
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
void * opaque_compiler_type_t
void DumpClangAST(lldb_private::Stream &s) override
bool ClassOrStructIsVirtual(const DWARFDIE &die)
void BuildCuTranslationTable()
uint32_t CalculateAbilities() override
lldb::user_id_t GetUID(const DWARFBaseDIE &die)