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) {
92 return m_watch_id == wp->GetID();
99WatchpointList::wp_collection::iterator
106WatchpointList::wp_collection::const_iterator
115 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
126 return wp_sp->GetID();
134 return wp_sp->GetID();
140 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
144 std::advance(pos, i);
151 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
155 std::advance(pos, i);
162 std::vector<lldb::watch_id_t> IDs;
163 wp_collection::const_iterator pos, end =
m_watchpoints.end();
165 IDs.push_back((*pos)->GetID());
170 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
175 if (wp_sp->GetTarget().EventTypeHasListeners(
177 auto data_sp = std::make_shared<Watchpoint::WatchpointEventData>(
178 eWatchpointEventTypeRemoved, wp_sp);
179 wp_sp->GetTarget().BroadcastEvent(
190 uint32_t hit_count = 0;
191 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
192 wp_collection::const_iterator pos, end =
m_watchpoints.end();
194 hit_count += (*pos)->GetHitCount();
206 return wp_sp->ShouldStop(context);
214 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
224 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
228 (*pos)->SetEnabled(enabled);
232 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
238 if ((*pos)->GetTarget().EventTypeHasListeners(
240 auto data_sp = std::make_shared<Watchpoint::WatchpointEventData>(
241 eWatchpointEventTypeRemoved, *pos);
242 (*pos)->GetTarget().BroadcastEvent(
252 std::unique_lock<std::recursive_mutex> &lock) {
253 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