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());
97 int32_t hw_index = -1;
101 std::lock_guard<std::recursive_mutex> guard(
102 watchpoint_sp->GetTarget().GetAPIMutex());
103 hw_index = watchpoint_sp->GetHardwareIndex();
116 std::lock_guard<std::recursive_mutex> guard(
117 watchpoint_sp->GetTarget().GetAPIMutex());
118 ret_addr = watchpoint_sp->GetLoadAddress();
127 size_t watch_size = 0;
131 std::lock_guard<std::recursive_mutex> guard(
132 watchpoint_sp->GetTarget().GetAPIMutex());
133 watch_size = watchpoint_sp->GetByteSize();
144 Target &target = watchpoint_sp->GetTarget();
145 std::lock_guard<std::recursive_mutex> guard(target.
GetAPIMutex());
147 const bool notify =
true;
150 process_sp->EnableWatchpoint(watchpoint_sp.get(), notify);
152 process_sp->DisableWatchpoint(watchpoint_sp.get(), notify);
154 watchpoint_sp->SetEnabled(enabled, notify);
164 std::lock_guard<std::recursive_mutex> guard(
165 watchpoint_sp->GetTarget().GetAPIMutex());
166 return watchpoint_sp->IsEnabled();
177 std::lock_guard<std::recursive_mutex> guard(
178 watchpoint_sp->GetTarget().GetAPIMutex());
179 count = watchpoint_sp->GetHitCount();
190 std::lock_guard<std::recursive_mutex> guard(
191 watchpoint_sp->GetTarget().GetAPIMutex());
192 return watchpoint_sp->GetIgnoreCount();
202 std::lock_guard<std::recursive_mutex> guard(
203 watchpoint_sp->GetTarget().GetAPIMutex());
204 watchpoint_sp->SetIgnoreCount(n);
215 std::lock_guard<std::recursive_mutex> guard(
216 watchpoint_sp->GetTarget().GetAPIMutex());
225 std::lock_guard<std::recursive_mutex> guard(
226 watchpoint_sp->GetTarget().GetAPIMutex());
227 watchpoint_sp->SetCondition(condition);
239 std::lock_guard<std::recursive_mutex> guard(
240 watchpoint_sp->GetTarget().GetAPIMutex());
241 watchpoint_sp->GetDescription(&strm, level);
281 return eWatchpointEventTypeInvalidType;
291 return sb_watchpoint;
299 std::lock_guard<std::recursive_mutex> guard(
300 watchpoint_sp->GetTarget().GetAPIMutex());
301 const CompilerType &type = watchpoint_sp->GetCompilerType();
312 std::lock_guard<std::recursive_mutex> guard(
313 watchpoint_sp->GetTarget().GetAPIMutex());
314 if (watchpoint_sp->IsWatchVariable())
328 std::lock_guard<std::recursive_mutex> guard(
329 watchpoint_sp->GetTarget().GetAPIMutex());
341 std::lock_guard<std::recursive_mutex> guard(
342 watchpoint_sp->GetTarget().GetAPIMutex());
344 return watchpoint_sp->WatchpointRead();
354 std::lock_guard<std::recursive_mutex> guard(
355 watchpoint_sp->GetTarget().GetAPIMutex());
357 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.
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