[lldb/API] Implement the copy (assignment) constructor for SBPlatform

Currently the constructor is compiler generated which means it doesn't
get instrumented for the reproducers.
This commit is contained in:
Jonas Devlieghere 2020-01-28 16:13:15 -08:00
parent ce70eb76ea
commit 66dc467228
2 changed files with 19 additions and 0 deletions

View File

@ -89,6 +89,10 @@ public:
SBPlatform(const char *platform_name);
SBPlatform(const SBPlatform &rhs);
void operator=(const SBPlatform &rhs);
~SBPlatform();
explicit operator bool() const;

View File

@ -273,6 +273,19 @@ SBPlatform::SBPlatform(const char *platform_name) : m_opaque_sp() {
m_opaque_sp = Platform::Create(ConstString(platform_name), error);
}
SBPlatform::SBPlatform(const SBPlatform &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBPlatform, (const lldb::SBPlatform &), rhs);
m_opaque_sp = rhs.m_opaque_sp;
}
void SBPlatform::operator=(const SBPlatform &rhs) {
LLDB_RECORD_METHOD(void, SBPlatform, operator=,(const lldb::SBPlatform &),
rhs);
m_opaque_sp = rhs.m_opaque_sp;
}
SBPlatform::~SBPlatform() {}
bool SBPlatform::IsValid() const {
@ -666,6 +679,8 @@ template <>
void RegisterMethods<SBPlatform>(Registry &R) {
LLDB_REGISTER_CONSTRUCTOR(SBPlatform, ());
LLDB_REGISTER_CONSTRUCTOR(SBPlatform, (const char *));
LLDB_REGISTER_CONSTRUCTOR(SBPlatform, (const lldb::SBPlatform &));
LLDB_REGISTER_METHOD(void, SBPlatform, operator=,(const lldb::SBPlatform &));
LLDB_REGISTER_METHOD_CONST(bool, SBPlatform, IsValid, ());
LLDB_REGISTER_METHOD_CONST(bool, SBPlatform, operator bool, ());
LLDB_REGISTER_METHOD(void, SBPlatform, Clear, ());