9#ifndef LLDB_BREAKPOINT_STOPPOINTSITELIST_H
10#define LLDB_BREAKPOINT_STOPPOINTSITELIST_H
40 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
41 typename collection::iterator iter =
m_site_list.find(site_load_addr);
47 return site_sp->GetID();
57 s->
Printf(
"%p: ",
static_cast<const void *
>(
this));
58 s->
Printf(
"StopPointSiteList with %u ConstituentSites:\n",
61 typename collection::const_iterator pos;
62 typename collection::const_iterator end =
m_site_list.end();
78 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
79 typename collection::iterator iter =
m_site_list.find(addr);
81 found_sp = iter->second;
93 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
97 stop_sp = pos->second;
111 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
115 stop_sp = pos->second;
129 return site->GetID();
151 void ForEach(std::function<
void(StopPointSite *)>
const &callback) {
152 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
154 callback(pair.second.get());
164 bool Remove(
typename StopPointSite::SiteID site_id) {
165 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
182 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
183 typename collection::iterator pos =
m_site_list.find(addr);
193 if (lower_bound > upper_bound)
196 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
197 typename collection::const_iterator lower, upper, pos;
199 if (lower ==
m_site_list.end() || (*lower).first >= upper_bound)
206 typename collection::const_iterator prev_pos = lower;
209 if (prev_site->GetLoadAddress() + prev_site->GetByteSize() > lower_bound)
210 bp_site_list.
Add(prev_site);
215 for (pos = lower; pos != upper; pos++)
216 bp_site_list.
Add((*pos).second);
234 typename StopPointSite::SiteID site_id) {
239 return site_sp->ShouldStop(context);
251 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
256 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
260 std::vector<StopPointSiteSP>
Sites() {
261 std::vector<StopPointSiteSP> sites;
262 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
263 typename collection::iterator iter =
m_site_list.begin();
265 sites.push_back(iter->second);
273 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
280 typename collection::iterator
282 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
284 [site_id](
const std::pair<lldb::addr_t, StopPointSiteSP> s) {
285 return site_id == s.second->GetID();
292 typename collection::const_iterator
294 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
296 [site_id](
const std::pair<lldb::addr_t, StopPointSiteSP> s) {
297 return site_id == s.second->GetID();
A plug-in interface definition class for debugging a process.
collection::const_iterator GetIDConstIterator(typename StopPointSite::SiteID site_id) const
std::recursive_mutex m_mutex
void Dump(Stream *s) const
Standard Dump routine, doesn't do anything at present.
StopPointSite::SiteID Add(const StopPointSiteSP &site_sp)
Add a site to the list.
void ForEach(std::function< void(StopPointSite *)> const &callback)
bool FindInRange(lldb::addr_t lower_bound, lldb::addr_t upper_bound, StopPointSiteList &bp_site_list) const
StopPointSiteSP FindByID(typename StopPointSite::SiteID site_id)
Returns a shared pointer to the site with id site_id.
void(* StopPointSiteSPMapFunc)(StopPointSite &site, void *baton)
bool Remove(typename StopPointSite::SiteID site_id)
Removes the site given by site_id from this list.
StopPointSiteSP FindByAddress(lldb::addr_t addr)
Returns a shared pointer to the site at address addr.
collection::iterator GetIDIterator(typename StopPointSite::SiteID site_id)
std::vector< StopPointSiteSP > Sites()
const StopPointSiteSP FindByID(typename StopPointSite::SiteID site_id) const
Returns a shared pointer to the site with id site_id - const version.
bool RemoveByAddress(lldb::addr_t addr)
Removes the site at address addr from this list.
bool ShouldStop(StoppointCallbackContext *context, typename StopPointSite::SiteID site_id)
Enquires of the site on in this list with ID site_id whether we should stop for the constituent or no...
bool StopPointSiteContainsBreakpoint(typename StopPointSite::SiteID, lldb::break_id_t bp_id)
Returns whether the BreakpointSite site_id has a BreakpointLocation that is part of Breakpoint bp_id.
StopPointSite::SiteID FindIDByAddress(lldb::addr_t addr)
Returns the site id to the site at address addr.
size_t GetSize() const
Returns the number of elements in the list.
std::map< lldb::addr_t, StopPointSiteSP > collection
std::shared_ptr< StopPointSite > StopPointSiteSP
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.
A class that represents a running process on the host machine.