41 *module_spec.
m_opaque_up, module_sp,
nullptr,
nullptr,
nullptr);
57 Target &target = process_sp->GetTarget();
59 m_opaque_sp->SetLoadAddress(target, 0,
true, changed);
77 return this->
operator bool();
79SBModule::operator bool()
const {
82 return m_opaque_sp.get() !=
nullptr;
98 ObjectFile *obj_file = module_sp->GetObjectFile();
122 file_spec.
SetFileSpec(module_sp->GetPlatformFileSpec());
134 module_sp->SetPlatformFileSpec(*platform_file);
147 sb_file_spec.
SetFileSpec(module_sp->GetRemoteInstallFileSpec());
156 module_sp->SetRemoteInstallFileSpec(file.
ref());
165 const uint8_t *uuid_bytes =
nullptr;
168 uuid_bytes = module_sp->GetUUID().GetBytes().data();
184 const char *uuid_cstr =
188 if (uuid_cstr && uuid_cstr[0])
220 if (module_sp->ResolveFileAddress(vm_addr, addr))
221 sb_addr.
ref() = addr;
228 uint32_t resolve_scope) {
233 SymbolContextItem scope =
static_cast<SymbolContextItem
>(resolve_scope);
234 if (module_sp && addr.
IsValid())
235 module_sp->ResolveSymbolContextForAddress(addr.
ref(), scope, *sb_sc);
258 return module_sp->GetNumCompileUnits();
269 CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(index);
270 sb_cu.
reset(cu_sp.get());
280 if (sb_file_spec.
IsValid() && module_sp) {
281 module_sp->FindCompileUnits(*sb_file_spec, *sb_sc_list);
288 return module_sp->GetSymtab();
297 return symtab->GetNumSymbols();
317 if (name && name[0]) {
333 if (name && name[0]) {
337 std::vector<uint32_t> matching_symbol_indexes;
339 matching_symbol_indexes);
340 const size_t num_matches = matching_symbol_indexes.size();
345 for (
size_t i = 0; i < num_matches; ++i) {
362 module_sp->GetSymbolFile();
363 SectionList *section_list = module_sp->GetSectionList();
365 return section_list->
GetSize();
377 module_sp->GetSymbolFile();
378 SectionList *section_list = module_sp->GetSectionList();
387 uint32_t name_type_mask) {
392 if (name && module_sp) {
397 FunctionNameType type =
static_cast<FunctionNameType
>(name_type_mask);
399 function_options, *sb_sc_list);
405 uint32_t max_matches) {
410 if (name && module_sp) {
413 max_matches, variable_list);
414 for (
const VariableSP &var_sp : variable_list) {
423 return sb_value_list;
440 if (name_cstr && module_sp) {
444 module_sp->FindTypes(query, results);
449 auto type_system_or_err =
451 if (
auto err = type_system_or_err.takeError()) {
452 llvm::consumeError(std::move(err));
456 if (
auto ts = *type_system_or_err)
457 return SBType(ts->GetBuiltinTypeByName(name));
467 auto type_system_or_err =
469 if (
auto err = type_system_or_err.takeError()) {
470 llvm::consumeError(std::move(err));
472 if (
auto ts = *type_system_or_err)
473 return SBType(ts->GetBasicTypeFromAST(type));
485 if (type && module_sp) {
489 module_sp->FindTypes(query, results);
492 auto type_system_or_err =
494 if (
auto err = type_system_or_err.takeError()) {
495 llvm::consumeError(std::move(err));
497 if (
auto ts = *type_system_or_err)
498 if (
CompilerType compiler_type = ts->GetBuiltinTypeByName(name))
514 if (
SymbolFile *symfile = module_sp->GetSymbolFile()) {
515 Type *type_ptr = symfile->ResolveTypeUID(uid);
517 return SBType(type_ptr->shared_from_this());
531 SymbolFile *symfile = module_sp->GetSymbolFile();
535 TypeClass type_class =
static_cast<TypeClass
>(type_mask);
537 symfile->
GetTypes(
nullptr, type_class, type_list);
548 if (sect_name && module_sp) {
550 module_sp->GetSymbolFile();
551 SectionList *section_list = module_sp->GetSectionList();
556 sb_section.
SetSP(section_sp);
568 return module_sp->GetArchitecture().GetByteOrder();
579 std::string triple(module_sp->GetArchitecture().GetTriple().str());
592 return module_sp->GetArchitecture().GetAddressByteSize();
593 return sizeof(
void *);
599 llvm::VersionTuple version;
601 version = module_sp->GetVersion();
603 if (!version.empty())
605 if (version.getMinor())
607 if (version.getSubminor())
613 if (num_versions > 0)
614 versions[0] = version.empty() ?
UINT32_MAX : version.getMajor();
615 if (num_versions > 1)
616 versions[1] = version.getMinor().value_or(
UINT32_MAX);
617 if (num_versions > 2)
618 versions[2] = version.getSubminor().value_or(
UINT32_MAX);
619 for (uint32_t i = 3; i < num_versions; ++i)
630 if (
SymbolFile *symfile = module_sp->GetSymbolFile())
631 sb_file_spec.
SetFileSpec(symfile->GetObjectFile()->GetFileSpec());
642 ObjectFile *objfile_ptr = module_sp->GetObjectFile();
655 ObjectFile *objfile_ptr = module_sp->GetObjectFile();
671 const bool mandatory =
false;
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_INSTRUMENT()
#define LLDB_INSTRUMENT_VA(...)
static Symtab * GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp)
lldb_private::Address & ref()
void reset(lldb_private::CompileUnit *lldb_object_ptr)
void SetFileSpec(const lldb_private::FileSpec &fspec)
const lldb_private::FileSpec & ref() const
std::unique_ptr< lldb_private::ModuleSpec > m_opaque_up
bool GetDescription(lldb::SBStream &description)
lldb::SBTypeList GetTypes(uint32_t type_mask=lldb::eTypeClassAny)
Get all types matching type_mask from debug info in this module.
lldb::SBValue FindFirstGlobalVariable(lldb::SBTarget &target, const char *name)
Find the first global (or static) variable by name.
void SetSP(const ModuleSP &module_sp)
lldb::SBType FindFirstType(const char *name)
lldb::SBAddress GetObjectFileEntryPointAddress() const
uint32_t GetAddressByteSize()
uint32_t GetNumCompileUnits()
lldb::SBTypeList FindTypes(const char *type)
lldb::SBValueList FindGlobalVariables(lldb::SBTarget &target, const char *name, uint32_t max_matches)
Find global and static variables by name.
static void GarbageCollectAllocatedModules()
Remove any global modules which are no longer needed.
static uint32_t GetNumberAllocatedModules()
Get the number of global modules.
lldb::SBFileSpec GetSymbolFileSpec() const
Get accessor for the symbol file specification.
lldb::SBSymbol GetSymbolAtIndex(size_t idx)
lldb::ModuleSP m_opaque_sp
lldb::SBSymbol FindSymbol(const char *name, lldb::SymbolType type=eSymbolTypeAny)
lldb::SBAddress ResolveFileAddress(lldb::addr_t vm_addr)
bool IsFileBacked() const
const uint8_t * GetUUIDBytes() const
lldb::SBFileSpec GetRemoteInstallFileSpec()
Get accessor for the remote install path for a module.
uint32_t GetVersion(uint32_t *versions, uint32_t num_versions)
Get the module version numbers.
lldb::SBType GetTypeByID(lldb::user_id_t uid)
Get a type using its type ID.
lldb::SBSection FindSection(const char *sect_name)
lldb::SBCompileUnit GetCompileUnitAtIndex(uint32_t)
lldb::SBSection GetSectionAtIndex(size_t idx)
lldb::SBSymbolContextList FindSymbols(const char *name, lldb::SymbolType type=eSymbolTypeAny)
bool SetRemoteInstallFileSpec(lldb::SBFileSpec &file)
Set accessor for the remote install path for a module.
bool operator==(const lldb::SBModule &rhs) const
lldb::SBSymbolContextList FindFunctions(const char *name, uint32_t name_type_mask=lldb::eFunctionNameTypeAny)
Find functions by name.
lldb::SBAddress GetObjectFileHeaderAddress() const
lldb::SBFileSpec GetFileSpec() const
Get const accessor for the module file specification.
lldb::SBSymbolContextList FindCompileUnits(const lldb::SBFileSpec &sb_file_spec)
Find compile units related to *this module and passed source file.
lldb::ByteOrder GetByteOrder()
const SBModule & operator=(const SBModule &rhs)
bool operator!=(const lldb::SBModule &rhs) const
const char * GetUUIDString() const
lldb::SBFileSpec GetPlatformFileSpec() const
Get accessor for the module platform file specification.
lldb::SBSymbolContext ResolveSymbolContextForAddress(const lldb::SBAddress &addr, uint32_t resolve_scope)
bool SetPlatformFileSpec(const lldb::SBFileSpec &platform_file)
lldb::SBType GetBasicType(lldb::BasicType type)
lldb::ProcessSP GetSP() const
void SetSP(const lldb::SectionSP §ion_sp)
lldb_private::Stream & ref()
void SetSymbol(lldb_private::Symbol *lldb_object_ptr)
lldb::TargetSP GetSP() const
std::unique_ptr< lldb_private::TypeListImpl > m_opaque_up
void Append(lldb::SBType type)
void Append(const lldb::SBValue &val_obj)
lldb::SBValue GetValueAtIndex(uint32_t idx) const
A section + offset based address class.
Represents a generic declaration context in a program.
Generic representation of a type in a programming language.
A uniqued constant string class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
const char * GetCString() const
Get the string value as a C string.
static Status GetSharedModule(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr, bool always_create=false)
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
static size_t RemoveOrphanSharedModules(bool mandatory)
static size_t GetNumberAllocatedModules()
A plug-in interface definition class for object file parsers.
virtual lldb_private::Address GetEntryPointAddress()
Returns the address of the Entry Point in this object file - if the object file doesn't have an entry...
bool IsInMemory() const
Returns true if the object file exists only in memory.
virtual lldb_private::Address GetBaseAddress()
Returns base address of this object file.
lldb::SectionSP FindSectionByName(ConstString section_dstr) const
lldb::SectionSP GetSectionAtIndex(size_t idx) const
A stream class that can stream formatted output to a file.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Defines a list of symbol context objects.
void Append(const SymbolContext &sc)
Append a new symbol context to the list.
Defines a symbol context baton that can be handed other debug core functions.
lldb::ModuleSP module_sp
The Module for a given query.
Symbol * symbol
The Symbol for a given query.
Provides public interface for all SymbolFiles.
virtual void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list)=0
Symbol * SymbolAtIndex(size_t idx)
Symbol * FindFirstSymbolWithNameAndType(ConstString name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility)
void FindAllSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, std::vector< uint32_t > &symbol_indexes)
const ModuleList & GetImages() const
Get accessor for the images for this process.
TypeIterable Types() const
A class that contains all state required for type lookups.
This class tracks the state and results of a TypeQuery.
lldb::TypeSP GetFirstType() const
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp)
A class that represents a running process on the host machine.
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
@ eLanguageTypeC
Non-standardized C, such as K&R.
std::shared_ptr< lldb_private::Type > TypeSP
std::shared_ptr< lldb_private::Process > ProcessSP
ByteOrder
Byte ordering definitions.
std::shared_ptr< lldb_private::Variable > VariableSP
std::shared_ptr< lldb_private::Section > SectionSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::Module > ModuleSP
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
Options used by Module::FindFunctions.
bool include_inlines
Include inlined functions.
bool include_symbols
Include the symbol table.