From 66dc467228789cbe94a125d7fdedf42556052ad3 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 28 Jan 2020 16:13:15 -0800 Subject: [PATCH] [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. --- lldb/include/lldb/API/SBPlatform.h | 4 ++++ lldb/source/API/SBPlatform.cpp | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lldb/include/lldb/API/SBPlatform.h b/lldb/include/lldb/API/SBPlatform.h index 7207b2e..9e3d03e 100644 --- a/lldb/include/lldb/API/SBPlatform.h +++ b/lldb/include/lldb/API/SBPlatform.h @@ -89,6 +89,10 @@ public: SBPlatform(const char *platform_name); + SBPlatform(const SBPlatform &rhs); + + void operator=(const SBPlatform &rhs); + ~SBPlatform(); explicit operator bool() const; diff --git a/lldb/source/API/SBPlatform.cpp b/lldb/source/API/SBPlatform.cpp index 8f98d2d..76b8515 100644 --- a/lldb/source/API/SBPlatform.cpp +++ b/lldb/source/API/SBPlatform.cpp @@ -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(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, ()); -- 2.7.4