21 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
25 if (wp_sp->GetTarget().EventTypeHasListeners(
27 auto data_sp = std::make_shared<Watchpoint::WatchpointEventData>(
28 eWatchpointEventTypeAdded, wp_sp);
33 return wp_sp->GetID();
42 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
43 s->
Printf(
"%p: ",
static_cast<const void *
>(
this));
45 s->
Printf(
"WatchpointList with %" PRIu64
" Watchpoints:\n",
50 (*pos)->DumpWithLevel(s, description_level);
56 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
61 uint32_t wp_bytesize = (*pos)->GetByteSize();
62 if ((wp_addr <= addr) && ((wp_addr + wp_bytesize) > addr)) {
74 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
78 if ((*pos)->GetWatchSpec() == spec) {
99WatchpointList::wp_collection::iterator
105WatchpointList::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 auto data_sp = std::make_shared<Watchpoint::WatchpointEventData>(
176 eWatchpointEventTypeRemoved, wp_sp);
177 wp_sp->GetTarget().BroadcastEvent(
188 uint32_t hit_count = 0;
189 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
190 wp_collection::const_iterator pos, end =
m_watchpoints.end();
192 hit_count += (*pos)->GetHitCount();
204 return wp_sp->ShouldStop(context);
212 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
222 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
226 (*pos)->SetEnabled(enabled);
230 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
236 if ((*pos)->GetTarget().EventTypeHasListeners(
238 auto data_sp = std::make_shared<Watchpoint::WatchpointEventData>(
239 eWatchpointEventTypeRemoved, *pos);
240 (*pos)->GetTarget().BroadcastEvent(
250 std::unique_lock<std::recursive_mutex> &lock) {
251 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
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