32 : m_opaque_wp(wp_sp) {
37 : m_opaque_wp(rhs.m_opaque_wp) {
56 watch_id = watchpoint_sp->GetID();
63 return this->
operator bool();
65SBWatchpoint::operator bool()
const {
68 return bool(m_opaque_wp.lock());
80 return !(*
this == rhs);
89 sb_error.
SetError(watchpoint_sp->GetError());
111 std::lock_guard<std::recursive_mutex> guard(
112 watchpoint_sp->GetTarget().GetAPIMutex());
113 ret_addr = watchpoint_sp->GetLoadAddress();
122 size_t watch_size = 0;
126 std::lock_guard<std::recursive_mutex> guard(
127 watchpoint_sp->GetTarget().GetAPIMutex());
128 watch_size = watchpoint_sp->GetByteSize();
139 Target &target = watchpoint_sp->GetTarget();
140 std::lock_guard<std::recursive_mutex> guard(target.
GetAPIMutex());
142 const bool notify =
true;
145 process_sp->EnableWatchpoint(watchpoint_sp, notify);
147 process_sp->DisableWatchpoint(watchpoint_sp, notify);
149 watchpoint_sp->SetEnabled(enabled, notify);
159 std::lock_guard<std::recursive_mutex> guard(
160 watchpoint_sp->GetTarget().GetAPIMutex());
161 return watchpoint_sp->IsEnabled();
172 std::lock_guard<std::recursive_mutex> guard(
173 watchpoint_sp->GetTarget().GetAPIMutex());
174 count = watchpoint_sp->GetHitCount();
185 std::lock_guard<std::recursive_mutex> guard(
186 watchpoint_sp->GetTarget().GetAPIMutex());
187 return watchpoint_sp->GetIgnoreCount();
197 std::lock_guard<std::recursive_mutex> guard(
198 watchpoint_sp->GetTarget().GetAPIMutex());
199 watchpoint_sp->SetIgnoreCount(n);
210 std::lock_guard<std::recursive_mutex> guard(
211 watchpoint_sp->GetTarget().GetAPIMutex());
220 std::lock_guard<std::recursive_mutex> guard(
221 watchpoint_sp->GetTarget().GetAPIMutex());
222 watchpoint_sp->SetCondition(condition);
234 std::lock_guard<std::recursive_mutex> guard(
235 watchpoint_sp->GetTarget().GetAPIMutex());
236 watchpoint_sp->GetDescription(&strm, level);
276 return eWatchpointEventTypeInvalidType;
286 return sb_watchpoint;
294 std::lock_guard<std::recursive_mutex> guard(
295 watchpoint_sp->GetTarget().GetAPIMutex());
296 const CompilerType &type = watchpoint_sp->GetCompilerType();
307 std::lock_guard<std::recursive_mutex> guard(
308 watchpoint_sp->GetTarget().GetAPIMutex());
309 if (watchpoint_sp->IsWatchVariable())
323 std::lock_guard<std::recursive_mutex> guard(
324 watchpoint_sp->GetTarget().GetAPIMutex());
336 std::lock_guard<std::recursive_mutex> guard(
337 watchpoint_sp->GetTarget().GetAPIMutex());
339 return watchpoint_sp->WatchpointRead();
349 std::lock_guard<std::recursive_mutex> guard(
350 watchpoint_sp->GetTarget().GetAPIMutex());
352 return watchpoint_sp->WatchpointWrite() ||
353 watchpoint_sp->WatchpointModify();
#define LLDB_INSTRUMENT_VA(...)
void SetError(uint32_t err, lldb::ErrorType type)
lldb_private::Event * get() const
lldb::EventSP & GetSP() const
lldb_private::Stream & ref()
void SetCondition(const char *condition)
const char * GetCondition()
void SetSP(const lldb::WatchpointSP &sp)
const char * GetWatchSpec()
bool GetDescription(lldb::SBStream &description, DescriptionLevel level)
lldb::addr_t GetWatchAddress()
std::weak_ptr< lldb_private::Watchpoint > m_opaque_wp
bool operator==(const SBWatchpoint &rhs) const
uint32_t GetIgnoreCount()
void SetIgnoreCount(uint32_t n)
WatchpointValueKind GetWatchValueKind()
static lldb::WatchpointEventType GetWatchpointEventTypeFromEvent(const lldb::SBEvent &event)
int32_t GetHardwareIndex()
void SetEnabled(bool enabled)
static bool EventIsWatchpointEvent(const lldb::SBEvent &event)
static lldb::SBWatchpoint GetWatchpointFromEvent(const lldb::SBEvent &event)
bool operator!=(const SBWatchpoint &rhs) const
lldb::WatchpointSP GetSP() const
const lldb::SBWatchpoint & operator=(const lldb::SBWatchpoint &rhs)
Generic representation of a type in a programming language.
A uniqued constant string class.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
const char * GetCString() const
Get the string value as a C string.
A stream class that can stream formatted output to a file.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
size_t EOL()
Output and End of Line character to the stream.
const lldb::ProcessSP & GetProcessSP() const
std::recursive_mutex & GetAPIMutex()
static lldb::WatchpointSP GetWatchpointFromEvent(const lldb::EventSP &event_sp)
static lldb::WatchpointEventType GetWatchpointEventTypeFromEvent(const lldb::EventSP &event_sp)
static const WatchpointEventData * GetEventDataFromEvent(const Event *event_sp)
#define LLDB_INVALID_WATCH_ID
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eWatchPointValueKindInvalid
Watchpoint was created watching a variable.
@ eWatchPointValueKindExpression
@ eWatchPointValueKindVariable
Watchpoint was created watching the result of an expression that was evaluated at creation time.
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Watchpoint > WatchpointSP