26 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
27 collection::iterator iter =
m_bp_site_list.find(bp_site_load_addr);
30 m_bp_site_list.insert(iter, collection::value_type(bp_site_load_addr, bp));
39 BreakpointSiteSP site_sp(
FindByID(site_id));
44 return site_sp->ShouldStop(context);
55 return bp.get()->GetID();
64 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
74 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
87 bool operator()(std::pair<lldb::addr_t, BreakpointSiteSP> val_pair)
const {
88 return m_break_id == val_pair.second->GetID();
95BreakpointSiteList::collection::iterator
97 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
103BreakpointSiteList::collection::const_iterator
105 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
112 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
113 BreakpointSiteSP stop_sp;
116 stop_sp = pos->second;
121const BreakpointSiteSP
123 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
124 BreakpointSiteSP stop_sp;
127 stop_sp = pos->second;
133 BreakpointSiteSP found_sp;
134 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
137 found_sp = iter->second;
143 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
146 return pos->second->IsBreakpointAtThisSite(bp_id);
152 s->
Printf(
"%p: ",
static_cast<const void *
>(
this));
154 s->
Printf(
"BreakpointSiteList with %u BreakpointSites:\n",
157 collection::const_iterator pos;
160 pos->second->Dump(s);
166 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
168 callback(pair.second.get());
174 if (lower_bound > upper_bound)
177 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
178 collection::const_iterator lower, upper, pos;
180 if (lower ==
m_bp_site_list.end() || (*lower).first >= upper_bound)
187 collection::const_iterator prev_pos = lower;
189 const BreakpointSiteSP &prev_bp = (*prev_pos).second;
190 if (prev_bp->GetLoadAddress() + prev_bp->GetByteSize() > lower_bound)
191 bp_site_list.
Add(prev_bp);
196 for (pos = lower; pos != upper; pos++) {
197 bp_site_list.
Add((*pos).second);
BreakpointSiteIDMatches(lldb::break_id_t break_id)
bool operator()(std::pair< lldb::addr_t, BreakpointSiteSP > val_pair) const
const lldb::break_id_t m_break_id
"lldb/Breakpoint/BreakpointSiteList.h" Class that manages lists of BreakpointSite shared pointers.
void Dump(Stream *s) const
Standard Dump routine, doesn't do anything at present.
BreakpointSiteList()
Default constructor makes an empty list.
bool FindInRange(lldb::addr_t lower_bound, lldb::addr_t upper_bound, BreakpointSiteList &bp_site_list) const
collection::iterator GetIDIterator(lldb::break_id_t breakID)
bool BreakpointSiteContainsBreakpoint(lldb::break_id_t bp_site_id, lldb::break_id_t bp_id)
Returns whether the breakpoint site bp_site_id has bp_id.
collection m_bp_site_list
~BreakpointSiteList()
Destructor, currently does nothing.
lldb::BreakpointSiteSP FindByAddress(lldb::addr_t addr)
Returns a shared pointer to the breakpoint site at address addr.
lldb::BreakpointSiteSP FindByID(lldb::break_id_t breakID)
Returns a shared pointer to the breakpoint site with id breakID.
collection::const_iterator GetIDConstIterator(lldb::break_id_t breakID) const
lldb::break_id_t FindIDByAddress(lldb::addr_t addr)
Returns the breakpoint site id to the breakpoint site at address addr.
bool ShouldStop(StoppointCallbackContext *context, lldb::break_id_t breakID)
Enquires of the breakpoint site on in this list with ID breakID whether we should stop for the breakp...
void ForEach(std::function< void(BreakpointSite *)> const &callback)
std::recursive_mutex m_mutex
bool Remove(lldb::break_id_t breakID)
Removes the breakpoint site given by breakID from this list.
bool RemoveByAddress(lldb::addr_t addr)
Removes the breakpoint site at address addr from this list.
lldb::break_id_t Add(const lldb::BreakpointSiteSP &bp_site_sp)
Add a BreakpointSite to the list.
Class that manages the actual breakpoint that will be inserted into the running program.
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.
#define LLDB_INVALID_BREAK_ID
A class that represents a running process on the host machine.