9#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDEBUGMAP_H
10#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDEBUGMAP_H
15#include "llvm/Support/Chrono.h"
30class DWARFCompileUnit;
31class DWARFDebugAranges;
32class DWARFDeclContext;
41 bool isA(
const void *ClassID)
const override {
68 llvm::SmallSet<lldb::LanguageType, 4>
75 llvm::function_ref<
bool(
Module &)>)
override;
86 std::vector<SourceModule> &imported_modules)
override;
91 std::optional<ArrayInfo>
97 std::vector<CompilerContext>
103 lldb::SymbolContextItem resolve_scope,
106 lldb::SymbolContextItem resolve_scope,
113 uint32_t max_matches,
126 bool only_root_namespaces)
override;
129 std::vector<std::unique_ptr<CallEdge>>
136 bool errors_only)
override;
151 friend class ::DWARFASTParserClang;
218 std::vector<CompileUnitInfo *> &cu_infos);
242 oso_idx < num_oso_idxs; ++oso_idx) {
251 uint32_t *oso_idx_ptr);
254 uint32_t *oso_idx_ptr);
258 const CompileUnitInfo *comp_unit_info);
261 const CompileUnitInfo *comp_unit_info);
266 const std::vector<uint32_t> &name_symbol_indexes,
287 llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef> &
331 llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef>
A section + offset based address class.
A class that describes a compilation unit.
Represents a generic declaration context in a program.
Generic representation of a type in a programming language.
A uniqued constant string class.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A class that describes a function.
A collection class for Module objects.
A class that encapsulates name lookup information.
A class that describes an executable image and its associated object and symbol files.
A plug-in interface definition class for object file parsers.
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
This base class provides an interface to stack frames.
A stream class that can stream formatted output to a file.
A list of support files for a CompileUnit.
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.
Containing protected virtual methods for child classes to override.
bool isA(const void *ClassID) const override
LLVM RTTI support.
Provides public interface for all SymbolFiles.
virtual bool isA(const void *ClassID) const
LLVM RTTI support.
std::unordered_map< lldb::CompUnitSP, Args > GetCompileOptions()
Returns a map of compilation unit to the compile option arguments associated with that compilation un...
A class that contains all state required for type lookups.
This class tracks the state and results of a TypeQuery.
An abstraction for Xcode-style SDKs that works like ArchSpec.
Identifies a DWARF debug info entry within a given Module.
std::optional< uint32_t > file_index() const
void SetOSOFileAddress(lldb::addr_t oso_file_addr)
OSOEntry(uint32_t exe_sym_idx, lldb::addr_t oso_file_addr)
bool operator<(const OSOEntry &rhs) const
lldb::addr_t m_oso_file_addr
uint32_t GetExeSymbolIndex() const
lldb::addr_t GetOSOFileAddress() const
SymbolFileDWARF * GetSymbolFileByOSOIndex(uint32_t oso_idx)
static SymbolFileDWARF * GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file)
static llvm::StringRef GetPluginDescriptionStatic()
RangeDataVector< lldb::addr_t, lldb::addr_t, lldb::addr_t > FileRangeMap
Status CalculateFrameVariableError(StackFrame &frame) override
Subclasses will override this function to for GetFrameVariableError().
CompileUnitInfo * GetCompUnitInfo(const SymbolContext &sc)
ObjectFile * GetObjectFileByOSOIndex(uint32_t oso_idx)
std::map< std::pair< ConstString, llvm::sys::TimePoint<> >, OSOInfoSP > m_oso_map
CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
void ParseDeclsForContext(CompilerDeclContext decl_ctx) override
void FindGlobalVariables(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, VariableList &variables) override
bool ParseDebugMacros(CompileUnit &comp_unit) override
SymbolFileDWARF * GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
lldb::CompUnitSP GetCompileUnit(SymbolFileDWARF *oso_dwarf, DWARFCompileUnit &dwarf_cu)
Returns the compile unit associated with the dwarf compile unit.
llvm::DenseMap< lldb::opaque_compiler_type_t, DIERef > & GetForwardDeclCompilerTypeToDIE()
bool ForEachExternalModule(CompileUnit &, llvm::DenseSet< SymbolFile * > &, llvm::function_ref< bool(Module &)>) override
uint32_t ResolveSymbolContext(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) override
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, ConstString type_name, bool must_be_implementation)
CompileUnitInfo * GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx, uint32_t *oso_idx_ptr)
bool GetSeparateDebugInfo(StructuredData::Dictionary &d, bool errors_only) override
List separate oso files.
bool CompleteType(CompilerType &compiler_type) override
bool ParseLineTable(CompileUnit &comp_unit) override
ModuleList GetDebugInfoModules() override
Get the additional modules that this symbol file uses to parse debug info.
bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso)
RangeDataVector< lldb::addr_t, lldb::addr_t, OSOEntry > DebugMap
void ForEachSymbolFile(std::function< IterationAction(SymbolFileDWARF *)> closure)
If closure returns IterationAction::Continue, iteration continues.
std::vector< uint32_t > m_glob_indexes
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
This function actually returns the first compile unit the object file at the given index contains.
std::shared_ptr< OSOInfo > OSOInfoSP
bool isA(const void *ClassID) const override
LLVM RTTI support.
llvm::StringRef GetPluginName() override
std::vector< CompilerContext > GetCompilerContextForUID(lldb::user_id_t uid) override
lldb::addr_t LinkOSOFileAddress(SymbolFileDWARF *oso_symfile, lldb::addr_t oso_file_addr)
Convert a .o file "file address" to an executable "file address".
SymbolFileDWARF * GetSymbolFile(const SymbolContext &sc)
bool ParseIsOptimized(CompileUnit &comp_unit) override
void PrivateFindGlobalVariables(ConstString name, const CompilerDeclContext &parent_decl_ctx, const std::vector< uint32_t > &name_symbol_indexes, uint32_t max_matches, VariableList &variables)
void FindTypes(const lldb_private::TypeQuery &match, lldb_private::TypeResults &results) override
Find types using a type-matching object that contains all search parameters.
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.
CompileUnitInfo * GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf)
size_t ParseBlocksRecursive(Function &func) override
bool GetFileSpecForSO(uint32_t oso_idx, FileSpec &file_spec)
ObjectFile * GetObjectFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
static SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
UniqueDWARFASTTypeMap m_unique_ast_type_map
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.
std::vector< std::unique_ptr< CallEdge > > ParseCallEdgesInFunction(UserID func_id) override
lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) override
static llvm::StringRef GetPluginNameStatic()
size_t ParseVariablesForContext(const SymbolContext &sc) override
void DumpClangAST(Stream &s) override
llvm::SmallSet< lldb::LanguageType, 4 > ParseAllLanguages(CompileUnit &comp_unit) override
This function exists because SymbolFileDWARFDebugMap may extra compile units which aren't exposed as ...
uint32_t ResolveSymbolContext(const SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) override
static char ID
LLVM RTTI support.
Module * GetModuleByOSOIndex(uint32_t oso_idx)
uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info)
static bool classof(const SymbolFile *obj)
Module * GetModuleByCompUnitInfo(CompileUnitInfo *comp_unit_info)
size_t ParseFunctions(CompileUnit &comp_unit) override
XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data, DWARFDebugAranges *debug_aranges)
~SymbolFileDWARFDebugMap() override
uint32_t CalculateAbilities() override
static uint32_t GetOSOIndexFromUserID(lldb::user_id_t uid)
void FindFunctions(const Module::LookupInfo &lookup_info, const CompilerDeclContext &parent_decl_ctx, bool include_inlines, SymbolContextList &sc_list) override
void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask, TypeList &type_list) override
bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr, lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr, lldb::addr_t oso_byte_size)
bool ParseSupportFiles(CompileUnit &comp_unit, SupportFileList &support_files) override
void SetCompileUnit(SymbolFileDWARF *oso_dwarf, const lldb::CompUnitSP &cu_sp)
Type * ResolveTypeUID(lldb::user_id_t type_uid) override
static int SymbolContainsSymbolWithID(lldb::user_id_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
static int SymbolContainsSymbolWithIndex(uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
uint32_t CalculateNumCompileUnits() override
This function actually returns the number of object files, which may be less than the actual number o...
void FinalizeOSOFileRanges(CompileUnitInfo *cu_info)
bool ParseImportedModules(const SymbolContext &sc, std::vector< SourceModule > &imported_modules) override
std::vector< uint32_t > m_func_indexes
std::bitset< kNumFlags > m_flags
size_t ParseTypes(CompileUnit &comp_unit) override
size_t GetCompUnitInfosForModule(const Module *oso_module, std::vector< CompileUnitInfo * > &cu_infos)
bool LinkOSOAddress(Address &addr)
Convert addr from a .o file address, to an executable address.
UniqueDWARFASTTypeMap & GetUniqueDWARFASTTypeMap()
llvm::DenseMap< lldb::opaque_compiler_type_t, DIERef > m_forward_decl_compiler_type_to_die
void InitializeObject() override
Initialize the SymbolFile object.
CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
CompileUnitInfo * GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id, uint32_t *oso_idx_ptr)
std::vector< CompileUnitInfo > m_compile_unit_infos
LineTable * LinkOSOLineTable(SymbolFileDWARF *oso_symfile, LineTable *line_table)
Given a line table full of lines with "file addresses" that are for a .o file represented by oso_symf...
LazyBool m_supports_DW_AT_APPLE_objc_complete_type
DWARFDIE FindDefinitionDIE(const DWARFDIE &die)
#define LLDB_INVALID_ADDRESS
IterationAction
Useful for callbacks whose return type indicates whether to continue iteration or short-circuit.
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Type > TypeSP
std::shared_ptr< lldb_private::Module > ModuleSP
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
A mix in class that contains a generic user ID.
CompileUnitInfo()=default
uint32_t first_symbol_index
const FileRangeMap & GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile)
uint32_t last_symbol_index
bool file_range_map_valid
llvm::SmallVector< lldb::CompUnitSP, 2 > compile_units_sps
The compile units that an object file contains.
llvm::SmallDenseMap< uint64_t, uint64_t, 2 > id_to_index_map
A map from the compile unit ID to its index in the vector.
llvm::sys::TimePoint oso_mod_time
FileRangeMap file_range_map