33 : m_opaque_wp(wp_sp) {
38 : m_opaque_wp(rhs.m_opaque_wp) {
55 lldb::WatchpointSP watchpoint_sp(
GetSP());
57 watch_id = watchpoint_sp->GetID();
64 return this->
operator bool();
66SBWatchpoint::operator bool()
const {
69 return bool(m_opaque_wp.lock());
81 return !(*
this == rhs);
88 lldb::WatchpointSP watchpoint_sp(
GetSP());
90 sb_error.
SetError(watchpoint_sp->GetError());
98 int32_t hw_index = -1;
100 lldb::WatchpointSP watchpoint_sp(
GetSP());
102 std::lock_guard<std::recursive_mutex> guard(
103 watchpoint_sp->GetTarget().GetAPIMutex());
104 hw_index = watchpoint_sp->GetHardwareIndex();
115 lldb::WatchpointSP watchpoint_sp(
GetSP());
117 std::lock_guard<std::recursive_mutex> guard(
118 watchpoint_sp->GetTarget().GetAPIMutex());
119 ret_addr = watchpoint_sp->GetLoadAddress();
128 size_t watch_size = 0;
130 lldb::WatchpointSP watchpoint_sp(
GetSP());
132 std::lock_guard<std::recursive_mutex> guard(
133 watchpoint_sp->GetTarget().GetAPIMutex());
134 watch_size = watchpoint_sp->GetByteSize();
143 lldb::WatchpointSP watchpoint_sp(
GetSP());
145 Target &target = watchpoint_sp->GetTarget();
146 std::lock_guard<std::recursive_mutex> guard(target.
GetAPIMutex());
148 const bool notify =
true;
151 process_sp->EnableWatchpoint(watchpoint_sp.get(), notify);
153 process_sp->DisableWatchpoint(watchpoint_sp.get(), notify);
155 watchpoint_sp->SetEnabled(enabled, notify);
163 lldb::WatchpointSP watchpoint_sp(
GetSP());
165 std::lock_guard<std::recursive_mutex> guard(
166 watchpoint_sp->GetTarget().GetAPIMutex());
167 return watchpoint_sp->IsEnabled();
176 lldb::WatchpointSP watchpoint_sp(
GetSP());
178 std::lock_guard<std::recursive_mutex> guard(
179 watchpoint_sp->GetTarget().GetAPIMutex());
180 count = watchpoint_sp->GetHitCount();
189 lldb::WatchpointSP watchpoint_sp(
GetSP());
191 std::lock_guard<std::recursive_mutex> guard(
192 watchpoint_sp->GetTarget().GetAPIMutex());
193 return watchpoint_sp->GetIgnoreCount();
201 lldb::WatchpointSP watchpoint_sp(
GetSP());
203 std::lock_guard<std::recursive_mutex> guard(
204 watchpoint_sp->GetTarget().GetAPIMutex());
205 watchpoint_sp->SetIgnoreCount(n);
212 lldb::WatchpointSP watchpoint_sp(
GetSP());
214 std::lock_guard<std::recursive_mutex> guard(
215 watchpoint_sp->GetTarget().GetAPIMutex());
216 return watchpoint_sp->GetConditionText();
224 lldb::WatchpointSP watchpoint_sp(
GetSP());
226 std::lock_guard<std::recursive_mutex> guard(
227 watchpoint_sp->GetTarget().GetAPIMutex());
228 watchpoint_sp->SetCondition(condition);
238 lldb::WatchpointSP watchpoint_sp(
GetSP());
240 std::lock_guard<std::recursive_mutex> guard(
241 watchpoint_sp->GetTarget().GetAPIMutex());
242 watchpoint_sp->GetDescription(&strm, level);
282 return eWatchpointEventTypeInvalidType;
292 return sb_watchpoint;
298 lldb::WatchpointSP watchpoint_sp(
GetSP());
300 std::lock_guard<std::recursive_mutex> guard(
301 watchpoint_sp->GetTarget().GetAPIMutex());
302 const CompilerType &type = watchpoint_sp->GetCompilerType();
311 lldb::WatchpointSP watchpoint_sp(
GetSP());
313 std::lock_guard<std::recursive_mutex> guard(
314 watchpoint_sp->GetTarget().GetAPIMutex());
315 if (watchpoint_sp->IsWatchVariable())
325 lldb::WatchpointSP watchpoint_sp(
GetSP());
327 std::lock_guard<std::recursive_mutex> guard(
328 watchpoint_sp->GetTarget().GetAPIMutex());
340 lldb::WatchpointSP watchpoint_sp(
GetSP());
342 std::lock_guard<std::recursive_mutex> guard(
343 watchpoint_sp->GetTarget().GetAPIMutex());
345 return watchpoint_sp->WatchpointRead();
353 lldb::WatchpointSP watchpoint_sp(
GetSP());
355 std::lock_guard<std::recursive_mutex> guard(
356 watchpoint_sp->GetTarget().GetAPIMutex());
358 return watchpoint_sp->WatchpointWrite();
#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()
With -1 representing an invalid hardware index.
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.
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.