diff options
Diffstat (limited to 'source/API/SBModule.cpp')
-rw-r--r-- | source/API/SBModule.cpp | 339 |
1 files changed, 252 insertions, 87 deletions
diff --git a/source/API/SBModule.cpp b/source/API/SBModule.cpp index 31980793bce0a..4bd32bce1c532 100644 --- a/source/API/SBModule.cpp +++ b/source/API/SBModule.cpp @@ -1,13 +1,13 @@ //===-- SBModule.cpp --------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "lldb/API/SBModule.h" +#include "SBReproducerPrivate.h" #include "lldb/API/SBAddress.h" #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBModuleSpec.h" @@ -25,28 +25,36 @@ #include "lldb/Symbol/TypeSystem.h" #include "lldb/Symbol/VariableList.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; -SBModule::SBModule() : m_opaque_sp() {} +SBModule::SBModule() : m_opaque_sp() { + LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBModule); +} 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); + ModuleSP module_sp; - Status error = ModuleList::GetSharedModule(*module_spec.m_opaque_ap, - module_sp, NULL, NULL, NULL); + Status error = ModuleList::GetSharedModule( + *module_spec.m_opaque_up, module_sp, nullptr, nullptr, nullptr); if (module_sp) SetSP(module_sp); } -SBModule::SBModule(const SBModule &rhs) : m_opaque_sp(rhs.m_opaque_sp) {} +SBModule::SBModule(const SBModule &rhs) : m_opaque_sp(rhs.m_opaque_sp) { + LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModule &), 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); + ProcessSP process_sp(process.GetSP()); if (process_sp) { m_opaque_sp = process_sp->ReadModuleFromMemory(FileSpec(), header_addr); @@ -60,52 +68,61 @@ 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); + if (this != &rhs) m_opaque_sp = rhs.m_opaque_sp; - return *this; + return LLDB_RECORD_RESULT(*this); } SBModule::~SBModule() {} -bool SBModule::IsValid() const { return m_opaque_sp.get() != NULL; } +bool SBModule::IsValid() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBModule, IsValid); + return this->operator bool(); +} +SBModule::operator bool() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBModule, operator bool); -void SBModule::Clear() { m_opaque_sp.reset(); } + return m_opaque_sp.get() != nullptr; +} + +void SBModule::Clear() { + LLDB_RECORD_METHOD_NO_ARGS(void, SBModule, Clear); + + m_opaque_sp.reset(); +} SBFileSpec SBModule::GetFileSpec() const { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); + LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule, GetFileSpec); SBFileSpec file_spec; ModuleSP module_sp(GetSP()); if (module_sp) file_spec.SetFileSpec(module_sp->GetFileSpec()); - if (log) - log->Printf("SBModule(%p)::GetFileSpec () => SBFileSpec(%p)", - static_cast<void *>(module_sp.get()), - static_cast<const void *>(file_spec.get())); - - return file_spec; + return LLDB_RECORD_RESULT(file_spec); } lldb::SBFileSpec SBModule::GetPlatformFileSpec() const { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); + LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule, + GetPlatformFileSpec); + SBFileSpec file_spec; ModuleSP module_sp(GetSP()); if (module_sp) file_spec.SetFileSpec(module_sp->GetPlatformFileSpec()); - if (log) - log->Printf("SBModule(%p)::GetPlatformFileSpec () => SBFileSpec(%p)", - static_cast<void *>(module_sp.get()), - static_cast<const void *>(file_spec.get())); - - return file_spec; + return LLDB_RECORD_RESULT(file_spec); } bool SBModule::SetPlatformFileSpec(const lldb::SBFileSpec &platform_file) { + LLDB_RECORD_METHOD(bool, SBModule, SetPlatformFileSpec, + (const lldb::SBFileSpec &), platform_file); + bool result = false; - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); ModuleSP module_sp(GetSP()); if (module_sp) { @@ -113,23 +130,24 @@ bool SBModule::SetPlatformFileSpec(const lldb::SBFileSpec &platform_file) { result = true; } - if (log) - log->Printf("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s)) => %i", - static_cast<void *>(module_sp.get()), - static_cast<const void *>(platform_file.get()), - platform_file->GetPath().c_str(), result); return result; } lldb::SBFileSpec SBModule::GetRemoteInstallFileSpec() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::SBFileSpec, SBModule, + GetRemoteInstallFileSpec); + SBFileSpec sb_file_spec; ModuleSP module_sp(GetSP()); if (module_sp) sb_file_spec.SetFileSpec(module_sp->GetRemoteInstallFileSpec()); - return sb_file_spec; + return LLDB_RECORD_RESULT(sb_file_spec); } bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) { + LLDB_RECORD_METHOD(bool, SBModule, SetRemoteInstallFileSpec, + (lldb::SBFileSpec &), file); + ModuleSP module_sp(GetSP()); if (module_sp) { module_sp->SetRemoteInstallFileSpec(file.ref()); @@ -139,30 +157,20 @@ bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) { } const uint8_t *SBModule::GetUUIDBytes() const { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); + LLDB_RECORD_METHOD_CONST_NO_ARGS(const uint8_t *, SBModule, GetUUIDBytes); - const uint8_t *uuid_bytes = NULL; + const uint8_t *uuid_bytes = nullptr; ModuleSP module_sp(GetSP()); if (module_sp) uuid_bytes = module_sp->GetUUID().GetBytes().data(); - if (log) { - if (uuid_bytes) { - StreamString s; - module_sp->GetUUID().Dump(&s); - log->Printf("SBModule(%p)::GetUUIDBytes () => %s", - static_cast<void *>(module_sp.get()), s.GetData()); - } else - log->Printf("SBModule(%p)::GetUUIDBytes () => NULL", - static_cast<void *>(module_sp.get())); - } return uuid_bytes; } const char *SBModule::GetUUIDString() const { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); + LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBModule, GetUUIDString); - const char *uuid_cstr = NULL; + const char *uuid_cstr = nullptr; ModuleSP module_sp(GetSP()); if (module_sp) { // We are going to return a "const char *" value through the public API, so @@ -173,25 +181,25 @@ const char *SBModule::GetUUIDString() const { } if (uuid_cstr && uuid_cstr[0]) { - if (log) - log->Printf("SBModule(%p)::GetUUIDString () => %s", - static_cast<void *>(module_sp.get()), uuid_cstr); return uuid_cstr; } - if (log) - log->Printf("SBModule(%p)::GetUUIDString () => NULL", - static_cast<void *>(module_sp.get())); - return NULL; + return nullptr; } bool SBModule::operator==(const SBModule &rhs) const { + LLDB_RECORD_METHOD_CONST(bool, SBModule, operator==,(const lldb::SBModule &), + rhs); + if (m_opaque_sp) return m_opaque_sp.get() == rhs.m_opaque_sp.get(); return false; } bool SBModule::operator!=(const SBModule &rhs) const { + LLDB_RECORD_METHOD_CONST(bool, SBModule, operator!=,(const lldb::SBModule &), + rhs); + if (m_opaque_sp) return m_opaque_sp.get() != rhs.m_opaque_sp.get(); return false; @@ -202,6 +210,9 @@ 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::SBAddress sb_addr; ModuleSP module_sp(GetSP()); if (module_sp) { @@ -209,21 +220,28 @@ SBAddress SBModule::ResolveFileAddress(lldb::addr_t vm_addr) { if (module_sp->ResolveFileAddress(vm_addr, addr)) sb_addr.ref() = addr; } - return sb_addr; + return LLDB_RECORD_RESULT(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); + 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 sb_sc; + return LLDB_RECORD_RESULT(sb_sc); } bool SBModule::GetDescription(SBStream &description) { + LLDB_RECORD_METHOD(bool, SBModule, GetDescription, (lldb::SBStream &), + description); + Stream &strm = description.ref(); ModuleSP module_sp(GetSP()); @@ -236,6 +254,8 @@ bool SBModule::GetDescription(SBStream &description) { } uint32_t SBModule::GetNumCompileUnits() { + LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBModule, GetNumCompileUnits); + ModuleSP module_sp(GetSP()); if (module_sp) { return module_sp->GetNumCompileUnits(); @@ -244,24 +264,29 @@ uint32_t SBModule::GetNumCompileUnits() { } SBCompileUnit SBModule::GetCompileUnitAtIndex(uint32_t index) { + LLDB_RECORD_METHOD(lldb::SBCompileUnit, SBModule, GetCompileUnitAtIndex, + (uint32_t), index); + SBCompileUnit sb_cu; ModuleSP module_sp(GetSP()); if (module_sp) { CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(index); sb_cu.reset(cu_sp.get()); } - return sb_cu; + return LLDB_RECORD_RESULT(sb_cu); } -SBSymbolContextList -SBModule::FindCompileUnits(const SBFileSpec &sb_file_spec) { +SBSymbolContextList SBModule::FindCompileUnits(const SBFileSpec &sb_file_spec) { + LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBModule, FindCompileUnits, + (const lldb::SBFileSpec &), sb_file_spec); + SBSymbolContextList sb_sc_list; const ModuleSP module_sp(GetSP()); if (sb_file_spec.IsValid() && module_sp) { const bool append = true; module_sp->FindCompileUnits(*sb_file_spec, append, *sb_sc_list); } - return sb_sc_list; + return LLDB_RECORD_RESULT(sb_sc_list); } static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) { @@ -270,10 +295,12 @@ static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) { if (symbols) return symbols->GetSymtab(); } - return NULL; + return nullptr; } size_t SBModule::GetNumSymbols() { + LLDB_RECORD_METHOD_NO_ARGS(size_t, SBModule, GetNumSymbols); + ModuleSP module_sp(GetSP()); if (module_sp) { Symtab *symtab = GetUnifiedSymbolTable(module_sp); @@ -284,16 +311,21 @@ size_t SBModule::GetNumSymbols() { } SBSymbol SBModule::GetSymbolAtIndex(size_t idx) { + LLDB_RECORD_METHOD(lldb::SBSymbol, SBModule, GetSymbolAtIndex, (size_t), idx); + SBSymbol sb_symbol; ModuleSP module_sp(GetSP()); Symtab *symtab = GetUnifiedSymbolTable(module_sp); if (symtab) sb_symbol.SetSymbol(symtab->SymbolAtIndex(idx)); - return sb_symbol; + return LLDB_RECORD_RESULT(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); + SBSymbol sb_symbol; if (name && name[0]) { ModuleSP module_sp(GetSP()); @@ -303,11 +335,14 @@ lldb::SBSymbol SBModule::FindSymbol(const char *name, ConstString(name), symbol_type, Symtab::eDebugAny, Symtab::eVisibilityAny)); } - return sb_symbol; + return LLDB_RECORD_RESULT(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); + SBSymbolContextList sb_sc_list; if (name && name[0]) { ModuleSP module_sp(GetSP()); @@ -328,10 +363,12 @@ lldb::SBSymbolContextList SBModule::FindSymbols(const char *name, } } } - return sb_sc_list; + return LLDB_RECORD_RESULT(sb_sc_list); } size_t SBModule::GetNumSections() { + LLDB_RECORD_METHOD_NO_ARGS(size_t, SBModule, GetNumSections); + ModuleSP module_sp(GetSP()); if (module_sp) { // Give the symbol vendor a chance to add to the unified section list. @@ -344,6 +381,9 @@ size_t SBModule::GetNumSections() { } SBSection SBModule::GetSectionAtIndex(size_t idx) { + LLDB_RECORD_METHOD(lldb::SBSection, SBModule, GetSectionAtIndex, (size_t), + idx); + SBSection sb_section; ModuleSP module_sp(GetSP()); if (module_sp) { @@ -354,11 +394,14 @@ SBSection SBModule::GetSectionAtIndex(size_t idx) { if (section_list) sb_section.SetSP(section_list->GetSectionAtIndex(idx)); } - return sb_section; + return LLDB_RECORD_RESULT(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::SBSymbolContextList sb_sc_list; ModuleSP module_sp(GetSP()); if (name && module_sp) { @@ -366,20 +409,24 @@ lldb::SBSymbolContextList SBModule::FindFunctions(const char *name, const bool symbols_ok = true; const bool inlines_ok = true; FunctionNameType type = static_cast<FunctionNameType>(name_type_mask); - module_sp->FindFunctions(ConstString(name), NULL, type, symbols_ok, + module_sp->FindFunctions(ConstString(name), nullptr, type, symbols_ok, inlines_ok, append, *sb_sc_list); } - return sb_sc_list; + return LLDB_RECORD_RESULT(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); + SBValueList sb_value_list; ModuleSP module_sp(GetSP()); if (name && module_sp) { VariableList variable_list; const uint32_t match_count = module_sp->FindGlobalVariables( - ConstString(name), NULL, max_matches, variable_list); + ConstString(name), nullptr, max_matches, variable_list); if (match_count > 0) { for (uint32_t i = 0; i < match_count; ++i) { @@ -393,18 +440,24 @@ SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name, } } - return sb_value_list; + return LLDB_RECORD_RESULT(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); + SBValueList sb_value_list(FindGlobalVariables(target, name, 1)); if (sb_value_list.IsValid() && sb_value_list.GetSize() > 0) - return sb_value_list.GetValueAtIndex(0); - return SBValue(); + return LLDB_RECORD_RESULT(sb_value_list.GetValueAtIndex(0)); + return LLDB_RECORD_RESULT(SBValue()); } lldb::SBType SBModule::FindFirstType(const char *name_cstr) { + LLDB_RECORD_METHOD(lldb::SBType, SBModule, FindFirstType, (const char *), + name_cstr); + SBType sb_type; ModuleSP module_sp(GetSP()); if (name_cstr && module_sp) { @@ -421,21 +474,27 @@ lldb::SBType SBModule::FindFirstType(const char *name_cstr) { sb_type = SBType(type_system->GetBuiltinTypeByName(name)); } } - return sb_type; + return LLDB_RECORD_RESULT(sb_type); } lldb::SBType SBModule::GetBasicType(lldb::BasicType type) { + LLDB_RECORD_METHOD(lldb::SBType, SBModule, GetBasicType, (lldb::BasicType), + type); + ModuleSP module_sp(GetSP()); if (module_sp) { TypeSystem *type_system = module_sp->GetTypeSystemForLanguage(eLanguageTypeC); if (type_system) - return SBType(type_system->GetBasicTypeFromAST(type)); + return LLDB_RECORD_RESULT(SBType(type_system->GetBasicTypeFromAST(type))); } - return SBType(); + return LLDB_RECORD_RESULT(SBType()); } lldb::SBTypeList SBModule::FindTypes(const char *type) { + LLDB_RECORD_METHOD(lldb::SBTypeList, SBModule, FindTypes, (const char *), + type); + SBTypeList retval; ModuleSP module_sp(GetSP()); @@ -464,40 +523,49 @@ lldb::SBTypeList SBModule::FindTypes(const char *type) { } } - return retval; + return LLDB_RECORD_RESULT(retval); } lldb::SBType SBModule::GetTypeByID(lldb::user_id_t uid) { + LLDB_RECORD_METHOD(lldb::SBType, SBModule, GetTypeByID, (lldb::user_id_t), + uid); + ModuleSP module_sp(GetSP()); if (module_sp) { SymbolVendor *vendor = module_sp->GetSymbolVendor(); if (vendor) { Type *type_ptr = vendor->ResolveTypeUID(uid); if (type_ptr) - return SBType(type_ptr->shared_from_this()); + return LLDB_RECORD_RESULT(SBType(type_ptr->shared_from_this())); } } - return SBType(); + return LLDB_RECORD_RESULT(SBType()); } lldb::SBTypeList SBModule::GetTypes(uint32_t type_mask) { + LLDB_RECORD_METHOD(lldb::SBTypeList, SBModule, GetTypes, (uint32_t), + type_mask); + SBTypeList sb_type_list; ModuleSP module_sp(GetSP()); if (!module_sp) - return sb_type_list; + return LLDB_RECORD_RESULT(sb_type_list); SymbolVendor *vendor = module_sp->GetSymbolVendor(); if (!vendor) - return sb_type_list; + return LLDB_RECORD_RESULT(sb_type_list); TypeClass type_class = static_cast<TypeClass>(type_mask); TypeList type_list; - vendor->GetTypes(NULL, type_class, type_list); - sb_type_list.m_opaque_ap->Append(type_list); - return sb_type_list; + vendor->GetTypes(nullptr, type_class, type_list); + sb_type_list.m_opaque_up->Append(type_list); + return LLDB_RECORD_RESULT(sb_type_list); } SBSection SBModule::FindSection(const char *sect_name) { + LLDB_RECORD_METHOD(lldb::SBSection, SBModule, FindSection, (const char *), + sect_name); + SBSection sb_section; ModuleSP module_sp(GetSP()); @@ -513,10 +581,12 @@ SBSection SBModule::FindSection(const char *sect_name) { } } } - return sb_section; + return LLDB_RECORD_RESULT(sb_section); } lldb::ByteOrder SBModule::GetByteOrder() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::ByteOrder, SBModule, GetByteOrder); + ModuleSP module_sp(GetSP()); if (module_sp) return module_sp->GetArchitecture().GetByteOrder(); @@ -524,6 +594,8 @@ lldb::ByteOrder SBModule::GetByteOrder() { } const char *SBModule::GetTriple() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBModule, GetTriple); + ModuleSP module_sp(GetSP()); if (module_sp) { std::string triple(module_sp->GetArchitecture().GetTriple().str()); @@ -533,10 +605,12 @@ const char *SBModule::GetTriple() { ConstString const_triple(triple.c_str()); return const_triple.GetCString(); } - return NULL; + return nullptr; } uint32_t SBModule::GetAddressByteSize() { + LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBModule, GetAddressByteSize); + ModuleSP module_sp(GetSP()); if (module_sp) return module_sp->GetArchitecture().GetAddressByteSize(); @@ -544,6 +618,9 @@ 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); + llvm::VersionTuple version; if (ModuleSP module_sp = GetSP()) version = module_sp->GetVersion(); @@ -570,6 +647,9 @@ 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::SBFileSpec sb_file_spec; ModuleSP module_sp(GetSP()); if (module_sp) { @@ -577,10 +657,13 @@ lldb::SBFileSpec SBModule::GetSymbolFileSpec() const { if (symbol_vendor_ptr) sb_file_spec.SetFileSpec(symbol_vendor_ptr->GetMainFileSpec()); } - return sb_file_spec; + return LLDB_RECORD_RESULT(sb_file_spec); } lldb::SBAddress SBModule::GetObjectFileHeaderAddress() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBAddress, SBModule, + GetObjectFileHeaderAddress); + lldb::SBAddress sb_addr; ModuleSP module_sp(GetSP()); if (module_sp) { @@ -588,10 +671,13 @@ lldb::SBAddress SBModule::GetObjectFileHeaderAddress() const { if (objfile_ptr) sb_addr.ref() = objfile_ptr->GetBaseAddress(); } - return sb_addr; + return LLDB_RECORD_RESULT(sb_addr); } lldb::SBAddress SBModule::GetObjectFileEntryPointAddress() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBAddress, SBModule, + GetObjectFileEntryPointAddress); + lldb::SBAddress sb_addr; ModuleSP module_sp(GetSP()); if (module_sp) { @@ -599,5 +685,84 @@ lldb::SBAddress SBModule::GetObjectFileEntryPointAddress() const { if (objfile_ptr) sb_addr.ref() = objfile_ptr->GetEntryPointAddress(); } - return sb_addr; + return LLDB_RECORD_RESULT(sb_addr); +} + +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, ()); +} + +} } |