13#include "llvm/Support/Errc.h"
19 Target &target = bp->GetTarget();
26 : m_next_break_id(0), m_is_internal(is_internal) {}
31 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
41 return bp_sp->GetID();
45 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
47 auto it = std::find_if(
49 [&](
const BreakpointSP &bp) { return bp->GetID() == break_id; });
63 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
65 bp_sp->RemoveInvalidLocations(arch);
69 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
71 bp_sp->SetEnabled(enabled);
75 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
77 if (bp_sp->AllowDisable())
78 bp_sp->SetEnabled(enabled);
82 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
94 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
97 if (bp_sp->AllowDelete())
98 bp_sp->ClearAllBreakpointSites();
104 [&](
const BreakpointSP &bp) {
return bp->AllowDelete(); });
107BreakpointList::bp_collection::iterator
111 [&](
const BreakpointSP &bp) { return bp->GetID() == break_id; });
114BreakpointList::bp_collection::const_iterator
118 [&](
const BreakpointSP &bp) { return bp->GetID() == break_id; });
122 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
130llvm::Expected<std::vector<lldb::BreakpointSP>>
133 return llvm::createStringError(llvm::errc::invalid_argument,
134 "FindBreakpointsByName requires a name");
138 return error.ToError();
140 std::vector<lldb::BreakpointSP> matching_bps;
142 if (bkpt_sp->MatchesName(name)) {
143 matching_bps.push_back(bkpt_sp);
151 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
152 s->
Printf(
"%p: ",
static_cast<const void *
>(
this));
154 s->
Printf(
"BreakpointList with %u Breakpoints:\n",
163 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
170 bool delete_locations) {
171 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
173 bp_sp->ModulesChanged(module_list, added, delete_locations);
178 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
180 bp_sp->ModuleReplaced(old_module_sp, new_module_sp);
184 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
186 bp_sp->ClearAllBreakpointSites();
190 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
192 bp_sp->ResetHitCount();
196 std::unique_lock<std::recursive_mutex> &lock) {
197 lock = std::unique_lock<std::recursive_mutex>(
m_mutex);
static void NotifyChange(const BreakpointSP &bp, BreakpointEventType event)
static llvm::raw_ostream & error(Stream &strm)
An architecture specification class.
static bool StringIsBreakpointName(llvm::StringRef str, Status &error)
Takes an input string and checks to see whether it is a breakpoint name.
BreakpointIterable Breakpoints()
void RemoveInvalidLocations(const ArchSpec &arch)
Removes all invalid breakpoint locations.
lldb::BreakpointSP FindBreakpointByID(lldb::break_id_t breakID) const
Returns a shared pointer to the breakpoint with id breakID.
bp_collection m_breakpoints
void GetListMutex(std::unique_lock< std::recursive_mutex > &lock)
Sets the passed in Locker to hold the Breakpoint List mutex.
bp_collection::const_iterator GetBreakpointIDConstIterator(lldb::break_id_t breakID) const
lldb::break_id_t Add(lldb::BreakpointSP &bp_sp, bool notify)
Add the breakpoint bp_sp to the list.
void SetEnabledAllowed(bool enabled)
bp_collection::iterator GetBreakpointIDIterator(lldb::break_id_t breakID)
BreakpointList(bool is_internal)
void ResetHitCounts()
Resets the hit count of all breakpoints.
void UpdateBreakpointsWhenModuleIsReplaced(lldb::ModuleSP old_module_sp, lldb::ModuleSP new_module_sp)
void RemoveAll(bool notify)
Removes all the breakpoints from this list.
void UpdateBreakpoints(ModuleList &module_list, bool load, bool delete_locations)
Tell all the breakpoints to update themselves due to a change in the modules in module_list.
void ClearAllBreakpointSites()
std::recursive_mutex m_mutex
llvm::Expected< std::vector< lldb::BreakpointSP > > FindBreakpointsByName(const char *name)
Find all the breakpoints with a given name.
void Dump(Stream *s) const
Standard "Dump" method. At present it does nothing.
bool Remove(lldb::break_id_t breakID, bool notify)
Removes the breakpoint given by breakID from this list.
lldb::break_id_t m_next_break_id
void RemoveAllowed(bool notify)
Removes all the breakpoints from this list - first checking the ePermDelete on the breakpoints.
lldb::BreakpointSP GetBreakpointAtIndex(size_t i) const
Returns a shared pointer to the breakpoint with index i.
void SetEnabledAll(bool enabled)
bool EventTypeHasListeners(uint32_t event_type)
void BroadcastEvent(lldb::EventSP &event_sp)
Broadcast an event which has no associated data.
A collection class for Module objects.
A stream class that can stream formatted output to a file.
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
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.
@ eBroadcastBitBreakpointChanged
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::Module > ModuleSP