21 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
25 if (wp_sp->GetTarget().EventTypeHasListeners(
29 eWatchpointEventTypeAdded, wp_sp));
31 return wp_sp->GetID();
40 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
41 s->
Printf(
"%p: ",
static_cast<const void *
>(
this));
43 s->
Printf(
"WatchpointList with %" PRIu64
" Watchpoints:\n",
48 (*pos)->DumpWithLevel(s, description_level);
54 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
59 uint32_t wp_bytesize = (*pos)->GetByteSize();
60 if ((wp_addr <= addr) && ((wp_addr + wp_bytesize) > addr)) {
72 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
76 if ((*pos)->GetWatchSpec() == spec) {
90 return m_watch_id == wp->GetID();
97WatchpointList::wp_collection::iterator
104WatchpointList::wp_collection::const_iterator
113 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
124 return wp_sp->GetID();
132 return wp_sp->GetID();
138 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
142 std::advance(pos, i);
149 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
153 std::advance(pos, i);
160 std::vector<lldb::watch_id_t> IDs;
161 wp_collection::const_iterator pos, end =
m_watchpoints.end();
163 IDs.push_back((*pos)->GetID());
168 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
173 if (wp_sp->GetTarget().EventTypeHasListeners(
175 wp_sp->GetTarget().BroadcastEvent(
187 uint32_t hit_count = 0;
188 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
189 wp_collection::const_iterator pos, end =
m_watchpoints.end();
191 hit_count += (*pos)->GetHitCount();
203 return wp_sp->ShouldStop(context);
211 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
221 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
225 (*pos)->SetEnabled(enabled);
229 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
235 if ((*pos)->GetTarget().EventTypeHasListeners(
237 (*pos)->GetTarget().BroadcastEvent(
249 std::unique_lock<std::recursive_mutex> &lock) {
250 lock = std::unique_lock<std::recursive_mutex>(
m_mutex);
WatchpointIDMatches(lldb::watch_id_t watch_id)
bool operator()(const WatchpointSP &wp) const
const lldb::watch_id_t m_watch_id
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
void IndentMore(unsigned amount=2)
Increment the current indentation level.
@ eBroadcastBitWatchpointChanged
@ eBroadcastBitBreakpointChanged
lldb::WatchpointSP GetByIndex(uint32_t i)
Returns a shared pointer to the watchpoint with index i.
void GetDescription(Stream *s, lldb::DescriptionLevel level)
Print a description of the watchpoints in this list to the stream s.
lldb::watch_id_t Add(const lldb::WatchpointSP &wp_sp, bool notify)
Add a Watchpoint to the list.
void SetEnabledAll(bool enabled)
lldb::watch_id_t FindIDBySpec(std::string spec)
Returns the watchpoint id to the watchpoint with watchpoint spec spec.
id_vector GetWatchpointIDs() const
lldb::WatchpointSP FindByID(lldb::watch_id_t watchID) const
Returns a shared pointer to the watchpoint with id watchID, const version.
const lldb::WatchpointSP FindBySpec(std::string spec) const
Returns a shared pointer to the watchpoint with watchpoint spec spec.
lldb::watch_id_t m_next_wp_id
WatchpointList()
Default constructor makes an empty list.
std::recursive_mutex m_mutex
bool ShouldStop(StoppointCallbackContext *context, lldb::watch_id_t watchID)
Enquires of the watchpoint in this list with ID watchID whether we should stop.
lldb::watch_id_t FindIDByAddress(lldb::addr_t addr)
Returns the watchpoint id to the watchpoint at address addr.
wp_collection::iterator GetIDIterator(lldb::watch_id_t watchID)
void GetListMutex(std::unique_lock< std::recursive_mutex > &lock)
Sets the passed in Locker to hold the Watchpoint List mutex.
uint32_t GetHitCount() const
Returns the number hit count of all watchpoints in this list.
void Dump(Stream *s) const
Standard "Dump" method.
void RemoveAll(bool notify)
bool Remove(lldb::watch_id_t watchID, bool notify)
Removes the watchpoint given by watchID from this list.
~WatchpointList()
Destructor, currently does nothing.
wp_collection m_watchpoints
wp_collection::const_iterator GetIDConstIterator(lldb::watch_id_t watchID) const
const lldb::WatchpointSP FindByAddress(lldb::addr_t addr) const
Returns a shared pointer to the watchpoint at address addr - const version.
void DumpWithLevel(Stream *s, lldb::DescriptionLevel description_level) const
Dump with lldb::DescriptionLevel.
#define LLDB_INVALID_WATCH_ID
A class that represents a running process on the host machine.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::Watchpoint > WatchpointSP