diff options
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r-- | lldb/source/API/SBModule.cpp | 287 |
1 files changed, 94 insertions, 193 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index 710ee8551bd6..1454012d3eb9 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// #include "lldb/API/SBModule.h" -#include "SBReproducerPrivate.h" #include "lldb/API/SBAddress.h" #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBModuleSpec.h" @@ -24,19 +23,18 @@ #include "lldb/Symbol/TypeSystem.h" #include "lldb/Symbol/VariableList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Instrumentation.h" #include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; -SBModule::SBModule() : m_opaque_sp() { - LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBModule); -} +SBModule::SBModule() { LLDB_INSTRUMENT_VA(this); } SBModule::SBModule(const lldb::ModuleSP &module_sp) : m_opaque_sp(module_sp) {} -SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() { - LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModuleSpec &), module_spec); +SBModule::SBModule(const SBModuleSpec &module_spec) { + LLDB_INSTRUMENT_VA(this, module_spec); ModuleSP module_sp; Status error = ModuleList::GetSharedModule( @@ -46,13 +44,11 @@ SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() { } SBModule::SBModule(const SBModule &rhs) : m_opaque_sp(rhs.m_opaque_sp) { - LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModule &), rhs); + LLDB_INSTRUMENT_VA(this, rhs); } -SBModule::SBModule(lldb::SBProcess &process, lldb::addr_t header_addr) - : m_opaque_sp() { - LLDB_RECORD_CONSTRUCTOR(SBModule, (lldb::SBProcess &, lldb::addr_t), process, - header_addr); +SBModule::SBModule(lldb::SBProcess &process, lldb::addr_t header_addr) { + LLDB_INSTRUMENT_VA(this, process, header_addr); ProcessSP process_sp(process.GetSP()); if (process_sp) { @@ -67,58 +63,69 @@ SBModule::SBModule(lldb::SBProcess &process, lldb::addr_t header_addr) } const SBModule &SBModule::operator=(const SBModule &rhs) { - LLDB_RECORD_METHOD(const lldb::SBModule &, SBModule, operator=, - (const lldb::SBModule &), rhs); + LLDB_INSTRUMENT_VA(this, rhs); if (this != &rhs) m_opaque_sp = rhs.m_opaque_sp; - return LLDB_RECORD_RESULT(*this); + return *this; } SBModule::~SBModule() = default; bool SBModule::IsValid() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBModule, IsValid); + LLDB_INSTRUMENT_VA(this); return this->operator bool(); } SBModule::operator bool() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBModule, operator bool); + LLDB_INSTRUMENT_VA(this); return m_opaque_sp.get() != nullptr; } void SBModule::Clear() { - LLDB_RECORD_METHOD_NO_ARGS(void, SBModule, Clear); + LLDB_INSTRUMENT_VA(this); m_opaque_sp.reset(); } +bool SBModule::IsFileBacked() const { + LLDB_INSTRUMENT_VA(this); + + ModuleSP module_sp(GetSP()); + if (!module_sp) + return false; + + ObjectFile *obj_file = module_sp->GetObjectFile(); + if (!obj_file) + return false; + + return !obj_file->IsInMemory(); +} + SBFileSpec SBModule::GetFileSpec() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule, GetFileSpec); + LLDB_INSTRUMENT_VA(this); SBFileSpec file_spec; ModuleSP module_sp(GetSP()); if (module_sp) file_spec.SetFileSpec(module_sp->GetFileSpec()); - return LLDB_RECORD_RESULT(file_spec); + return file_spec; } lldb::SBFileSpec SBModule::GetPlatformFileSpec() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule, - GetPlatformFileSpec); + LLDB_INSTRUMENT_VA(this); SBFileSpec file_spec; ModuleSP module_sp(GetSP()); if (module_sp) file_spec.SetFileSpec(module_sp->GetPlatformFileSpec()); - return LLDB_RECORD_RESULT(file_spec); + return file_spec; } bool SBModule::SetPlatformFileSpec(const lldb::SBFileSpec &platform_file) { - LLDB_RECORD_METHOD(bool, SBModule, SetPlatformFileSpec, - (const lldb::SBFileSpec &), platform_file); + LLDB_INSTRUMENT_VA(this, platform_file); bool result = false; @@ -132,19 +139,17 @@ bool SBModule::SetPlatformFileSpec(const lldb::SBFileSpec &platform_file) { } lldb::SBFileSpec SBModule::GetRemoteInstallFileSpec() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBFileSpec, SBModule, - GetRemoteInstallFileSpec); + LLDB_INSTRUMENT_VA(this); SBFileSpec sb_file_spec; ModuleSP module_sp(GetSP()); if (module_sp) sb_file_spec.SetFileSpec(module_sp->GetRemoteInstallFileSpec()); - return LLDB_RECORD_RESULT(sb_file_spec); + return sb_file_spec; } bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) { - LLDB_RECORD_METHOD(bool, SBModule, SetRemoteInstallFileSpec, - (lldb::SBFileSpec &), file); + LLDB_INSTRUMENT_VA(this, file); ModuleSP module_sp(GetSP()); if (module_sp) { @@ -155,7 +160,7 @@ bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) { } const uint8_t *SBModule::GetUUIDBytes() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(const uint8_t *, SBModule, GetUUIDBytes); + LLDB_INSTRUMENT_VA(this); const uint8_t *uuid_bytes = nullptr; ModuleSP module_sp(GetSP()); @@ -166,7 +171,7 @@ const uint8_t *SBModule::GetUUIDBytes() const { } const char *SBModule::GetUUIDString() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBModule, GetUUIDString); + LLDB_INSTRUMENT_VA(this); const char *uuid_cstr = nullptr; ModuleSP module_sp(GetSP()); @@ -186,8 +191,7 @@ const char *SBModule::GetUUIDString() const { } bool SBModule::operator==(const SBModule &rhs) const { - LLDB_RECORD_METHOD_CONST(bool, SBModule, operator==, (const lldb::SBModule &), - rhs); + LLDB_INSTRUMENT_VA(this, rhs); if (m_opaque_sp) return m_opaque_sp.get() == rhs.m_opaque_sp.get(); @@ -195,8 +199,7 @@ bool SBModule::operator==(const SBModule &rhs) const { } bool SBModule::operator!=(const SBModule &rhs) const { - LLDB_RECORD_METHOD_CONST(bool, SBModule, operator!=, (const lldb::SBModule &), - rhs); + LLDB_INSTRUMENT_VA(this, rhs); if (m_opaque_sp) return m_opaque_sp.get() != rhs.m_opaque_sp.get(); @@ -208,8 +211,7 @@ ModuleSP SBModule::GetSP() const { return m_opaque_sp; } void SBModule::SetSP(const ModuleSP &module_sp) { m_opaque_sp = module_sp; } SBAddress SBModule::ResolveFileAddress(lldb::addr_t vm_addr) { - LLDB_RECORD_METHOD(lldb::SBAddress, SBModule, ResolveFileAddress, - (lldb::addr_t), vm_addr); + LLDB_INSTRUMENT_VA(this, vm_addr); lldb::SBAddress sb_addr; ModuleSP module_sp(GetSP()); @@ -218,27 +220,24 @@ SBAddress SBModule::ResolveFileAddress(lldb::addr_t vm_addr) { if (module_sp->ResolveFileAddress(vm_addr, addr)) sb_addr.ref() = addr; } - return LLDB_RECORD_RESULT(sb_addr); + return sb_addr; } SBSymbolContext SBModule::ResolveSymbolContextForAddress(const SBAddress &addr, uint32_t resolve_scope) { - LLDB_RECORD_METHOD(lldb::SBSymbolContext, SBModule, - ResolveSymbolContextForAddress, - (const lldb::SBAddress &, uint32_t), addr, resolve_scope); + LLDB_INSTRUMENT_VA(this, addr, resolve_scope); SBSymbolContext sb_sc; ModuleSP module_sp(GetSP()); SymbolContextItem scope = static_cast<SymbolContextItem>(resolve_scope); if (module_sp && addr.IsValid()) module_sp->ResolveSymbolContextForAddress(addr.ref(), scope, *sb_sc); - return LLDB_RECORD_RESULT(sb_sc); + return sb_sc; } bool SBModule::GetDescription(SBStream &description) { - LLDB_RECORD_METHOD(bool, SBModule, GetDescription, (lldb::SBStream &), - description); + LLDB_INSTRUMENT_VA(this, description); Stream &strm = description.ref(); @@ -252,7 +251,7 @@ bool SBModule::GetDescription(SBStream &description) { } uint32_t SBModule::GetNumCompileUnits() { - LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBModule, GetNumCompileUnits); + LLDB_INSTRUMENT_VA(this); ModuleSP module_sp(GetSP()); if (module_sp) { @@ -262,8 +261,7 @@ uint32_t SBModule::GetNumCompileUnits() { } SBCompileUnit SBModule::GetCompileUnitAtIndex(uint32_t index) { - LLDB_RECORD_METHOD(lldb::SBCompileUnit, SBModule, GetCompileUnitAtIndex, - (uint32_t), index); + LLDB_INSTRUMENT_VA(this, index); SBCompileUnit sb_cu; ModuleSP module_sp(GetSP()); @@ -271,19 +269,18 @@ SBCompileUnit SBModule::GetCompileUnitAtIndex(uint32_t index) { CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(index); sb_cu.reset(cu_sp.get()); } - return LLDB_RECORD_RESULT(sb_cu); + return sb_cu; } SBSymbolContextList SBModule::FindCompileUnits(const SBFileSpec &sb_file_spec) { - LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBModule, FindCompileUnits, - (const lldb::SBFileSpec &), sb_file_spec); + LLDB_INSTRUMENT_VA(this, sb_file_spec); SBSymbolContextList sb_sc_list; const ModuleSP module_sp(GetSP()); if (sb_file_spec.IsValid() && module_sp) { module_sp->FindCompileUnits(*sb_file_spec, *sb_sc_list); } - return LLDB_RECORD_RESULT(sb_sc_list); + return sb_sc_list; } static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) { @@ -293,7 +290,7 @@ static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) { } size_t SBModule::GetNumSymbols() { - LLDB_RECORD_METHOD_NO_ARGS(size_t, SBModule, GetNumSymbols); + LLDB_INSTRUMENT_VA(this); ModuleSP module_sp(GetSP()); if (Symtab *symtab = GetUnifiedSymbolTable(module_sp)) @@ -302,20 +299,19 @@ size_t SBModule::GetNumSymbols() { } SBSymbol SBModule::GetSymbolAtIndex(size_t idx) { - LLDB_RECORD_METHOD(lldb::SBSymbol, SBModule, GetSymbolAtIndex, (size_t), idx); + LLDB_INSTRUMENT_VA(this, idx); SBSymbol sb_symbol; ModuleSP module_sp(GetSP()); Symtab *symtab = GetUnifiedSymbolTable(module_sp); if (symtab) sb_symbol.SetSymbol(symtab->SymbolAtIndex(idx)); - return LLDB_RECORD_RESULT(sb_symbol); + return sb_symbol; } lldb::SBSymbol SBModule::FindSymbol(const char *name, lldb::SymbolType symbol_type) { - LLDB_RECORD_METHOD(lldb::SBSymbol, SBModule, FindSymbol, - (const char *, lldb::SymbolType), name, symbol_type); + LLDB_INSTRUMENT_VA(this, name, symbol_type); SBSymbol sb_symbol; if (name && name[0]) { @@ -326,13 +322,12 @@ lldb::SBSymbol SBModule::FindSymbol(const char *name, ConstString(name), symbol_type, Symtab::eDebugAny, Symtab::eVisibilityAny)); } - return LLDB_RECORD_RESULT(sb_symbol); + return sb_symbol; } lldb::SBSymbolContextList SBModule::FindSymbols(const char *name, lldb::SymbolType symbol_type) { - LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBModule, FindSymbols, - (const char *, lldb::SymbolType), name, symbol_type); + LLDB_INSTRUMENT_VA(this, name, symbol_type); SBSymbolContextList sb_sc_list; if (name && name[0]) { @@ -355,11 +350,11 @@ lldb::SBSymbolContextList SBModule::FindSymbols(const char *name, } } } - return LLDB_RECORD_RESULT(sb_sc_list); + return sb_sc_list; } size_t SBModule::GetNumSections() { - LLDB_RECORD_METHOD_NO_ARGS(size_t, SBModule, GetNumSections); + LLDB_INSTRUMENT_VA(this); ModuleSP module_sp(GetSP()); if (module_sp) { @@ -373,8 +368,7 @@ size_t SBModule::GetNumSections() { } SBSection SBModule::GetSectionAtIndex(size_t idx) { - LLDB_RECORD_METHOD(lldb::SBSection, SBModule, GetSectionAtIndex, (size_t), - idx); + LLDB_INSTRUMENT_VA(this, idx); SBSection sb_section; ModuleSP module_sp(GetSP()); @@ -386,13 +380,12 @@ SBSection SBModule::GetSectionAtIndex(size_t idx) { if (section_list) sb_section.SetSP(section_list->GetSectionAtIndex(idx)); } - return LLDB_RECORD_RESULT(sb_section); + return sb_section; } lldb::SBSymbolContextList SBModule::FindFunctions(const char *name, uint32_t name_type_mask) { - LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBModule, FindFunctions, - (const char *, uint32_t), name, name_type_mask); + LLDB_INSTRUMENT_VA(this, name, name_type_mask); lldb::SBSymbolContextList sb_sc_list; ModuleSP module_sp(GetSP()); @@ -405,14 +398,12 @@ lldb::SBSymbolContextList SBModule::FindFunctions(const char *name, module_sp->FindFunctions(ConstString(name), CompilerDeclContext(), type, function_options, *sb_sc_list); } - return LLDB_RECORD_RESULT(sb_sc_list); + return sb_sc_list; } SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name, uint32_t max_matches) { - LLDB_RECORD_METHOD(lldb::SBValueList, SBModule, FindGlobalVariables, - (lldb::SBTarget &, const char *, uint32_t), target, name, - max_matches); + LLDB_INSTRUMENT_VA(this, target, name, max_matches); SBValueList sb_value_list; ModuleSP module_sp(GetSP()); @@ -429,23 +420,21 @@ SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name, } } - return LLDB_RECORD_RESULT(sb_value_list); + return sb_value_list; } lldb::SBValue SBModule::FindFirstGlobalVariable(lldb::SBTarget &target, const char *name) { - LLDB_RECORD_METHOD(lldb::SBValue, SBModule, FindFirstGlobalVariable, - (lldb::SBTarget &, const char *), target, name); + LLDB_INSTRUMENT_VA(this, target, name); SBValueList sb_value_list(FindGlobalVariables(target, name, 1)); if (sb_value_list.IsValid() && sb_value_list.GetSize() > 0) - return LLDB_RECORD_RESULT(sb_value_list.GetValueAtIndex(0)); - return LLDB_RECORD_RESULT(SBValue()); + return sb_value_list.GetValueAtIndex(0); + return SBValue(); } lldb::SBType SBModule::FindFirstType(const char *name_cstr) { - LLDB_RECORD_METHOD(lldb::SBType, SBModule, FindFirstType, (const char *), - name_cstr); + LLDB_INSTRUMENT_VA(this, name_cstr); SBType sb_type; ModuleSP module_sp(GetSP()); @@ -461,17 +450,16 @@ lldb::SBType SBModule::FindFirstType(const char *name_cstr) { module_sp->GetTypeSystemForLanguage(eLanguageTypeC); if (auto err = type_system_or_err.takeError()) { llvm::consumeError(std::move(err)); - return LLDB_RECORD_RESULT(SBType()); + return SBType(); } sb_type = SBType(type_system_or_err->GetBuiltinTypeByName(name)); } } - return LLDB_RECORD_RESULT(sb_type); + return sb_type; } lldb::SBType SBModule::GetBasicType(lldb::BasicType type) { - LLDB_RECORD_METHOD(lldb::SBType, SBModule, GetBasicType, (lldb::BasicType), - type); + LLDB_INSTRUMENT_VA(this, type); ModuleSP module_sp(GetSP()); if (module_sp) { @@ -480,16 +468,14 @@ lldb::SBType SBModule::GetBasicType(lldb::BasicType type) { if (auto err = type_system_or_err.takeError()) { llvm::consumeError(std::move(err)); } else { - return LLDB_RECORD_RESULT( - SBType(type_system_or_err->GetBasicTypeFromAST(type))); + return SBType(type_system_or_err->GetBasicTypeFromAST(type)); } } - return LLDB_RECORD_RESULT(SBType()); + return SBType(); } lldb::SBTypeList SBModule::FindTypes(const char *type) { - LLDB_RECORD_METHOD(lldb::SBTypeList, SBModule, FindTypes, (const char *), - type); + LLDB_INSTRUMENT_VA(this, type); SBTypeList retval; @@ -521,47 +507,44 @@ lldb::SBTypeList SBModule::FindTypes(const char *type) { } } } - return LLDB_RECORD_RESULT(retval); + return retval; } lldb::SBType SBModule::GetTypeByID(lldb::user_id_t uid) { - LLDB_RECORD_METHOD(lldb::SBType, SBModule, GetTypeByID, (lldb::user_id_t), - uid); + LLDB_INSTRUMENT_VA(this, uid); ModuleSP module_sp(GetSP()); if (module_sp) { if (SymbolFile *symfile = module_sp->GetSymbolFile()) { Type *type_ptr = symfile->ResolveTypeUID(uid); if (type_ptr) - return LLDB_RECORD_RESULT(SBType(type_ptr->shared_from_this())); + return SBType(type_ptr->shared_from_this()); } } - return LLDB_RECORD_RESULT(SBType()); + return SBType(); } lldb::SBTypeList SBModule::GetTypes(uint32_t type_mask) { - LLDB_RECORD_METHOD(lldb::SBTypeList, SBModule, GetTypes, (uint32_t), - type_mask); + LLDB_INSTRUMENT_VA(this, type_mask); SBTypeList sb_type_list; ModuleSP module_sp(GetSP()); if (!module_sp) - return LLDB_RECORD_RESULT(sb_type_list); + return sb_type_list; SymbolFile *symfile = module_sp->GetSymbolFile(); if (!symfile) - return LLDB_RECORD_RESULT(sb_type_list); + return sb_type_list; TypeClass type_class = static_cast<TypeClass>(type_mask); TypeList type_list; symfile->GetTypes(nullptr, type_class, type_list); sb_type_list.m_opaque_up->Append(type_list); - return LLDB_RECORD_RESULT(sb_type_list); + return sb_type_list; } SBSection SBModule::FindSection(const char *sect_name) { - LLDB_RECORD_METHOD(lldb::SBSection, SBModule, FindSection, (const char *), - sect_name); + LLDB_INSTRUMENT_VA(this, sect_name); SBSection sb_section; @@ -578,11 +561,11 @@ SBSection SBModule::FindSection(const char *sect_name) { } } } - return LLDB_RECORD_RESULT(sb_section); + return sb_section; } lldb::ByteOrder SBModule::GetByteOrder() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::ByteOrder, SBModule, GetByteOrder); + LLDB_INSTRUMENT_VA(this); ModuleSP module_sp(GetSP()); if (module_sp) @@ -591,7 +574,7 @@ lldb::ByteOrder SBModule::GetByteOrder() { } const char *SBModule::GetTriple() { - LLDB_RECORD_METHOD_NO_ARGS(const char *, SBModule, GetTriple); + LLDB_INSTRUMENT_VA(this); ModuleSP module_sp(GetSP()); if (module_sp) { @@ -606,7 +589,7 @@ const char *SBModule::GetTriple() { } uint32_t SBModule::GetAddressByteSize() { - LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBModule, GetAddressByteSize); + LLDB_INSTRUMENT_VA(this); ModuleSP module_sp(GetSP()); if (module_sp) @@ -615,8 +598,7 @@ uint32_t SBModule::GetAddressByteSize() { } uint32_t SBModule::GetVersion(uint32_t *versions, uint32_t num_versions) { - LLDB_RECORD_METHOD(uint32_t, SBModule, GetVersion, (uint32_t *, uint32_t), - versions, num_versions); + LLDB_INSTRUMENT_VA(this, versions, num_versions); llvm::VersionTuple version; if (ModuleSP module_sp = GetSP()) @@ -644,8 +626,7 @@ uint32_t SBModule::GetVersion(uint32_t *versions, uint32_t num_versions) { } lldb::SBFileSpec SBModule::GetSymbolFileSpec() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule, - GetSymbolFileSpec); + LLDB_INSTRUMENT_VA(this); lldb::SBFileSpec sb_file_spec; ModuleSP module_sp(GetSP()); @@ -653,12 +634,11 @@ lldb::SBFileSpec SBModule::GetSymbolFileSpec() const { if (SymbolFile *symfile = module_sp->GetSymbolFile()) sb_file_spec.SetFileSpec(symfile->GetObjectFile()->GetFileSpec()); } - return LLDB_RECORD_RESULT(sb_file_spec); + return sb_file_spec; } lldb::SBAddress SBModule::GetObjectFileHeaderAddress() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBAddress, SBModule, - GetObjectFileHeaderAddress); + LLDB_INSTRUMENT_VA(this); lldb::SBAddress sb_addr; ModuleSP module_sp(GetSP()); @@ -667,12 +647,11 @@ lldb::SBAddress SBModule::GetObjectFileHeaderAddress() const { if (objfile_ptr) sb_addr.ref() = objfile_ptr->GetBaseAddress(); } - return LLDB_RECORD_RESULT(sb_addr); + return sb_addr; } lldb::SBAddress SBModule::GetObjectFileEntryPointAddress() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBAddress, SBModule, - GetObjectFileEntryPointAddress); + LLDB_INSTRUMENT_VA(this); lldb::SBAddress sb_addr; ModuleSP module_sp(GetSP()); @@ -681,96 +660,18 @@ lldb::SBAddress SBModule::GetObjectFileEntryPointAddress() const { if (objfile_ptr) sb_addr.ref() = objfile_ptr->GetEntryPointAddress(); } - return LLDB_RECORD_RESULT(sb_addr); + return sb_addr; } uint32_t SBModule::GetNumberAllocatedModules() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(uint32_t, SBModule, - GetNumberAllocatedModules); + LLDB_INSTRUMENT(); return Module::GetNumberAllocatedModules(); } void SBModule::GarbageCollectAllocatedModules() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(void, SBModule, - GarbageCollectAllocatedModules); + LLDB_INSTRUMENT(); const bool mandatory = false; ModuleList::RemoveOrphanSharedModules(mandatory); } - -namespace lldb_private { -namespace repro { - -template <> void RegisterMethods<SBModule>(Registry &R) { - LLDB_REGISTER_CONSTRUCTOR(SBModule, ()); - LLDB_REGISTER_CONSTRUCTOR(SBModule, (const lldb::SBModuleSpec &)); - LLDB_REGISTER_CONSTRUCTOR(SBModule, (const lldb::SBModule &)); - LLDB_REGISTER_CONSTRUCTOR(SBModule, (lldb::SBProcess &, lldb::addr_t)); - LLDB_REGISTER_METHOD(const lldb::SBModule &, SBModule, operator=, - (const lldb::SBModule &)); - LLDB_REGISTER_METHOD_CONST(bool, SBModule, IsValid, ()); - LLDB_REGISTER_METHOD_CONST(bool, SBModule, operator bool, ()); - LLDB_REGISTER_METHOD(void, SBModule, Clear, ()); - LLDB_REGISTER_METHOD_CONST(lldb::SBFileSpec, SBModule, GetFileSpec, ()); - LLDB_REGISTER_METHOD_CONST(lldb::SBFileSpec, SBModule, GetPlatformFileSpec, - ()); - LLDB_REGISTER_METHOD(bool, SBModule, SetPlatformFileSpec, - (const lldb::SBFileSpec &)); - LLDB_REGISTER_METHOD(lldb::SBFileSpec, SBModule, GetRemoteInstallFileSpec, - ()); - LLDB_REGISTER_METHOD(bool, SBModule, SetRemoteInstallFileSpec, - (lldb::SBFileSpec &)); - LLDB_REGISTER_METHOD_CONST(const char *, SBModule, GetUUIDString, ()); - LLDB_REGISTER_METHOD_CONST(bool, SBModule, operator==, - (const lldb::SBModule &)); - LLDB_REGISTER_METHOD_CONST(bool, SBModule, operator!=, - (const lldb::SBModule &)); - LLDB_REGISTER_METHOD(lldb::SBAddress, SBModule, ResolveFileAddress, - (lldb::addr_t)); - LLDB_REGISTER_METHOD(lldb::SBSymbolContext, SBModule, - ResolveSymbolContextForAddress, - (const lldb::SBAddress &, uint32_t)); - LLDB_REGISTER_METHOD(bool, SBModule, GetDescription, (lldb::SBStream &)); - LLDB_REGISTER_METHOD(uint32_t, SBModule, GetNumCompileUnits, ()); - LLDB_REGISTER_METHOD(lldb::SBCompileUnit, SBModule, GetCompileUnitAtIndex, - (uint32_t)); - LLDB_REGISTER_METHOD(lldb::SBSymbolContextList, SBModule, FindCompileUnits, - (const lldb::SBFileSpec &)); - LLDB_REGISTER_METHOD(size_t, SBModule, GetNumSymbols, ()); - LLDB_REGISTER_METHOD(lldb::SBSymbol, SBModule, GetSymbolAtIndex, (size_t)); - LLDB_REGISTER_METHOD(lldb::SBSymbol, SBModule, FindSymbol, - (const char *, lldb::SymbolType)); - LLDB_REGISTER_METHOD(lldb::SBSymbolContextList, SBModule, FindSymbols, - (const char *, lldb::SymbolType)); - LLDB_REGISTER_METHOD(size_t, SBModule, GetNumSections, ()); - LLDB_REGISTER_METHOD(lldb::SBSection, SBModule, GetSectionAtIndex, (size_t)); - LLDB_REGISTER_METHOD(lldb::SBSymbolContextList, SBModule, FindFunctions, - (const char *, uint32_t)); - LLDB_REGISTER_METHOD(lldb::SBValueList, SBModule, FindGlobalVariables, - (lldb::SBTarget &, const char *, uint32_t)); - LLDB_REGISTER_METHOD(lldb::SBValue, SBModule, FindFirstGlobalVariable, - (lldb::SBTarget &, const char *)); - LLDB_REGISTER_METHOD(lldb::SBType, SBModule, FindFirstType, (const char *)); - LLDB_REGISTER_METHOD(lldb::SBType, SBModule, GetBasicType, (lldb::BasicType)); - LLDB_REGISTER_METHOD(lldb::SBTypeList, SBModule, FindTypes, (const char *)); - LLDB_REGISTER_METHOD(lldb::SBType, SBModule, GetTypeByID, (lldb::user_id_t)); - LLDB_REGISTER_METHOD(lldb::SBTypeList, SBModule, GetTypes, (uint32_t)); - LLDB_REGISTER_METHOD(lldb::SBSection, SBModule, FindSection, (const char *)); - LLDB_REGISTER_METHOD(lldb::ByteOrder, SBModule, GetByteOrder, ()); - LLDB_REGISTER_METHOD(const char *, SBModule, GetTriple, ()); - LLDB_REGISTER_METHOD(uint32_t, SBModule, GetAddressByteSize, ()); - LLDB_REGISTER_METHOD(uint32_t, SBModule, GetVersion, (uint32_t *, uint32_t)); - LLDB_REGISTER_METHOD_CONST(lldb::SBFileSpec, SBModule, GetSymbolFileSpec, ()); - LLDB_REGISTER_METHOD_CONST(lldb::SBAddress, SBModule, - GetObjectFileHeaderAddress, ()); - LLDB_REGISTER_METHOD_CONST(lldb::SBAddress, SBModule, - GetObjectFileEntryPointAddress, ()); - LLDB_REGISTER_STATIC_METHOD(uint32_t, SBModule, GetNumberAllocatedModules, - ()); - LLDB_REGISTER_STATIC_METHOD(void, SBModule, GarbageCollectAllocatedModules, - ()); -} - -} // namespace repro -} // namespace lldb_private |