25#if defined(DEBUG_OSO_DMAP)
35#include "llvm/Support/ScopedPrinter.h"
73 "%p: SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap ('%s')",
74 static_cast<void *
>(
this),
77 std::vector<SymbolFileDWARFDebugMap::CompileUnitInfo *> cu_infos;
79 for (
auto comp_unit_info : cu_infos) {
81 ModuleSP oso_module_sp(oso_objfile->
GetModule());
90 assert(comp_unit_info->first_symbol_index !=
UINT32_MAX);
92 const uint32_t oso_end_idx = comp_unit_info->last_symbol_index + 1;
93 for (
uint32_t idx = comp_unit_info->first_symbol_index +
95 idx < oso_end_idx; ++idx) {
101 switch (exe_symbol->
GetType()) {
117 exe_symbol->
GetMangled().GetName(Mangled::ePreferMangled),
119 if (oso_fun_symbol) {
147 exe_symbol->
GetMangled().GetName(Mangled::ePreferMangled),
149 if (exe_symbol && oso_gsym_symbol && exe_symbol->
ValueIsAddress() &&
175 const ConstString *object_name, off_t object_offset,
176 const llvm::sys::TimePoint<> object_mod_time)
177 :
Module(file_spec, arch, object_name, object_offset, object_mod_time),
178 m_exe_module_wp(exe_module_sp), m_cu_idx(cu_idx) {}
186 if (m_symfile_up.get() || !can_create)
187 return m_symfile_up ? m_symfile_up->GetSymbolFile() :
nullptr;
189 ModuleSP exe_module_sp(m_exe_module_wp.lock());
194 std::lock_guard<std::recursive_mutex> guard(m_mutex);
206 ObjectFile *exe_objfile = exe_module_sp->GetObjectFile();
207 SymbolFile *exe_symfile = exe_module_sp->GetSymbolFile();
209 if (exe_objfile && exe_symfile) {
238 return "DWARF and DWARF3 debug symbol file reader (debug map).";
292 std::vector<uint32_t> oso_indexes;
300 const uint32_t k_oso_symbol_flags_value = 0x660001u;
306 if (oso_index_count > 0) {
337 for (
uint32_t i = 0; i < oso_index_count; ++i) {
338 const uint32_t so_idx = oso_indexes[i] - 1;
339 const uint32_t oso_idx = oso_indexes[i];
342 if (so_symbol && oso_symbol &&
355 "N_SO in symbol with UID {0} has invalid sibling in debug "
357 "please file a bug and attach the binary listed in this error",
366 LLDB_LOGF(log,
"Initialized OSO 0x%8.8x: file=%s", i,
370 if (oso_symbol ==
nullptr)
372 "N_OSO symbol[{0}] can't be found, please file a bug and "
374 "the binary listed in this error",
376 else if (so_symbol ==
nullptr)
378 "N_SO not found for N_OSO symbol[{0}], please file a bug and "
379 "attach the binary listed in this error",
383 "N_SO has incorrect symbol type ({0}) for N_OSO "
385 "please file a bug and attach the binary listed in this error",
386 so_symbol->
GetType(), oso_idx);
389 "N_OSO has incorrect symbol type ({0}) for N_OSO "
391 "please file a bug and attach the binary listed in this error",
392 oso_symbol->
GetType(), oso_idx);
401 if (oso_idx < cu_count)
408 if (!comp_unit_info->
oso_sp) {
412 comp_unit_info->
oso_sp = pos->second;
415 comp_unit_info->
oso_sp = std::make_shared<OSOInfo>();
424 auto oso_mod_time = std::chrono::time_point_cast<std::chrono::seconds>(
429 if (comp_unit_info->
oso_mod_time != llvm::sys::TimePoint<>() &&
432 "debug map object file \"%s\" changed (actual: 0x%8.8x, debug "
433 "map: 0x%8.8x) since this executable was linked, debug info "
434 "will not be loaded", oso_file.
GetPath().c_str(),
435 (
uint32_t)llvm::sys::toTimeT(oso_mod_time),
443 const bool must_exist =
true;
446 oso_object, must_exist)) {
448 "debug map object file \"%s\" containing debug info does not "
449 "exist, debug info will not be loaded",
469 comp_unit_info->
oso_sp->module_sp = std::make_shared<DebugMapModule>(
471 oso_arch, oso_object ? &oso_object :
nullptr, 0,
472 oso_object ? comp_unit_info->
oso_mod_time : llvm::sys::TimePoint<>());
474 if (!comp_unit_info->
oso_sp->module_sp || !comp_unit_info->
oso_sp->module_sp->GetObjectFile()) {
480 "\"%s\" object from the \"%s\" archive: "
481 "either the .o file doesn't exist in the archive or the "
482 "modification time (0x%8.8x) of the .o file doesn't match",
489 if (comp_unit_info->
oso_sp)
490 return comp_unit_info->
oso_sp->module_sp.get();
538 if (first_comp_unit_info <= comp_unit_info &&
539 comp_unit_info <= last_comp_unit_info)
540 return comp_unit_info - first_comp_unit_info;
575 if (oso_index_count > 0) {
593 CompUnitSP comp_unit_sp;
596 if (cu_idx < cu_count) {
605 cu_info.compile_units_sps.push_back(
606 std::make_shared<CompileUnit>(
607 m_objfile_sp->GetModule(),
nullptr, so_file_spec, cu_id,
609 cu_info.id_to_index_map.insert({0, 0});
614 auto num_dwarf_units = oso_symfile->DebugInfo().GetNumUnits();
615 for (
size_t i = 0; i < num_dwarf_units; ++i) {
616 auto *dwarf_unit = oso_symfile->DebugInfo().GetUnitAtIndex(i);
617 if (
auto *dwarf_cu = llvm::dyn_cast<DWARFCompileUnit>(dwarf_unit)) {
619 if (dwarf_cu->GetID() == 0)
621 cu_info.compile_units_sps.push_back(std::make_shared<CompileUnit>(
624 cu_info.id_to_index_map.insert(
625 {dwarf_cu->GetID(), cu_info.compile_units_sps.size() - 1});
631 if (!cu_info.compile_units_sps.empty())
632 comp_unit_sp = cu_info.compile_units_sps[0];
646 for (
uint32_t i = 0; i < cu_count; ++i) {
649 auto it = id_to_index_map.find(comp_unit.
GetID());
650 if (it != id_to_index_map.end() &&
660 std::vector<CompileUnitInfo *> &cu_infos) {
662 for (
uint32_t i = 0; i < cu_count; ++i) {
666 return cu_infos.size();
686llvm::SmallSet<lldb::LanguageType, 4>
689 llvm::SmallSet<lldb::LanguageType, 4> langs;
691 for (
auto &comp_unit : info->compile_units_sps) {
723 llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files,
724 llvm::function_ref<
bool(
Module &)> f) {
733 FileSpecList &support_files) {
750 const SymbolContext &sc, std::vector<SourceModule> &imported_modules) {
796std::optional<SymbolFile::ArrayInfo>
807 bool success =
false;
811 oso_dwarf->CompleteType(compiler_type);
823 SymbolContextItem resolve_scope,
833 if (debug_map_entry) {
836 symtab->
SymbolAtIndex(debug_map_entry->data.GetExeSymbolIndex());
838 if (sc.
symbol !=
nullptr) {
839 resolved_flags |= eSymbolContextSymbol;
842 CompileUnitInfo *comp_unit_info =
844 if (comp_unit_info) {
845 comp_unit_info->GetFileRangeMap(
this);
849 exe_file_addr - debug_map_entry->GetRangeBase() +
850 debug_map_entry->data.GetOSOFileAddress();
855 oso_so_addr, resolve_scope, sc);
862 return resolved_flags;
872 for (
uint32_t i = 0; i < cu_count; ++i) {
890 return sc_list.
GetSize() - initial;
895 const std::vector<uint32_t>
898 const size_t match_count = indexes.size();
899 for (
size_t i = 0; i < match_count; ++i) {
903 if (comp_unit_info) {
908 if (variables.
GetSize() > max_matches)
926 if (oso_matches > 0) {
927 total_matches += oso_matches;
934 if (max_matches >= total_matches)
939 max_matches -= oso_matches;
956 if (oso_matches > 0) {
957 total_matches += oso_matches;
964 if (max_matches >= total_matches)
969 max_matches -= oso_matches;
978 const uint32_t symbol_idx = *symbol_idx_ptr;
980 if (symbol_idx < comp_unit_info->first_symbol_index)
983 if (symbol_idx <= comp_unit_info->last_symbol_index)
991 const user_id_t symbol_id = *symbol_idx_ptr;
993 if (symbol_id < comp_unit_info->first_symbol_id)
996 if (symbol_id <= comp_unit_info->last_symbol_id)
1007 if (oso_index_count) {
1015 if (comp_unit_info !=
nullptr)
1020 return comp_unit_info;
1028 if (oso_index_count) {
1036 if (comp_unit_info !=
nullptr)
1041 return comp_unit_info;
1054 while (i < sc_list.
GetSize()) {
1058 const SectionSP section_sp(
1060 if (section_sp->GetModule() != module_sp) {
1079 oso_dwarf->
FindFunctions(lookup_info, parent_decl_ctx, include_inlines,
1082 RemoveFunctionsWithModuleNotEqualTo(m_objfile_sp->GetModule(), sc_list,
1090 bool include_inlines,
1094 regex.
GetText().str().c_str());
1101 RemoveFunctionsWithModuleNotEqualTo(m_objfile_sp->GetModule(), sc_list,
1109 lldb::TypeClass type_mask,
1124 oso_dwarf->
GetTypes(sc_scope, type_mask, type_list);
1128 oso_dwarf->
GetTypes(sc_scope, type_mask, type_list);
1134std::vector<std::unique_ptr<lldb_private::CallEdge>>
1149 return ((
bool)type_sp);
1159 if (skip_dwarf_oso != oso_dwarf &&
1161 m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
1172 bool must_be_implementation) {
1182 if (module_objfile) {
1188 if (objc_class_symbol) {
1191 const Symbol *source_file_symbol = symtab->
GetParent(objc_class_symbol);
1193 if (source_file_symbol &&
1195 const uint32_t source_file_symbol_idx =
1201 if (compile_unit_info) {
1205 die, type_name, must_be_implementation));
1220 if (!must_be_implementation) {
1225 die, type_name, must_be_implementation);
1226 return (
bool)type_sp;
1237 llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
1241 oso_dwarf->
FindTypes(name, parent_decl_ctx, max_matches,
1242 searched_symbol_files, types);
1243 return types.
GetSize() >= max_matches;
1248 llvm::ArrayRef<CompilerContext> context,
LanguageSet languages,
1249 llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
1253 oso_dwarf->
FindTypes(context, languages, searched_symbol_files, types);
1265 matching_namespace = oso_dwarf->
FindNamespace(name, parent_decl_ctx);
1267 return (
bool)matching_namespace;
1270 return matching_namespace;
1287 for (
uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1290 if (oso_symfile == oso_dwarf) {
1295 auto it = id_to_index_map.find(dwarf_cu.
GetID());
1296 if (it != id_to_index_map.end())
1298 .compile_units_sps[it->getSecond()];
1302 llvm_unreachable(
"this shouldn't happen");
1309 for (
uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1312 if (oso_symfile == oso_dwarf) {
1321 const CompUnitSP &cu_sp) {
1324 for (
uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1327 if (oso_symfile == oso_dwarf) {
1332 assert(cu_sp->GetID() == 0 &&
1333 "Setting first compile unit but with id different than 0!");
1335 compile_units_sps.push_back(cu_sp);
1337 {cu_sp->GetID(), compile_units_sps.size() - 1});
1382 debug_map_entry->
data.SetOSOFileAddress(oso_file_addr);
1383 addr_t range_size = std::min<addr_t>(exe_byte_size, oso_byte_size);
1384 if (range_size == 0) {
1385 range_size = std::max<addr_t>(exe_byte_size, oso_byte_size);
1386 if (range_size == 0)
1398#if defined(DEBUG_OSO_DMAP)
1400 const size_t n = oso_file_range_map.
GetSize();
1401 printf(
"SymbolFileDWARFDebugMap::FinalizeOSOFileRanges (cu_info = %p) %s\n",
1402 cu_info, cu_info->
oso_sp->module_sp->GetFileSpec().GetPath().c_str());
1403 for (
size_t i = 0; i < n; ++i) {
1405 printf(
"oso [0x%16.16" PRIx64
" - 0x%16.16" PRIx64
1406 ") ==> exe [0x%16.16" PRIx64
" - 0x%16.16" PRIx64
")\n",
1420 if (oso_range_entry) {
1423 if (debug_map_entry) {
1428 return exe_file_addr;
1439 if (addr_module == exe_module)
1448 if (oso_range_entry) {
1451 if (debug_map_entry) {
1474 size_t num_line_entries_added = 0;
1475 if (debug_aranges && dwarf2Data) {
1477 if (compile_unit_info) {
1480 for (
size_t idx = 0; idx < file_range_map.
GetSize(); idx++) {
1486 num_line_entries_added++;
1491 return num_line_entries_added;
1499 ModuleSP module_sp = oso_objfile->
GetModule();
1501 oso_modules.
Append(module_sp);
1520 if (debug_map_entry) {
1527 if (comp_unit_info) {
1542 return Status(
"unable to load debug map object file \"%s\" "
1543 "exist, debug info will not be loaded",
#define LLDB_LOGF(log,...)
static void RemoveFunctionsWithModuleNotEqualTo(const ModuleSP &module_sp, SymbolContextList &sc_list, uint32_t start_idx)
#define LLDB_SCOPED_TIMER()
#define LLDB_SCOPED_TIMERF(...)
void AppendRange(dw_offset_t cu_offset, dw_addr_t low_pc, dw_addr_t high_pc)
SymbolFile * GetSymbolFile(bool can_create=true, lldb_private::Stream *feedback_strm=nullptr) override
Get the module's symbol file.
~DebugMapModule() override=default
DebugMapModule(const ModuleSP &exe_module_sp, uint32_t cu_idx, const FileSpec &file_spec, const ArchSpec &arch, const ConstString *object_name, off_t object_offset, const llvm::sys::TimePoint<> object_mod_time)
std::vector< uint32_t > m_func_indexes
SymbolFileDWARF * GetSymbolFileByOSOIndex(uint32_t oso_idx)
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
static SymbolFileDWARF * GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file)
static llvm::StringRef GetPluginDescriptionStatic()
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, lldb_private::ConstString type_name, bool must_be_implementation)
lldb_private::ObjectFile * GetObjectFileByOSOIndex(uint32_t oso_idx)
std::map< std::pair< lldb_private::ConstString, llvm::sys::TimePoint<> >, OSOInfoSP > m_oso_map
lldb_private::CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
void DumpClangAST(lldb_private::Stream &s) override
lldb::LanguageType ParseLanguage(lldb_private::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.
lldb_private::Status CalculateFrameVariableError(lldb_private::StackFrame &frame) override
Subclasses will override this function to for GetFrameVariableError().
CompileUnitInfo * GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx, uint32_t *oso_idx_ptr)
lldb_private::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)
llvm::SmallSet< lldb::LanguageType, 4 > ParseAllLanguages(lldb_private::CompileUnit &comp_unit) override
This function exists because SymbolFileDWARFDebugMap may extra compile units which aren't exposed as ...
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
This function actually returns the first compile unit the object file at the given index contains.
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override
CompileUnitInfo * GetCompUnitInfo(const lldb_private::SymbolContext &sc)
size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) 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".
void FindGlobalVariables(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, lldb_private::VariableList &variables) override
lldb_private::LineTable * LinkOSOLineTable(SymbolFileDWARF *oso_symfile, lldb_private::LineTable *line_table)
Given a line table full of lines with "file addresses" that are for a .o file represented by oso_symf...
CompileUnitInfo * GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf)
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
void PrivateFindGlobalVariables(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, const std::vector< uint32_t > &name_symbol_indexes, uint32_t max_matches, lldb_private::VariableList &variables)
lldb_private::ObjectFile * GetObjectFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
bool ParseImportedModules(const lldb_private::SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
static lldb_private::SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
bool CompleteType(lldb_private::CompilerType &compiler_type) override
size_t ParseBlocksRecursive(lldb_private::Function &func) override
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
static char ID
LLVM RTTI support.
lldb_private::XcodeSDK ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
std::bitset< kNumFlags > m_flags
lldb_private::CompilerDeclContext FindNamespace(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx) override
lldb_private::Module * GetModuleByOSOIndex(uint32_t oso_idx)
static uint32_t GetOSOIndexFromUserID(lldb::user_id_t uid)
uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info)
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
lldb_private::Module * GetModuleByCompUnitInfo(CompileUnitInfo *comp_unit_info)
size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data, DWARFDebugAranges *debug_aranges)
~SymbolFileDWARFDebugMap() override
uint32_t CalculateAbilities() override
SymbolFileDWARFDebugMap(lldb::ObjectFileSP objfile_sp)
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.
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)
void SetCompileUnit(SymbolFileDWARF *oso_dwarf, const lldb::CompUnitSP &cu_sp)
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
std::vector< CompileUnitInfo > m_compile_unit_infos
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)
SymbolFileDWARF * GetSymbolFile(const lldb_private::SymbolContext &sc)
lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDIE &die)
static llvm::StringRef GetPluginNameStatic()
void InitializeObject() override
Initialize the SymbolFile object.
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(lldb_private::UserID func_id) override
void ForEachSymbolFile(std::function< bool(SymbolFileDWARF *)> closure)
std::vector< uint32_t > m_glob_indexes
bool LinkOSOAddress(lldb_private::Address &addr)
Convert addr from a .o file address, to an executable address.
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type
void ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override
size_t GetCompUnitInfosForModule(const lldb_private::Module *oso_module, std::vector< CompileUnitInfo * > &cu_infos)
lldb_private::CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
CompileUnitInfo * GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id, uint32_t *oso_idx_ptr)
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
uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
bool GetFileSpecForSO(uint32_t oso_idx, lldb_private::FileSpec &file_spec)
lldb_private::CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
virtual lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, lldb_private::ConstString type_name, bool must_be_implementation)
size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override
bool HasForwardDeclForClangType(const lldb_private::CompilerType &compiler_type)
bool Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu)
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
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
uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
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
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
std::optional< uint64_t > GetFileIndex() const
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
void SetFileIndex(std::optional< uint64_t > file_index)
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
static llvm::StringRef GetPluginNameStatic()
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
void FindGlobalVariables(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, lldb_private::VariableList &variables) override
lldb_private::XcodeSDK ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
virtual lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDIE &die)
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(lldb_private::UserID func_id) override
void DumpClangAST(lldb_private::Stream &s) override
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
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)
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
void ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override
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
Address & GetBaseAddress()
Get accessor for the base address of the range.
A section + offset based address class.
lldb::SectionSP GetSection() const
Get const accessor for the section.
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
lldb::addr_t GetFileAddress() const
Get the file address.
An architecture specification class.
bool SetTriple(const llvm::Triple &triple)
Architecture triple setter.
A class that describes a compilation unit.
lldb::LanguageType GetLanguage()
Represents a generic declaration context in a program.
Generic representation of a type in a programming language.
A uniqued constant string class.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
const char * GetCString() const
Get the string value as a C string.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
static bool Match(const FileSpec &pattern, const FileSpec &file)
Match FileSpec pattern against FileSpec file.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
static FileSystem & Instance()
A class that describes a function.
const AddressRange & GetAddressRange()
CompileUnit * GetCompileUnit()
Get accessor for the compile unit that owns this function.
LineTable * LinkLineTable(const FileRangeMap &file_range_map)
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
A collection class for Module objects.
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
A class that encapsulates name lookup information.
ConstString GetLookupName() const
A class that describes an executable image and its associated object and symbol files.
virtual ObjectFile * GetObjectFile()
Get the object file representation for the current architecture.
virtual SymbolFile * GetSymbolFile(bool can_create=true, Stream *feedback_strm=nullptr)
Get the module's symbol file.
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr)
std::string GetSpecificationDescription() const
Get the module path and object name.
A plug-in interface definition class for object file parsers.
Symtab * GetSymtab()
Gets the symbol table for the currently selected architecture (and object for archives).
@ eTypeExecutable
A normal executable.
@ eTypeDebugInfo
An object file that contains only debug information.
@ eTypeStubLibrary
A library that can be linked against but not used for execution.
@ eTypeObjectFile
An intermediate object file.
@ eTypeDynamicLinker
The platform's dynamic linker executable.
@ eTypeCoreFile
A core file that has a checkpoint of a program's execution state.
@ eTypeSharedLibrary
A shared library that can be used during execution.
@ eTypeJIT
JIT code that has symbols, sections and possibly debug info.
virtual void ClearSymtab()
Frees the symbol table.
static bool SplitArchivePathWithObject(llvm::StringRef path_with_object, lldb_private::FileSpec &archive_file, lldb_private::ConstString &archive_object, bool must_exist)
Split a path into a file path with object name.
virtual llvm::StringRef GetPluginName()=0
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
Entry & GetEntryRef(size_t i)
uint32_t FindEntryIndexThatContains(B addr) const
const Entry * GetEntryAtIndex(size_t i) const
RangeData< lldb::addr_t, lldb::addr_t, OSOEntry > Entry
void Append(const Entry &entry)
Entry * FindEntryThatContains(B addr)
llvm::StringRef GetText() const
Access the regular expression text.
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
bool GetCheckInlines() const
FileSpec GetFileSpec() const
This base class provides an interface to stack frames.
const Address & GetFrameCodeAddress()
Get an Address for the current pc value in this StackFrame.
int SetErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Set the current error string to a formatted error string.
bool Fail() const
Test for error condition.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
A stream class that can stream formatted output to a file.
Defines a list of symbol context objects.
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
uint32_t GetSize() const
Get accessor for a symbol context list size.
bool RemoveContextAtIndex(size_t idx)
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
virtual void CalculateSymbolContext(SymbolContext *sc)=0
Reconstruct the object's symbol context into sc.
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
CompileUnit * comp_unit
The CompileUnit for a given query.
Symbol * symbol
The Symbol for a given query.
Containing protected virtual methods for child classes to override.
ObjectFile * GetObjectFile() override
lldb::ObjectFileSP m_objfile_sp
void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp)
uint32_t GetNumCompileUnits() override
Provides public interface for all SymbolFiles.
virtual std::recursive_mutex & GetModuleMutex() const
Symbols file subclasses should override this to return the Module that owns the TypeSystem that this ...
Status GetFrameVariableError(StackFrame &frame)
Get an error that describes why variables might be missing for a given symbol context.
virtual uint32_t ResolveSymbolContext(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc)=0
uint32_t GetSiblingIndex() const
uint64_t GetIntegerValue(uint64_t fail_value=0) const
bool ValueIsAddress() const
Address & GetAddressRef()
lldb::addr_t GetByteSize() const
ConstString GetName() const
lldb::SymbolType GetType() const
Symbol * SymbolAtIndex(size_t idx)
Symbol * FindFirstSymbolWithNameAndType(ConstString name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility)
void SortSymbolIndexesByValue(std::vector< uint32_t > &indexes, bool remove_duplicates) const
uint32_t AppendSymbolIndexesWithType(lldb::SymbolType symbol_type, std::vector< uint32_t > &indexes, uint32_t start_idx=0, uint32_t end_index=UINT32_MAX) const
uint32_t GetIndexForSymbol(const Symbol *symbol) const
uint32_t AppendSymbolIndexesWithTypeAndFlagsValue(lldb::SymbolType symbol_type, uint32_t flags_value, std::vector< uint32_t > &indexes, uint32_t start_idx=0, uint32_t end_index=UINT32_MAX) const
const Symbol * GetParent(Symbol *symbol) const
Get the parent symbol for the given symbol.
An abstraction for Xcode-style SDKs that works like ArchSpec.
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
lldb_private::Status oso_load_error
llvm::sys::TimePoint oso_mod_time
const FileRangeMap & GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile)
bool file_range_map_valid
FileRangeMap file_range_map
lldb_private::ConstString oso_path
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
BaseType GetRangeBase() const
SizeType GetByteSize() const
BaseType GetRangeEnd() const
A mix in class that contains a generic user ID.
lldb::user_id_t GetID() const
Get accessor for the user ID.