33#include "llvm/ADT/STLExtras.h"
34#include "llvm/Support/ScopedPrinter.h"
74 "%p: SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap ('%s')",
75 static_cast<void *
>(
this),
78 std::vector<SymbolFileDWARFDebugMap::CompileUnitInfo *> cu_infos;
80 for (
auto comp_unit_info : cu_infos) {
91 assert(comp_unit_info->first_symbol_index !=
UINT32_MAX);
93 const uint32_t oso_end_idx = comp_unit_info->last_symbol_index + 1;
94 for (uint32_t idx = comp_unit_info->first_symbol_index +
96 idx < oso_end_idx; ++idx) {
102 switch (exe_symbol->
GetType()) {
120 if (oso_fun_symbol) {
150 if (exe_symbol && oso_gsym_symbol && exe_symbol->
ValueIsAddress() &&
179 const llvm::sys::TimePoint<> object_mod_time)
180 :
Module(file_spec, arch, object_name, object_offset, object_mod_time),
181 m_exe_module_wp(exe_module_sp), m_cu_idx(cu_idx) {}
189 if (m_symfile_up.get() || !can_create)
190 return m_symfile_up ? m_symfile_up->GetSymbolFile() :
nullptr;
192 ModuleSP exe_module_sp(m_exe_module_wp.lock());
197 std::lock_guard<std::recursive_mutex> guard(m_mutex);
209 ObjectFile *exe_objfile = exe_module_sp->GetObjectFile();
210 SymbolFile *exe_symfile = exe_module_sp->GetSymbolFile();
212 if (exe_objfile && exe_symfile) {
243 return "DWARF and DWARF3 debug symbol file reader (debug map).";
299 std::vector<uint32_t> oso_indexes;
307 const uint32_t k_oso_symbol_flags_value = 0x660001u;
309 const uint32_t oso_index_count =
313 if (oso_index_count == 0)
324 for (uint32_t sym_idx :
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 &&
346 FileSpec::Style::native);
353 if (sibling_idx <= i || sibling_idx ==
UINT32_MAX) {
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);
399 if (oso_idx < cu_count)
406 if (!comp_unit_info->
oso_sp) {
410 comp_unit_info->
oso_sp = pos->second;
413 comp_unit_info->
oso_sp = std::make_shared<OSOInfo>();
422 auto oso_mod_time = std::chrono::time_point_cast<std::chrono::seconds>(
427 if (comp_unit_info->
oso_mod_time != llvm::sys::TimePoint<>() &&
430 "debug map object file \"%s\" changed (actual: 0x%8.8x, debug "
431 "map: 0x%8.8x) since this executable was linked, debug info "
432 "will not be loaded", oso_file.
GetPath().c_str(),
433 (uint32_t)llvm::sys::toTimeT(oso_mod_time),
434 (uint32_t)llvm::sys::toTimeT(comp_unit_info->
oso_mod_time));
441 const bool must_exist =
true;
444 oso_object, must_exist)) {
446 "debug map object file \"%s\" containing debug info does not "
447 "exist, debug info will not be loaded",
467 comp_unit_info->
oso_sp->module_sp = std::make_shared<DebugMapModule>(
469 oso_arch, oso_object, 0,
470 oso_object ? comp_unit_info->
oso_mod_time : llvm::sys::TimePoint<>());
472 if (oso_object && !comp_unit_info->
oso_sp->module_sp->GetObjectFile() &&
478 "\"%s\" object from the \"%s\" archive: "
479 "either the .o file doesn't exist in the archive or the "
480 "modification time (0x%8.8x) of the .o file doesn't match",
482 (uint32_t)llvm::sys::toTimeT(comp_unit_info->
oso_mod_time));
486 if (comp_unit_info->
oso_sp)
487 return comp_unit_info->
oso_sp->module_sp.get();
535 if (first_comp_unit_info <= comp_unit_info &&
536 comp_unit_info <= last_comp_unit_info)
537 return comp_unit_info - first_comp_unit_info;
572 if (oso_index_count > 0) {
593 if (cu_idx < cu_count) {
602 cu_info.compile_units_sps.push_back(std::make_shared<CompileUnit>(
604 std::make_shared<SupportFile>(so_file_spec), cu_id,
606 cu_info.id_to_index_map.insert({0, 0});
611 auto num_dwarf_units = oso_symfile->DebugInfo().GetNumUnits();
612 for (
size_t i = 0; i < num_dwarf_units; ++i) {
613 auto *dwarf_unit = oso_symfile->DebugInfo().GetUnitAtIndex(i);
614 if (
auto *dwarf_cu = llvm::dyn_cast<DWARFCompileUnit>(dwarf_unit)) {
616 if (dwarf_cu->GetID() == 0)
618 cu_info.compile_units_sps.push_back(std::make_shared<CompileUnit>(
620 std::make_shared<SupportFile>(so_file_spec),
622 cu_info.id_to_index_map.insert(
623 {dwarf_cu->GetID(), cu_info.compile_units_sps.size() - 1});
629 if (!cu_info.compile_units_sps.empty())
630 comp_unit_sp = cu_info.compile_units_sps[0];
644 for (uint32_t i = 0; i < cu_count; ++i) {
647 auto it = id_to_index_map.find(comp_unit.
GetID());
648 if (it != id_to_index_map.end() &&
658 std::vector<CompileUnitInfo *> &cu_infos) {
660 for (uint32_t i = 0; i < cu_count; ++i) {
664 return cu_infos.size();
684llvm::SmallSet<lldb::LanguageType, 4>
687 llvm::SmallSet<lldb::LanguageType, 4> langs;
689 for (
auto &comp_unit : info->compile_units_sps) {
721 llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files,
722 llvm::function_ref<
bool(
Module &)> f) {
748 const SymbolContext &sc, std::vector<SourceModule> &imported_modules) {
794std::optional<SymbolFile::ArrayInfo>
805 bool success =
false;
809 oso_dwarf->CompleteType(compiler_type);
811 return IterationAction::Stop;
821 SymbolContextItem resolve_scope,
824 uint32_t resolved_flags = 0;
831 if (debug_map_entry) {
834 symtab->
SymbolAtIndex(debug_map_entry->data.GetExeSymbolIndex());
836 if (sc.
symbol !=
nullptr) {
837 resolved_flags |= eSymbolContextSymbol;
839 uint32_t oso_idx = 0;
840 CompileUnitInfo *comp_unit_info =
842 if (comp_unit_info) {
843 comp_unit_info->GetFileRangeMap(
this);
847 exe_file_addr - debug_map_entry->GetRangeBase() +
848 debug_map_entry->data.GetOSOFileAddress();
852 resolved_flags |= sym_file->ResolveSymbolContext(
853 oso_so_addr, resolve_scope, sc);
857 "Failed to get symfile for OSO: {0} in module: {1}",
868 return resolved_flags;
875 const uint32_t initial = sc_list.
GetSize();
878 for (uint32_t i = 0; i < cu_count; ++i) {
896 return sc_list.
GetSize() - initial;
901 const std::vector<uint32_t>
904 const size_t match_count = indexes.size();
905 for (
size_t i = 0; i < match_count; ++i) {
909 if (comp_unit_info) {
914 if (variables.
GetSize() > max_matches)
925 uint32_t total_matches = 0;
928 const uint32_t old_size = variables.
GetSize();
931 const uint32_t oso_matches = variables.
GetSize() - old_size;
932 if (oso_matches > 0) {
933 total_matches += oso_matches;
940 if (max_matches >= total_matches)
945 max_matches -= oso_matches;
956 uint32_t total_matches = 0;
958 const uint32_t old_size = variables.
GetSize();
961 const uint32_t oso_matches = variables.
GetSize() - old_size;
962 if (oso_matches > 0) {
963 total_matches += oso_matches;
970 if (max_matches >= total_matches)
975 max_matches -= oso_matches;
984 const uint32_t symbol_idx = *symbol_idx_ptr;
986 if (symbol_idx < comp_unit_info->first_symbol_index)
989 if (symbol_idx <= comp_unit_info->last_symbol_index)
997 const user_id_t symbol_id = *symbol_idx_ptr;
999 if (symbol_id < comp_unit_info->first_symbol_id)
1002 if (symbol_id <= comp_unit_info->last_symbol_id)
1010 uint32_t symbol_idx, uint32_t *oso_idx_ptr) {
1013 if (oso_index_count) {
1021 if (comp_unit_info !=
nullptr)
1026 return comp_unit_info;
1031 user_id_t symbol_id, uint32_t *oso_idx_ptr) {
1034 if (oso_index_count) {
1042 if (comp_unit_info !=
nullptr)
1047 return comp_unit_info;
1052 uint32_t start_idx) {
1059 uint32_t i = start_idx;
1060 while (i < sc_list.
GetSize()) {
1066 if (section_sp->GetModule() != module_sp) {
1084 uint32_t sc_idx = sc_list.
GetSize();
1085 oso_dwarf->
FindFunctions(lookup_info, parent_decl_ctx, include_inlines,
1088 RemoveFunctionsWithModuleNotEqualTo(m_objfile_sp->GetModule(), sc_list,
1096 bool include_inlines,
1100 regex.
GetText().str().c_str());
1103 uint32_t sc_idx = sc_list.
GetSize();
1107 RemoveFunctionsWithModuleNotEqualTo(m_objfile_sp->GetModule(), sc_list,
1115 lldb::TypeClass type_mask,
1130 oso_dwarf->
GetTypes(sc_scope, type_mask, type_list);
1134 oso_dwarf->
GetTypes(sc_scope, type_mask, type_list);
1140std::vector<std::unique_ptr<lldb_private::CallEdge>>
1164 if (skip_dwarf_oso != oso_dwarf &&
1166 m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
1167 return IterationAction::Stop;
1177 bool must_be_implementation) {
1187 if (module_objfile) {
1193 if (objc_class_symbol) {
1196 const Symbol *source_file_symbol = symtab->
GetParent(objc_class_symbol);
1198 if (source_file_symbol &&
1200 const uint32_t source_file_symbol_idx =
1206 if (compile_unit_info) {
1210 die, type_name, must_be_implementation));
1225 if (!must_be_implementation) {
1230 die, type_name, must_be_implementation);
1251 bool only_root_namespaces) {
1256 matching_namespace =
1257 oso_dwarf->
FindNamespace(name, parent_decl_ctx, only_root_namespaces);
1263 return matching_namespace;
1280 for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1283 std::make_shared<StructuredData::Dictionary>();
1284 oso_data->AddStringItem(
"so_file", info.so_file.GetPath());
1285 oso_data->AddStringItem(
"oso_path", info.oso_path);
1286 oso_data->AddIntegerItem(
"oso_mod_time",
1287 (uint32_t)llvm::sys::toTimeT(info.oso_mod_time));
1289 bool loaded_successfully =
false;
1293 if (!info.oso_load_error.Fail()) {
1294 loaded_successfully =
true;
1297 if (!loaded_successfully) {
1298 oso_data->AddStringItem(
"error", info.oso_load_error.AsCString());
1300 oso_data->AddBooleanItem(
"loaded", loaded_successfully);
1301 if (!errors_only || oso_data->HasKey(
"error"))
1302 separate_debug_info_files.
AddItem(oso_data);
1307 d.
AddItem(
"separate-debug-info-files",
1308 std::make_shared<StructuredData::Array>(
1309 std::move(separate_debug_info_files)));
1317 for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1320 if (oso_symfile == oso_dwarf) {
1325 auto it = id_to_index_map.find(dwarf_cu.
GetID());
1326 if (it != id_to_index_map.end())
1328 .compile_units_sps[it->getSecond()];
1332 llvm_unreachable(
"this shouldn't happen");
1339 for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1342 if (oso_symfile == oso_dwarf) {
1354 for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1357 if (oso_symfile == oso_dwarf) {
1362 assert(cu_sp->GetID() == 0 &&
1363 "Setting first compile unit but with id different than 0!");
1365 compile_units_sps.push_back(cu_sp);
1367 {cu_sp->GetID(), compile_units_sps.size() - 1});
1392std::vector<CompilerContext>
1413 const uint32_t debug_map_idx =
1418 debug_map_entry->
data.SetOSOFileAddress(oso_file_addr);
1419 addr_t range_size = std::min<addr_t>(exe_byte_size, oso_byte_size);
1420 if (range_size == 0) {
1421 range_size = std::max<addr_t>(exe_byte_size, oso_byte_size);
1422 if (range_size == 0)
1434#if defined(DEBUG_OSO_DMAP)
1436 const size_t n = oso_file_range_map.
GetSize();
1437 printf(
"SymbolFileDWARFDebugMap::FinalizeOSOFileRanges (cu_info = %p) %s\n",
1438 cu_info, cu_info->
oso_sp->module_sp->GetFileSpec().GetPath().c_str());
1439 for (
size_t i = 0; i < n; ++i) {
1441 printf(
"oso [0x%16.16" PRIx64
" - 0x%16.16" PRIx64
1442 ") ==> exe [0x%16.16" PRIx64
" - 0x%16.16" PRIx64
")\n",
1456 if (oso_range_entry) {
1459 if (debug_map_entry) {
1464 return exe_file_addr;
1475 if (addr_module == exe_module)
1484 if (oso_range_entry) {
1487 if (debug_map_entry) {
1510 size_t num_line_entries_added = 0;
1511 if (debug_aranges && dwarf2Data) {
1513 if (compile_unit_info) {
1516 for (
size_t idx = 0; idx < file_range_map.
GetSize(); idx++) {
1522 num_line_entries_added++;
1527 return num_line_entries_added;
1537 oso_modules.
Append(module_sp);
1556 if (debug_map_entry) {
1560 uint32_t oso_idx = 0;
1563 if (comp_unit_info) {
1578 return Status(
"unable to load debug map object file \"%s\" "
1579 "exist, debug info will not be loaded",
1590 std::unordered_map<lldb::CompUnitSP, lldb_private::Args> &args) {
#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(...)
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.
bool Exists(const FileSpec &file_spec) const
Returns whether the given file exists.
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)
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.
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr)
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()
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)
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.
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.
Containing protected virtual methods for child classes to override.
ObjectFile * GetObjectFile() override
lldb::ObjectFileSP m_objfile_sp
ObjectFile * GetMainObjectFile() override
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.
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.
SymbolFileDWARF * GetSymbolFileByOSOIndex(uint32_t oso_idx)
static SymbolFileDWARF * GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file)
static llvm::StringRef GetPluginDescriptionStatic()
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.
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)
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::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
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 ...
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
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...
LazyBool m_supports_DW_AT_APPLE_objc_complete_type
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 Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu)
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)
void SetDebugMapModule(const lldb::ModuleSP &module_sp)
void DumpClangAST(Stream &s) 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 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 *)
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
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