34#include "llvm/ADT/STLExtras.h"
35#include "llvm/ADT/StringRef.h"
36#include "llvm/Support/ScopedPrinter.h"
76 "%p: SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap ('%s')",
77 static_cast<void *
>(
this),
80 std::vector<SymbolFileDWARFDebugMap::CompileUnitInfo *> cu_infos;
82 for (
auto comp_unit_info : cu_infos) {
93 assert(comp_unit_info->first_symbol_index !=
UINT32_MAX);
95 const uint32_t oso_end_idx = comp_unit_info->last_symbol_index + 1;
96 for (uint32_t idx = comp_unit_info->first_symbol_index +
98 idx < oso_end_idx; ++idx) {
104 switch (exe_symbol->
GetType()) {
122 if (oso_fun_symbol) {
152 if (exe_symbol && oso_gsym_symbol && exe_symbol->
ValueIsAddress() &&
181 const llvm::sys::TimePoint<> object_mod_time)
182 :
Module(file_spec, arch, object_name, object_offset, object_mod_time),
199 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
211 ObjectFile *exe_objfile = exe_module_sp->GetObjectFile();
212 SymbolFile *exe_symfile = exe_module_sp->GetSymbolFile();
214 if (exe_objfile && exe_symfile) {
245 return "DWARF and DWARF3 debug symbol file reader (debug map).";
300 std::vector<uint32_t> oso_indexes;
308 const uint32_t k_oso_symbol_flags_value = 0x660001u;
310 const uint32_t oso_index_count =
314 if (oso_index_count == 0)
325 for (uint32_t sym_idx :
338 for (uint32_t i = 0; i < oso_index_count; ++i) {
339 const uint32_t so_idx = oso_indexes[i] - 1;
340 const uint32_t oso_idx = oso_indexes[i];
343 if (so_symbol && oso_symbol &&
347 FileSpec::Style::native);
354 if (sibling_idx <= i || sibling_idx ==
UINT32_MAX) {
356 "N_SO in symbol with UID {0} has invalid sibling in debug "
358 "please file a bug and attach the binary listed in this error",
367 LLDB_LOGF(log,
"Initialized OSO 0x%8.8x: file=%s", i,
371 if (oso_symbol ==
nullptr)
373 "N_OSO symbol[{0}] can't be found, please file a bug and "
375 "the binary listed in this error",
377 else if (so_symbol ==
nullptr)
379 "N_SO not found for N_OSO symbol[{0}], please file a bug and "
380 "attach the binary listed in this error",
384 "N_SO has incorrect symbol type ({0}) for N_OSO "
386 "please file a bug and attach the binary listed in this error",
387 so_symbol->
GetType(), oso_idx);
390 "N_OSO has incorrect symbol type ({0}) for N_OSO "
392 "please file a bug and attach the binary listed in this error",
393 oso_symbol->
GetType(), oso_idx);
400 if (oso_idx < cu_count)
407 if (!comp_unit_info->
oso_sp) {
411 comp_unit_info->
oso_sp = pos->second;
414 comp_unit_info->
oso_sp = std::make_shared<OSOInfo>();
423 auto oso_mod_time = std::chrono::time_point_cast<std::chrono::seconds>(
428 if (comp_unit_info->
oso_mod_time != llvm::sys::TimePoint<>() &&
431 "debug map object file \"%s\" changed (actual: 0x%8.8x, debug "
432 "map: 0x%8.8x) since this executable was linked, debug info "
433 "will not be loaded",
435 (uint32_t)llvm::sys::toTimeT(oso_mod_time),
436 (uint32_t)llvm::sys::toTimeT(comp_unit_info->
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, 0,
472 oso_object ? comp_unit_info->
oso_mod_time : llvm::sys::TimePoint<>());
474 if (oso_object && !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",
484 (uint32_t)llvm::sys::toTimeT(comp_unit_info->
oso_mod_time));
488 if (comp_unit_info->
oso_sp)
489 return comp_unit_info->
oso_sp->module_sp.get();
537 if (first_comp_unit_info <= comp_unit_info &&
538 comp_unit_info <= last_comp_unit_info)
539 return comp_unit_info - first_comp_unit_info;
574 if (oso_index_count > 0) {
595 if (cu_idx < cu_count) {
604 cu_info.compile_units_sps.push_back(std::make_shared<CompileUnit>(
606 std::make_shared<SupportFile>(so_file_spec), cu_id,
608 cu_info.id_to_index_map.insert({0, 0});
613 auto num_dwarf_units = oso_symfile->DebugInfo().GetNumUnits();
614 for (
size_t i = 0; i < num_dwarf_units; ++i) {
615 auto *dwarf_unit = oso_symfile->DebugInfo().GetUnitAtIndex(i);
616 if (
auto *dwarf_cu = llvm::dyn_cast<DWARFCompileUnit>(dwarf_unit)) {
618 if (dwarf_cu->GetID() == 0)
620 cu_info.compile_units_sps.push_back(std::make_shared<CompileUnit>(
622 std::make_shared<SupportFile>(so_file_spec),
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) {
722 std::string description,
725 Progress progress(std::move(description),
"", num_oso_idxs,
728 for (uint32_t oso_idx = 0; oso_idx < num_oso_idxs; ++oso_idx) {
730 progress.
Increment(oso_idx, oso_dwarf->GetObjectName());
739 llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files,
740 llvm::function_ref<
bool(
Module &)> f) {
766 const SymbolContext &sc, std::vector<SourceModule> &imported_modules) {
812std::optional<SymbolFile::ArrayInfo>
823 bool success =
false;
839 SymbolContextItem resolve_scope,
842 uint32_t resolved_flags = 0;
849 if (debug_map_entry) {
852 symtab->
SymbolAtIndex(debug_map_entry->data.GetExeSymbolIndex());
854 if (sc.
symbol !=
nullptr) {
855 resolved_flags |= eSymbolContextSymbol;
857 uint32_t oso_idx = 0;
858 CompileUnitInfo *comp_unit_info =
860 if (comp_unit_info) {
861 comp_unit_info->GetFileRangeMap(
this);
865 exe_file_addr - debug_map_entry->GetRangeBase() +
866 debug_map_entry->data.GetOSOFileAddress();
870 resolved_flags |= sym_file->ResolveSymbolContext(
871 oso_so_addr, resolve_scope, sc);
875 "Failed to get symfile for OSO: {0} in module: {1}",
886 return resolved_flags;
890 const SourceLocationSpec &src_location_spec,
891 SymbolContextItem resolve_scope, SymbolContextList &sc_list) {
893 const uint32_t initial = sc_list.
GetSize();
896 for (uint32_t i = 0; i < cu_count; ++i) {
902 FileSpec so_file_spec;
914 return sc_list.
GetSize() - initial;
919 const std::vector<uint32_t>
922 const size_t match_count = indexes.size();
923 for (
size_t i = 0; i < match_count; ++i) {
927 if (comp_unit_info) {
932 if (variables.
GetSize() > max_matches)
943 uint32_t total_matches = 0;
947 const uint32_t old_size = variables.
GetSize();
950 const uint32_t oso_matches = variables.
GetSize() - old_size;
951 if (oso_matches > 0) {
952 total_matches += oso_matches;
959 if (max_matches >= total_matches)
964 max_matches -= oso_matches;
975 uint32_t total_matches = 0;
978 const uint32_t old_size = variables.
GetSize();
981 const uint32_t oso_matches = variables.
GetSize() - old_size;
982 if (oso_matches > 0) {
983 total_matches += oso_matches;
990 if (max_matches >= total_matches)
995 max_matches -= oso_matches;
1004 const uint32_t symbol_idx = *symbol_idx_ptr;
1006 if (symbol_idx < comp_unit_info->first_symbol_index)
1009 if (symbol_idx <= comp_unit_info->last_symbol_index)
1017 const user_id_t symbol_id = *symbol_idx_ptr;
1019 if (symbol_id < comp_unit_info->first_symbol_id)
1022 if (symbol_id <= comp_unit_info->last_symbol_id)
1030 uint32_t symbol_idx, uint32_t *oso_idx_ptr) {
1033 if (oso_index_count) {
1041 if (comp_unit_info !=
nullptr)
1046 return comp_unit_info;
1051 user_id_t symbol_id, uint32_t *oso_idx_ptr) {
1054 if (oso_index_count) {
1062 if (comp_unit_info !=
nullptr)
1067 return comp_unit_info;
1072 uint32_t start_idx) {
1079 uint32_t i = start_idx;
1080 while (i < sc_list.
GetSize()) {
1085 if (section_sp->GetModule() != module_sp) {
1103 uint32_t sc_idx = sc_list.
GetSize();
1104 oso_dwarf.
FindFunctions(lookup_info, parent_decl_ctx, include_inlines,
1115 bool include_inlines,
1119 regex.
GetText().str().c_str());
1122 uint32_t sc_idx = sc_list.
GetSize();
1134 lldb::TypeClass type_mask,
1149 oso_dwarf->
GetTypes(sc_scope, type_mask, type_list);
1153 oso_dwarf.
GetTypes(sc_scope, type_mask, type_list);
1159std::vector<std::unique_ptr<lldb_private::CallEdge>>
1190 if (module_objfile) {
1196 if (objc_class_symbol) {
1199 const Symbol *source_file_symbol = symtab->
GetParent(objc_class_symbol);
1201 if (source_file_symbol &&
1203 const uint32_t source_file_symbol_idx =
1209 if (compile_unit_info) {
1213 die, type_name, must_be_implementation));
1228 if (!must_be_implementation) {
1232 "Looking up Objective-C definition", [&](
SymbolFileDWARF &oso_dwarf) {
1234 die, type_name, must_be_implementation);
1255 bool only_root_namespaces) {
1260 matching_namespace =
1261 oso_dwarf.
FindNamespace(name, parent_decl_ctx, only_root_namespaces);
1267 return matching_namespace;
1283 bool load_all_debug_info) {
1286 for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1289 std::make_shared<StructuredData::Dictionary>();
1290 oso_data->AddStringItem(
"so_file", info.so_file.GetPath());
1291 oso_data->AddStringItem(
"oso_path", info.oso_path);
1292 oso_data->AddIntegerItem(
"oso_mod_time",
1293 (uint32_t)llvm::sys::toTimeT(info.oso_mod_time));
1295 bool loaded_successfully =
false;
1299 if (!info.oso_load_error.Fail()) {
1300 loaded_successfully =
true;
1303 if (!loaded_successfully) {
1304 oso_data->AddStringItem(
"error", info.oso_load_error.AsCString());
1306 oso_data->AddBooleanItem(
"loaded", loaded_successfully);
1307 if (!errors_only || oso_data->HasKey(
"error"))
1308 separate_debug_info_files.
AddItem(oso_data);
1313 d.
AddItem(
"separate-debug-info-files",
1314 std::make_shared<StructuredData::Array>(
1315 std::move(separate_debug_info_files)));
1324 for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1327 if (oso_symfile == oso_dwarf) {
1332 auto it = id_to_index_map.find(dwarf_cu.
GetID());
1333 if (it != id_to_index_map.end())
1335 .compile_units_sps[it->getSecond()];
1339 llvm_unreachable(
"this shouldn't happen");
1346 for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1349 if (oso_symfile == oso_dwarf) {
1361 for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1364 if (oso_symfile == oso_dwarf) {
1369 assert(cu_sp->GetID() == 0 &&
1370 "Setting first compile unit but with id different than 0!");
1371 auto &compile_units_sps =
1373 compile_units_sps.push_back(cu_sp);
1375 {cu_sp->GetID(), compile_units_sps.size() - 1});
1400std::vector<CompilerContext>
1421 const uint32_t debug_map_idx =
1422 m_debug_map.FindEntryIndexThatContains(exe_file_addr);
1426 debug_map_entry->
data.SetOSOFileAddress(oso_file_addr);
1427 addr_t range_size = std::min<addr_t>(exe_byte_size, oso_byte_size);
1428 if (range_size == 0) {
1429 range_size = std::max<addr_t>(exe_byte_size, oso_byte_size);
1430 if (range_size == 0)
1442#if defined(DEBUG_OSO_DMAP)
1444 const size_t n = oso_file_range_map.
GetSize();
1445 printf(
"SymbolFileDWARFDebugMap::FinalizeOSOFileRanges (cu_info = %p) %s\n",
1446 cu_info, cu_info->
oso_sp->module_sp->GetFileSpec().GetPath().c_str());
1447 for (
size_t i = 0; i < n; ++i) {
1449 printf(
"oso [0x%16.16" PRIx64
" - 0x%16.16" PRIx64
1450 ") ==> exe [0x%16.16" PRIx64
" - 0x%16.16" PRIx64
")\n",
1464 if (oso_range_entry) {
1467 if (debug_map_entry) {
1472 return exe_file_addr;
1483 if (addr_module == exe_module)
1492 if (oso_range_entry) {
1495 if (debug_map_entry) {
1518 size_t num_line_entries_added = 0;
1519 if (debug_aranges && dwarf2Data) {
1521 if (compile_unit_info) {
1524 for (
size_t idx = 0; idx < file_range_map.
GetSize(); idx++) {
1530 num_line_entries_added++;
1535 return num_line_entries_added;
1545 oso_modules.
Append(module_sp);
1564 if (debug_map_entry) {
1568 uint32_t oso_idx = 0;
1571 if (comp_unit_info) {
1587 "unable to load debug map object file \"%s\" "
1588 "exist, debug info will not be loaded",
1599 std::unordered_map<lldb::CompUnitSP, lldb_private::Args> &args) {
1607llvm::Expected<SymbolContext>
1612 return llvm::createStringError(llvm::formatv(
1613 "couldn't find symbol file for {0} in debug-map.", label));
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
static void RemoveFunctionsWithModuleNotEqualTo(const ModuleSP &module_sp, SymbolContextList &sc_list, uint32_t start_idx)
#define LLDB_SCOPED_TIMERF(...)
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 Address & GetAddress() const
Return the address of the function (its entry point).
CompileUnit * GetCompileUnit()
Get accessor for the compile unit that owns this function.
LineTable * LinkLineTable(const FileRangeMap &file_range_map)
ConstString GetName(NamePreference preference=ePreferDemangled) const
Best name get accessor.
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.
std::recursive_mutex m_mutex
A mutex to keep this object happy in multi-threaded environments.
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr)
lldb::SymbolVendorUP m_symfile_up
A pointer to the symbol vendor for this module.
Module(const FileSpec &file_spec, const ArchSpec &arch, ConstString object_name=ConstString(), lldb::offset_t object_offset=0, const llvm::sys::TimePoint<> &object_mod_time=llvm::sys::TimePoint<>())
Construct with file specification and architecture.
std::string GetSpecificationDescription() const
Get the module path and object name.
const FileSpec & GetFileSpec() const
Get const accessor for the module file specification.
A plug-in interface definition class for object file parsers.
Symtab * GetSymtab(bool can_create=true)
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.
virtual FileSpec & GetFileSpec()
Get accessor to the object file specification.
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)
A Progress indicator helper class.
void Increment(uint64_t amount=1, std::optional< std::string > updated_detail={})
Increment the progress and send a notification to the installed callback.
static constexpr std::chrono::milliseconds kDefaultHighFrequencyReportTime
The default report time for high frequency progress reports.
Entry & GetEntryRef(size_t i)
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.
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.
Status Clone() const
Don't call this function in new code.
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
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.
void AddItem(const ObjectSP &item)
void AddStringItem(llvm::StringRef key, llvm::StringRef value)
void AddItem(llvm::StringRef key, ObjectSP value_sp)
std::shared_ptr< Dictionary > DictionarySP
A list of support files for a CompileUnit.
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.
ObjectFile * GetObjectFile() override
lldb::ObjectFileSP m_objfile_sp
ObjectFile * GetMainObjectFile() override
void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp)
SymbolFileCommon(lldb::ObjectFileSP objfile_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.
std::unordered_map< lldb::CompUnitSP, Args > GetCompileOptions()
Returns a map of compilation unit to the compile option arguments associated with that compilation un...
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.
A class that contains all state required for type lookups.
This class tracks the state and results of a TypeQuery.
bool Done(const TypeQuery &query) const
Check if the type matching has found all of the matches that it needs.
An abstraction for Xcode-style SDKs that works like ArchSpec.
void AppendRange(dw_offset_t cu_offset, dw_addr_t low_pc, dw_addr_t high_pc)
~DebugMapModule() override=default
DebugMapModule(const ModuleSP &exe_module_sp, uint32_t cu_idx, const FileSpec &file_spec, const ArchSpec &arch, ConstString object_name, off_t object_offset, const llvm::sys::TimePoint<> object_mod_time)
SymbolFile * GetSymbolFile(bool can_create=true, lldb_private::Stream *feedback_strm=nullptr) override
Get the module's symbol file.
void ForEachSymbolFile(std::string description, std::function< IterationAction(SymbolFileDWARF &)> closure)
If closure returns IterationAction::Continue, iteration continues.
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 DumpClangAST(Stream &s, llvm::StringRef filter, bool show_color) override
void ParseDeclsForContext(CompilerDeclContext decl_ctx) override
bool GetSeparateDebugInfo(StructuredData::Dictionary &d, bool errors_only, bool load_all_debug_info=false) override
List separate oso files.
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.
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 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.
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.
friend class SymbolFileDWARF
friend class DWARFCompileUnit
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)
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
llvm::SmallSet< lldb::LanguageType, 4 > ParseAllLanguages(CompileUnit &comp_unit) override
This function exists because SymbolFileDWARFDebugMap may extra compile units which aren't exposed as ...
static char ID
LLVM RTTI support.
Module * GetModuleByOSOIndex(uint32_t oso_idx)
uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info)
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
SymbolFileDWARFDebugMap(lldb::ObjectFileSP objfile_sp)
void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask, TypeList &type_list) override
llvm::Expected< SymbolContext > ResolveFunctionCallLabel(FunctionCallLabel &label) override
Resolves the function corresponding to the specified LLDB function call label.
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.
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...
DWARFDIE FindDefinitionDIE(const DWARFDIE &die)
CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
void FindGlobalVariables(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, VariableList &variables) override
virtual DWARFDIE FindDefinitionDIE(const DWARFDIE &die)
bool ForEachExternalModule(CompileUnit &, llvm::DenseSet< SymbolFile * > &, llvm::function_ref< bool(Module &)>) override
virtual lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, ConstString type_name, bool must_be_implementation)
llvm::Expected< SymbolContext > ResolveFunctionCallLabel(FunctionCallLabel &label) override
Resolves the function corresponding to the specified LLDB function call label.
void SetDebugMapModule(const lldb::ModuleSP &module_sp)
void DumpClangAST(Stream &s, llvm::StringRef filter, bool show_colors) override
std::vector< CompilerContext > GetCompilerContextForUID(lldb::user_id_t uid) override
static llvm::StringRef GetPluginNameStatic()
void FindTypes(const lldb_private::TypeQuery &match, lldb_private::TypeResults &results) override
Find types using a type-matching object that contains all search parameters.
size_t ParseVariablesForContext(const SymbolContext &sc) override
void GetCompileOptions(std::unordered_map< lldb::CompUnitSP, Args > &args) 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
size_t ParseFunctions(CompileUnit &comp_unit) override
bool ParseDebugMacros(CompileUnit &comp_unit) override
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
void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask, TypeList &type_list) override
void ParseDeclsForContext(CompilerDeclContext decl_ctx) override
size_t ParseTypes(CompileUnit &comp_unit) override
bool CompleteType(CompilerType &compiler_type) override
bool ParseLineTable(CompileUnit &comp_unit) override
bool ParseIsOptimized(CompileUnit &comp_unit) override
void SetFileIndex(std::optional< uint64_t > file_index)
void FindFunctions(const Module::LookupInfo &lookup_info, const CompilerDeclContext &parent_decl_ctx, bool include_inlines, SymbolContextList &sc_list) override
uint32_t ResolveSymbolContext(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) override
bool HasForwardDeclForCompilerType(const CompilerType &compiler_type)
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
CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
std::optional< uint64_t > GetFileIndex() const
#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.
int(* ComparisonFunction)(const void *, const void *)
IterationAction
Useful for callbacks whose return type indicates whether to continue iteration or short-circuit.
std::weak_ptr< lldb_private::Module > ModuleWP
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
std::shared_ptr< lldb_private::Type > TypeSP
std::shared_ptr< lldb_private::Section > SectionSP
std::shared_ptr< lldb_private::Module > ModuleSP
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
Holds parsed information about a function call label that LLDB attaches as an AsmLabel to function AS...
lldb::user_id_t symbol_id
Unique identifier of the function symbol on which to perform the function call.
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.
const FileRangeMap & GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile)
bool file_range_map_valid
llvm::sys::TimePoint oso_mod_time
FileRangeMap file_range_map