diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2022-01-27 22:06:42 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2022-01-27 22:06:42 +0000 |
| commit | 6f8fc217eaa12bf657be1c6468ed9938d10168b3 (patch) | |
| tree | a1fd89b864d9b93e2ad68fe1dcf7afee2e3c8d76 /lldb/source/API/SBWatchpoint.cpp | |
| parent | 77fc4c146f0870ffb09c1afb823ccbe742c5e6ff (diff) | |
Vendor import of llvm-project main llvmorg-14-init-17616-g024a1fab5c35.vendor/llvm-project/llvmorg-14-init-17616-g024a1fab5c35
Diffstat (limited to 'lldb/source/API/SBWatchpoint.cpp')
| -rw-r--r-- | lldb/source/API/SBWatchpoint.cpp | 124 |
1 files changed, 32 insertions, 92 deletions
diff --git a/lldb/source/API/SBWatchpoint.cpp b/lldb/source/API/SBWatchpoint.cpp index eba75dea8f8d..f5bd9cd1a946 100644 --- a/lldb/source/API/SBWatchpoint.cpp +++ b/lldb/source/API/SBWatchpoint.cpp @@ -7,12 +7,12 @@ //===----------------------------------------------------------------------===// #include "lldb/API/SBWatchpoint.h" -#include "SBReproducerPrivate.h" #include "lldb/API/SBAddress.h" #include "lldb/API/SBDebugger.h" #include "lldb/API/SBDefines.h" #include "lldb/API/SBEvent.h" #include "lldb/API/SBStream.h" +#include "lldb/Utility/Instrumentation.h" #include "lldb/Breakpoint/Watchpoint.h" #include "lldb/Breakpoint/WatchpointList.h" @@ -26,31 +26,29 @@ using namespace lldb; using namespace lldb_private; -SBWatchpoint::SBWatchpoint() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBWatchpoint); } +SBWatchpoint::SBWatchpoint() { LLDB_INSTRUMENT_VA(this); } SBWatchpoint::SBWatchpoint(const lldb::WatchpointSP &wp_sp) : m_opaque_wp(wp_sp) { - LLDB_RECORD_CONSTRUCTOR(SBWatchpoint, (const lldb::WatchpointSP &), wp_sp); + LLDB_INSTRUMENT_VA(this, wp_sp); } SBWatchpoint::SBWatchpoint(const SBWatchpoint &rhs) : m_opaque_wp(rhs.m_opaque_wp) { - LLDB_RECORD_CONSTRUCTOR(SBWatchpoint, (const lldb::SBWatchpoint &), rhs); + LLDB_INSTRUMENT_VA(this, rhs); } const SBWatchpoint &SBWatchpoint::operator=(const SBWatchpoint &rhs) { - LLDB_RECORD_METHOD(const lldb::SBWatchpoint &, - SBWatchpoint, operator=,(const lldb::SBWatchpoint &), rhs); + LLDB_INSTRUMENT_VA(this, rhs); m_opaque_wp = rhs.m_opaque_wp; - return LLDB_RECORD_RESULT(*this); + return *this; } SBWatchpoint::~SBWatchpoint() = default; watch_id_t SBWatchpoint::GetID() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::watch_id_t, SBWatchpoint, GetID); - + LLDB_INSTRUMENT_VA(this); watch_id_t watch_id = LLDB_INVALID_WATCH_ID; lldb::WatchpointSP watchpoint_sp(GetSP()); @@ -61,42 +59,40 @@ watch_id_t SBWatchpoint::GetID() { } bool SBWatchpoint::IsValid() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBWatchpoint, IsValid); + LLDB_INSTRUMENT_VA(this); return this->operator bool(); } SBWatchpoint::operator bool() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBWatchpoint, operator bool); + LLDB_INSTRUMENT_VA(this); return bool(m_opaque_wp.lock()); } bool SBWatchpoint::operator==(const SBWatchpoint &rhs) const { - LLDB_RECORD_METHOD_CONST( - bool, SBWatchpoint, operator==,(const SBWatchpoint &), rhs); + LLDB_INSTRUMENT_VA(this, rhs); return GetSP() == rhs.GetSP(); } bool SBWatchpoint::operator!=(const SBWatchpoint &rhs) const { - LLDB_RECORD_METHOD_CONST( - bool, SBWatchpoint, operator!=,(const SBWatchpoint &), rhs); + LLDB_INSTRUMENT_VA(this, rhs); return !(*this == rhs); } SBError SBWatchpoint::GetError() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBError, SBWatchpoint, GetError); + LLDB_INSTRUMENT_VA(this); SBError sb_error; lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { sb_error.SetError(watchpoint_sp->GetError()); } - return LLDB_RECORD_RESULT(sb_error); + return sb_error; } int32_t SBWatchpoint::GetHardwareIndex() { - LLDB_RECORD_METHOD_NO_ARGS(int32_t, SBWatchpoint, GetHardwareIndex); + LLDB_INSTRUMENT_VA(this); int32_t hw_index = -1; @@ -111,7 +107,7 @@ int32_t SBWatchpoint::GetHardwareIndex() { } addr_t SBWatchpoint::GetWatchAddress() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::addr_t, SBWatchpoint, GetWatchAddress); + LLDB_INSTRUMENT_VA(this); addr_t ret_addr = LLDB_INVALID_ADDRESS; @@ -126,7 +122,7 @@ addr_t SBWatchpoint::GetWatchAddress() { } size_t SBWatchpoint::GetWatchSize() { - LLDB_RECORD_METHOD_NO_ARGS(size_t, SBWatchpoint, GetWatchSize); + LLDB_INSTRUMENT_VA(this); size_t watch_size = 0; @@ -141,7 +137,7 @@ size_t SBWatchpoint::GetWatchSize() { } void SBWatchpoint::SetEnabled(bool enabled) { - LLDB_RECORD_METHOD(void, SBWatchpoint, SetEnabled, (bool), enabled); + LLDB_INSTRUMENT_VA(this, enabled); lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { @@ -161,7 +157,7 @@ void SBWatchpoint::SetEnabled(bool enabled) { } bool SBWatchpoint::IsEnabled() { - LLDB_RECORD_METHOD_NO_ARGS(bool, SBWatchpoint, IsEnabled); + LLDB_INSTRUMENT_VA(this); lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { @@ -173,7 +169,7 @@ bool SBWatchpoint::IsEnabled() { } uint32_t SBWatchpoint::GetHitCount() { - LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBWatchpoint, GetHitCount); + LLDB_INSTRUMENT_VA(this); uint32_t count = 0; lldb::WatchpointSP watchpoint_sp(GetSP()); @@ -187,7 +183,7 @@ uint32_t SBWatchpoint::GetHitCount() { } uint32_t SBWatchpoint::GetIgnoreCount() { - LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBWatchpoint, GetIgnoreCount); + LLDB_INSTRUMENT_VA(this); lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { @@ -199,7 +195,7 @@ uint32_t SBWatchpoint::GetIgnoreCount() { } void SBWatchpoint::SetIgnoreCount(uint32_t n) { - LLDB_RECORD_METHOD(void, SBWatchpoint, SetIgnoreCount, (uint32_t), n); + LLDB_INSTRUMENT_VA(this, n); lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { @@ -210,7 +206,7 @@ void SBWatchpoint::SetIgnoreCount(uint32_t n) { } const char *SBWatchpoint::GetCondition() { - LLDB_RECORD_METHOD_NO_ARGS(const char *, SBWatchpoint, GetCondition); + LLDB_INSTRUMENT_VA(this); lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { @@ -222,8 +218,7 @@ const char *SBWatchpoint::GetCondition() { } void SBWatchpoint::SetCondition(const char *condition) { - LLDB_RECORD_METHOD(void, SBWatchpoint, SetCondition, (const char *), - condition); + LLDB_INSTRUMENT_VA(this, condition); lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { @@ -235,9 +230,7 @@ void SBWatchpoint::SetCondition(const char *condition) { bool SBWatchpoint::GetDescription(SBStream &description, DescriptionLevel level) { - LLDB_RECORD_METHOD(bool, SBWatchpoint, GetDescription, - (lldb::SBStream &, lldb::DescriptionLevel), description, - level); + LLDB_INSTRUMENT_VA(this, description, level); Stream &strm = description.ref(); @@ -254,27 +247,25 @@ bool SBWatchpoint::GetDescription(SBStream &description, } void SBWatchpoint::Clear() { - LLDB_RECORD_METHOD_NO_ARGS(void, SBWatchpoint, Clear); + LLDB_INSTRUMENT_VA(this); m_opaque_wp.reset(); } lldb::WatchpointSP SBWatchpoint::GetSP() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::WatchpointSP, SBWatchpoint, GetSP); + LLDB_INSTRUMENT_VA(this); - return LLDB_RECORD_RESULT(m_opaque_wp.lock()); + return m_opaque_wp.lock(); } void SBWatchpoint::SetSP(const lldb::WatchpointSP &sp) { - LLDB_RECORD_METHOD(void, SBWatchpoint, SetSP, (const lldb::WatchpointSP &), - sp); + LLDB_INSTRUMENT_VA(this, sp); m_opaque_wp = sp; } bool SBWatchpoint::EventIsWatchpointEvent(const lldb::SBEvent &event) { - LLDB_RECORD_STATIC_METHOD(bool, SBWatchpoint, EventIsWatchpointEvent, - (const lldb::SBEvent &), event); + LLDB_INSTRUMENT_VA(event); return Watchpoint::WatchpointEventData::GetEventDataFromEvent(event.get()) != nullptr; @@ -282,9 +273,7 @@ bool SBWatchpoint::EventIsWatchpointEvent(const lldb::SBEvent &event) { WatchpointEventType SBWatchpoint::GetWatchpointEventTypeFromEvent(const SBEvent &event) { - LLDB_RECORD_STATIC_METHOD(lldb::WatchpointEventType, SBWatchpoint, - GetWatchpointEventTypeFromEvent, - (const lldb::SBEvent &), event); + LLDB_INSTRUMENT_VA(event); if (event.IsValid()) return Watchpoint::WatchpointEventData::GetWatchpointEventTypeFromEvent( @@ -293,60 +282,11 @@ SBWatchpoint::GetWatchpointEventTypeFromEvent(const SBEvent &event) { } SBWatchpoint SBWatchpoint::GetWatchpointFromEvent(const lldb::SBEvent &event) { - LLDB_RECORD_STATIC_METHOD(lldb::SBWatchpoint, SBWatchpoint, - GetWatchpointFromEvent, (const lldb::SBEvent &), - event); + LLDB_INSTRUMENT_VA(event); SBWatchpoint sb_watchpoint; if (event.IsValid()) sb_watchpoint = Watchpoint::WatchpointEventData::GetWatchpointFromEvent(event.GetSP()); - return LLDB_RECORD_RESULT(sb_watchpoint); -} - -namespace lldb_private { -namespace repro { - -template <> -void RegisterMethods<SBWatchpoint>(Registry &R) { - LLDB_REGISTER_CONSTRUCTOR(SBWatchpoint, ()); - LLDB_REGISTER_CONSTRUCTOR(SBWatchpoint, (const lldb::WatchpointSP &)); - LLDB_REGISTER_CONSTRUCTOR(SBWatchpoint, (const lldb::SBWatchpoint &)); - LLDB_REGISTER_METHOD(const lldb::SBWatchpoint &, - SBWatchpoint, operator=,(const lldb::SBWatchpoint &)); - LLDB_REGISTER_METHOD(lldb::watch_id_t, SBWatchpoint, GetID, ()); - LLDB_REGISTER_METHOD_CONST(bool, SBWatchpoint, IsValid, ()); - LLDB_REGISTER_METHOD_CONST(bool, SBWatchpoint, operator bool, ()); - LLDB_REGISTER_METHOD_CONST( - bool, SBWatchpoint, operator==,(const lldb::SBWatchpoint &)); - LLDB_REGISTER_METHOD_CONST( - bool, SBWatchpoint, operator!=,(const lldb::SBWatchpoint &)); - LLDB_REGISTER_METHOD(lldb::SBError, SBWatchpoint, GetError, ()); - LLDB_REGISTER_METHOD(int32_t, SBWatchpoint, GetHardwareIndex, ()); - LLDB_REGISTER_METHOD(lldb::addr_t, SBWatchpoint, GetWatchAddress, ()); - LLDB_REGISTER_METHOD(size_t, SBWatchpoint, GetWatchSize, ()); - LLDB_REGISTER_METHOD(void, SBWatchpoint, SetEnabled, (bool)); - LLDB_REGISTER_METHOD(bool, SBWatchpoint, IsEnabled, ()); - LLDB_REGISTER_METHOD(uint32_t, SBWatchpoint, GetHitCount, ()); - LLDB_REGISTER_METHOD(uint32_t, SBWatchpoint, GetIgnoreCount, ()); - LLDB_REGISTER_METHOD(void, SBWatchpoint, SetIgnoreCount, (uint32_t)); - LLDB_REGISTER_METHOD(const char *, SBWatchpoint, GetCondition, ()); - LLDB_REGISTER_METHOD(void, SBWatchpoint, SetCondition, (const char *)); - LLDB_REGISTER_METHOD(bool, SBWatchpoint, GetDescription, - (lldb::SBStream &, lldb::DescriptionLevel)); - LLDB_REGISTER_METHOD(void, SBWatchpoint, Clear, ()); - LLDB_REGISTER_METHOD_CONST(lldb::WatchpointSP, SBWatchpoint, GetSP, ()); - LLDB_REGISTER_METHOD(void, SBWatchpoint, SetSP, - (const lldb::WatchpointSP &)); - LLDB_REGISTER_STATIC_METHOD(bool, SBWatchpoint, EventIsWatchpointEvent, - (const lldb::SBEvent &)); - LLDB_REGISTER_STATIC_METHOD(lldb::WatchpointEventType, SBWatchpoint, - GetWatchpointEventTypeFromEvent, - (const lldb::SBEvent &)); - LLDB_REGISTER_STATIC_METHOD(lldb::SBWatchpoint, SBWatchpoint, - GetWatchpointFromEvent, - (const lldb::SBEvent &)); -} - -} + return sb_watchpoint; } |
