diff options
Diffstat (limited to 'lldb/source/API/SBWatchpoint.cpp')
-rw-r--r-- | lldb/source/API/SBWatchpoint.cpp | 81 |
1 files changed, 73 insertions, 8 deletions
diff --git a/lldb/source/API/SBWatchpoint.cpp b/lldb/source/API/SBWatchpoint.cpp index 563123734ed..7ef8a7a11b0 100644 --- a/lldb/source/API/SBWatchpoint.cpp +++ b/lldb/source/API/SBWatchpoint.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "lldb/API/SBWatchpoint.h" +#include "SBReproducerPrivate.h" #include "lldb/API/SBAddress.h" #include "lldb/API/SBDebugger.h" #include "lldb/API/SBDefines.h" @@ -26,10 +27,12 @@ using namespace lldb; using namespace lldb_private; -SBWatchpoint::SBWatchpoint() {} +SBWatchpoint::SBWatchpoint() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBWatchpoint); } SBWatchpoint::SBWatchpoint(const lldb::WatchpointSP &wp_sp) : m_opaque_wp(wp_sp) { + LLDB_RECORD_CONSTRUCTOR(SBWatchpoint, (const lldb::WatchpointSP &), wp_sp); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); if (log) { @@ -40,9 +43,14 @@ SBWatchpoint::SBWatchpoint(const lldb::WatchpointSP &wp_sp) } SBWatchpoint::SBWatchpoint(const SBWatchpoint &rhs) - : m_opaque_wp(rhs.m_opaque_wp) {} + : m_opaque_wp(rhs.m_opaque_wp) { + LLDB_RECORD_CONSTRUCTOR(SBWatchpoint, (const lldb::SBWatchpoint &), rhs); +} const SBWatchpoint &SBWatchpoint::operator=(const SBWatchpoint &rhs) { + LLDB_RECORD_METHOD(const lldb::SBWatchpoint &, + SBWatchpoint, operator=,(const lldb::SBWatchpoint &), rhs); + m_opaque_wp = rhs.m_opaque_wp; return *this; } @@ -50,6 +58,8 @@ const SBWatchpoint &SBWatchpoint::operator=(const SBWatchpoint &rhs) { SBWatchpoint::~SBWatchpoint() {} watch_id_t SBWatchpoint::GetID() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::watch_id_t, SBWatchpoint, GetID); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); watch_id_t watch_id = LLDB_INVALID_WATCH_ID; @@ -69,18 +79,26 @@ watch_id_t SBWatchpoint::GetID() { return watch_id; } -bool SBWatchpoint::IsValid() const { return bool(m_opaque_wp.lock()); } +bool SBWatchpoint::IsValid() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBWatchpoint, IsValid); + + return bool(m_opaque_wp.lock()); +} SBError SBWatchpoint::GetError() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::SBError, SBWatchpoint, GetError); + SBError sb_error; lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { sb_error.SetError(watchpoint_sp->GetError()); } - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } int32_t SBWatchpoint::GetHardwareIndex() { + LLDB_RECORD_METHOD_NO_ARGS(int32_t, SBWatchpoint, GetHardwareIndex); + int32_t hw_index = -1; lldb::WatchpointSP watchpoint_sp(GetSP()); @@ -94,6 +112,8 @@ int32_t SBWatchpoint::GetHardwareIndex() { } addr_t SBWatchpoint::GetWatchAddress() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::addr_t, SBWatchpoint, GetWatchAddress); + addr_t ret_addr = LLDB_INVALID_ADDRESS; lldb::WatchpointSP watchpoint_sp(GetSP()); @@ -107,6 +127,8 @@ addr_t SBWatchpoint::GetWatchAddress() { } size_t SBWatchpoint::GetWatchSize() { + LLDB_RECORD_METHOD_NO_ARGS(size_t, SBWatchpoint, GetWatchSize); + size_t watch_size = 0; lldb::WatchpointSP watchpoint_sp(GetSP()); @@ -120,6 +142,8 @@ size_t SBWatchpoint::GetWatchSize() { } void SBWatchpoint::SetEnabled(bool enabled) { + LLDB_RECORD_METHOD(void, SBWatchpoint, SetEnabled, (bool), enabled); + lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { Target &target = watchpoint_sp->GetTarget(); @@ -138,6 +162,8 @@ void SBWatchpoint::SetEnabled(bool enabled) { } bool SBWatchpoint::IsEnabled() { + LLDB_RECORD_METHOD_NO_ARGS(bool, SBWatchpoint, IsEnabled); + lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { std::lock_guard<std::recursive_mutex> guard( @@ -148,6 +174,8 @@ bool SBWatchpoint::IsEnabled() { } uint32_t SBWatchpoint::GetHitCount() { + LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBWatchpoint, GetHitCount); + uint32_t count = 0; lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { @@ -165,6 +193,8 @@ uint32_t SBWatchpoint::GetHitCount() { } uint32_t SBWatchpoint::GetIgnoreCount() { + LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBWatchpoint, GetIgnoreCount); + lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { std::lock_guard<std::recursive_mutex> guard( @@ -175,6 +205,8 @@ uint32_t SBWatchpoint::GetIgnoreCount() { } void SBWatchpoint::SetIgnoreCount(uint32_t n) { + LLDB_RECORD_METHOD(void, SBWatchpoint, SetIgnoreCount, (uint32_t), n); + lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { std::lock_guard<std::recursive_mutex> guard( @@ -184,6 +216,8 @@ void SBWatchpoint::SetIgnoreCount(uint32_t n) { } const char *SBWatchpoint::GetCondition() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBWatchpoint, GetCondition); + lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { std::lock_guard<std::recursive_mutex> guard( @@ -194,6 +228,9 @@ const char *SBWatchpoint::GetCondition() { } void SBWatchpoint::SetCondition(const char *condition) { + LLDB_RECORD_METHOD(void, SBWatchpoint, SetCondition, (const char *), + condition); + lldb::WatchpointSP watchpoint_sp(GetSP()); if (watchpoint_sp) { std::lock_guard<std::recursive_mutex> guard( @@ -204,6 +241,10 @@ 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); + Stream &strm = description.ref(); lldb::WatchpointSP watchpoint_sp(GetSP()); @@ -218,19 +259,39 @@ bool SBWatchpoint::GetDescription(SBStream &description, return true; } -void SBWatchpoint::Clear() { m_opaque_wp.reset(); } +void SBWatchpoint::Clear() { + LLDB_RECORD_METHOD_NO_ARGS(void, SBWatchpoint, Clear); -lldb::WatchpointSP SBWatchpoint::GetSP() const { return m_opaque_wp.lock(); } + m_opaque_wp.reset(); +} + +lldb::WatchpointSP SBWatchpoint::GetSP() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::WatchpointSP, SBWatchpoint, GetSP); -void SBWatchpoint::SetSP(const lldb::WatchpointSP &sp) { m_opaque_wp = sp; } + return LLDB_RECORD_RESULT(m_opaque_wp.lock()); +} + +void SBWatchpoint::SetSP(const lldb::WatchpointSP &sp) { + LLDB_RECORD_METHOD(void, SBWatchpoint, SetSP, (const lldb::WatchpointSP &), + sp); + + m_opaque_wp = sp; +} bool SBWatchpoint::EventIsWatchpointEvent(const lldb::SBEvent &event) { + LLDB_RECORD_STATIC_METHOD(bool, SBWatchpoint, EventIsWatchpointEvent, + (const lldb::SBEvent &), event); + return Watchpoint::WatchpointEventData::GetEventDataFromEvent(event.get()) != NULL; } WatchpointEventType SBWatchpoint::GetWatchpointEventTypeFromEvent(const SBEvent &event) { + LLDB_RECORD_STATIC_METHOD(lldb::WatchpointEventType, SBWatchpoint, + GetWatchpointEventTypeFromEvent, + (const lldb::SBEvent &), event); + if (event.IsValid()) return Watchpoint::WatchpointEventData::GetWatchpointEventTypeFromEvent( event.GetSP()); @@ -238,9 +299,13 @@ SBWatchpoint::GetWatchpointEventTypeFromEvent(const SBEvent &event) { } SBWatchpoint SBWatchpoint::GetWatchpointFromEvent(const lldb::SBEvent &event) { + LLDB_RECORD_STATIC_METHOD(lldb::SBWatchpoint, SBWatchpoint, + GetWatchpointFromEvent, (const lldb::SBEvent &), + event); + SBWatchpoint sb_watchpoint; if (event.IsValid()) sb_watchpoint = Watchpoint::WatchpointEventData::GetWatchpointFromEvent(event.GetSP()); - return sb_watchpoint; + return LLDB_RECORD_RESULT(sb_watchpoint); } |