diff options
Diffstat (limited to 'lldb/source/API/SBCommunication.cpp')
| -rw-r--r-- | lldb/source/API/SBCommunication.cpp | 83 |
1 files changed, 20 insertions, 63 deletions
diff --git a/lldb/source/API/SBCommunication.cpp b/lldb/source/API/SBCommunication.cpp index 9a2ab89d5e4e..0a1dad1e2e8f 100644 --- a/lldb/source/API/SBCommunication.cpp +++ b/lldb/source/API/SBCommunication.cpp @@ -7,22 +7,20 @@ //===----------------------------------------------------------------------===// #include "lldb/API/SBCommunication.h" -#include "SBReproducerPrivate.h" #include "lldb/API/SBBroadcaster.h" #include "lldb/Core/Communication.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/Host.h" +#include "lldb/Utility/Instrumentation.h" using namespace lldb; using namespace lldb_private; -SBCommunication::SBCommunication() { - LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBCommunication); -} +SBCommunication::SBCommunication() { LLDB_INSTRUMENT_VA(this); } SBCommunication::SBCommunication(const char *broadcaster_name) : m_opaque(new Communication(broadcaster_name)), m_opaque_owned(true) { - LLDB_RECORD_CONSTRUCTOR(SBCommunication, (const char *), broadcaster_name); + LLDB_INSTRUMENT_VA(this, broadcaster_name); } SBCommunication::~SBCommunication() { @@ -33,17 +31,17 @@ SBCommunication::~SBCommunication() { } bool SBCommunication::IsValid() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommunication, IsValid); + LLDB_INSTRUMENT_VA(this); return this->operator bool(); } SBCommunication::operator bool() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommunication, operator bool); + LLDB_INSTRUMENT_VA(this); return m_opaque != nullptr; } bool SBCommunication::GetCloseOnEOF() { - LLDB_RECORD_METHOD_NO_ARGS(bool, SBCommunication, GetCloseOnEOF); + LLDB_INSTRUMENT_VA(this); if (m_opaque) return m_opaque->GetCloseOnEOF(); @@ -51,15 +49,14 @@ bool SBCommunication::GetCloseOnEOF() { } void SBCommunication::SetCloseOnEOF(bool b) { - LLDB_RECORD_METHOD(void, SBCommunication, SetCloseOnEOF, (bool), b); + LLDB_INSTRUMENT_VA(this, b); if (m_opaque) m_opaque->SetCloseOnEOF(b); } ConnectionStatus SBCommunication::Connect(const char *url) { - LLDB_RECORD_METHOD(lldb::ConnectionStatus, SBCommunication, Connect, - (const char *), url); + LLDB_INSTRUMENT_VA(this, url); if (m_opaque) { if (!m_opaque->HasConnection()) @@ -70,8 +67,7 @@ ConnectionStatus SBCommunication::Connect(const char *url) { } ConnectionStatus SBCommunication::AdoptFileDesriptor(int fd, bool owns_fd) { - LLDB_RECORD_METHOD(lldb::ConnectionStatus, SBCommunication, - AdoptFileDesriptor, (int, bool), fd, owns_fd); + LLDB_INSTRUMENT_VA(this, fd, owns_fd); ConnectionStatus status = eConnectionStatusNoConnection; if (m_opaque) { @@ -90,8 +86,7 @@ ConnectionStatus SBCommunication::AdoptFileDesriptor(int fd, bool owns_fd) { } ConnectionStatus SBCommunication::Disconnect() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::ConnectionStatus, SBCommunication, - Disconnect); + LLDB_INSTRUMENT_VA(this); ConnectionStatus status = eConnectionStatusNoConnection; if (m_opaque) @@ -100,16 +95,14 @@ ConnectionStatus SBCommunication::Disconnect() { } bool SBCommunication::IsConnected() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommunication, IsConnected); + LLDB_INSTRUMENT_VA(this); return m_opaque ? m_opaque->IsConnected() : false; } size_t SBCommunication::Read(void *dst, size_t dst_len, uint32_t timeout_usec, ConnectionStatus &status) { - LLDB_RECORD_DUMMY(size_t, SBCommunication, Read, - (void *, size_t, uint32_t, lldb::ConnectionStatus &), dst, - dst_len, timeout_usec, status); + LLDB_INSTRUMENT_VA(this, dst, dst_len, timeout_usec, status); size_t bytes_read = 0; Timeout<std::micro> timeout = timeout_usec == UINT32_MAX @@ -125,9 +118,7 @@ size_t SBCommunication::Read(void *dst, size_t dst_len, uint32_t timeout_usec, size_t SBCommunication::Write(const void *src, size_t src_len, ConnectionStatus &status) { - LLDB_RECORD_DUMMY(size_t, SBCommunication, Write, - (const void *, size_t, lldb::ConnectionStatus &), src, - src_len, status); + LLDB_INSTRUMENT_VA(this, src, src_len, status); size_t bytes_written = 0; if (m_opaque) @@ -139,28 +130,26 @@ size_t SBCommunication::Write(const void *src, size_t src_len, } bool SBCommunication::ReadThreadStart() { - LLDB_RECORD_METHOD_NO_ARGS(bool, SBCommunication, ReadThreadStart); + LLDB_INSTRUMENT_VA(this); return m_opaque ? m_opaque->StartReadThread() : false; } bool SBCommunication::ReadThreadStop() { - LLDB_RECORD_METHOD_NO_ARGS(bool, SBCommunication, ReadThreadStop); + LLDB_INSTRUMENT_VA(this); return m_opaque ? m_opaque->StopReadThread() : false; } bool SBCommunication::ReadThreadIsRunning() { - LLDB_RECORD_METHOD_NO_ARGS(bool, SBCommunication, ReadThreadIsRunning); + LLDB_INSTRUMENT_VA(this); return m_opaque ? m_opaque->ReadThreadIsRunning() : false; } bool SBCommunication::SetReadThreadBytesReceivedCallback( ReadThreadBytesReceived callback, void *callback_baton) { - LLDB_RECORD_DUMMY(bool, SBCommunication, SetReadThreadBytesReceivedCallback, - (lldb::SBCommunication::ReadThreadBytesReceived, void *), - callback, callback_baton); + LLDB_INSTRUMENT_VA(this, callback, callback_baton); bool result = false; if (m_opaque) { @@ -171,46 +160,14 @@ bool SBCommunication::SetReadThreadBytesReceivedCallback( } SBBroadcaster SBCommunication::GetBroadcaster() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBBroadcaster, SBCommunication, - GetBroadcaster); + LLDB_INSTRUMENT_VA(this); SBBroadcaster broadcaster(m_opaque, false); - return LLDB_RECORD_RESULT(broadcaster); + return broadcaster; } const char *SBCommunication::GetBroadcasterClass() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(const char *, SBCommunication, - GetBroadcasterClass); + LLDB_INSTRUMENT(); return Communication::GetStaticBroadcasterClass().AsCString(); } - -namespace lldb_private { -namespace repro { - -template <> -void RegisterMethods<SBCommunication>(Registry &R) { - LLDB_REGISTER_CONSTRUCTOR(SBCommunication, ()); - LLDB_REGISTER_CONSTRUCTOR(SBCommunication, (const char *)); - LLDB_REGISTER_METHOD_CONST(bool, SBCommunication, IsValid, ()); - LLDB_REGISTER_METHOD_CONST(bool, SBCommunication, operator bool, ()); - LLDB_REGISTER_METHOD(bool, SBCommunication, GetCloseOnEOF, ()); - LLDB_REGISTER_METHOD(void, SBCommunication, SetCloseOnEOF, (bool)); - LLDB_REGISTER_METHOD(lldb::ConnectionStatus, SBCommunication, Connect, - (const char *)); - LLDB_REGISTER_METHOD(lldb::ConnectionStatus, SBCommunication, - AdoptFileDesriptor, (int, bool)); - LLDB_REGISTER_METHOD(lldb::ConnectionStatus, SBCommunication, Disconnect, - ()); - LLDB_REGISTER_METHOD_CONST(bool, SBCommunication, IsConnected, ()); - LLDB_REGISTER_METHOD(bool, SBCommunication, ReadThreadStart, ()); - LLDB_REGISTER_METHOD(bool, SBCommunication, ReadThreadStop, ()); - LLDB_REGISTER_METHOD(bool, SBCommunication, ReadThreadIsRunning, ()); - LLDB_REGISTER_METHOD(lldb::SBBroadcaster, SBCommunication, GetBroadcaster, - ()); - LLDB_REGISTER_STATIC_METHOD(const char *, SBCommunication, - GetBroadcasterClass, ()); -} - -} -} |
