Skip to content

Commit

Permalink
[lldb] Add missing LLDB_REGISTER for GarbageCollectAllocatedModules
Browse files Browse the repository at this point in the history
Add the missing LLDB_REGISTER_STATIC_METHOD macro and format the file.
  • Loading branch information
JDevlieghere committed Aug 17, 2020
1 parent b0ceff9 commit e095e98
Showing 1 changed file with 23 additions and 28 deletions.
51 changes: 23 additions & 28 deletions lldb/source/API/SBModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ 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_RECORD_METHOD(const lldb::SBModule &, SBModule, operator=,
(const lldb::SBModule &), rhs);

if (this != &rhs)
m_opaque_sp = rhs.m_opaque_sp;
Expand Down Expand Up @@ -108,7 +108,6 @@ lldb::SBFileSpec SBModule::GetPlatformFileSpec() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule,
GetPlatformFileSpec);


SBFileSpec file_spec;
ModuleSP module_sp(GetSP());
if (module_sp)
Expand Down Expand Up @@ -187,7 +186,7 @@ const char *SBModule::GetUUIDString() const {
}

bool SBModule::operator==(const SBModule &rhs) const {
LLDB_RECORD_METHOD_CONST(bool, SBModule, operator==,(const lldb::SBModule &),
LLDB_RECORD_METHOD_CONST(bool, SBModule, operator==, (const lldb::SBModule &),
rhs);

if (m_opaque_sp)
Expand All @@ -196,7 +195,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 &),
LLDB_RECORD_METHOD_CONST(bool, SBModule, operator!=, (const lldb::SBModule &),
rhs);

if (m_opaque_sp)
Expand Down Expand Up @@ -625,7 +624,7 @@ uint32_t SBModule::GetVersion(uint32_t *versions, uint32_t num_versions) {
++result;
if (version.getMinor())
++result;
if(version.getSubminor())
if (version.getSubminor())
++result;

if (!versions)
Expand Down Expand Up @@ -693,21 +692,21 @@ uint32_t SBModule::GetNumberAllocatedModules() {
void SBModule::GarbageCollectAllocatedModules() {
LLDB_RECORD_STATIC_METHOD_NO_ARGS(void, SBModule,
GarbageCollectAllocatedModules);

const bool mandatory = false;
ModuleList::RemoveOrphanSharedModules(mandatory);
}

namespace lldb_private {
namespace repro {

template <>
void RegisterMethods<SBModule>(Registry &R) {
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 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, ());
Expand All @@ -721,10 +720,10 @@ void RegisterMethods<SBModule>(Registry &R) {
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_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,
Expand All @@ -743,37 +742,33 @@ void RegisterMethods<SBModule>(Registry &R) {
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::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::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::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::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(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

0 comments on commit e095e98

Please sign in to comment.