LLDB mainline
|
General Outline: Allows adding and removing breakpoints and find by ID and index. More...
#include "lldb/Breakpoint/BreakpointList.h"
Public Types | |
typedef LockingAdaptedIterable< bp_collection, lldb::BreakpointSP, list_adapter, std::recursive_mutex > | BreakpointIterable |
Public Member Functions | |
BreakpointList (bool is_internal) | |
~BreakpointList () | |
lldb::break_id_t | Add (lldb::BreakpointSP &bp_sp, bool notify) |
Add the breakpoint bp_sp to the list. | |
void | Dump (Stream *s) const |
Standard "Dump" method. At present it does nothing. | |
lldb::BreakpointSP | FindBreakpointByID (lldb::break_id_t breakID) const |
Returns a shared pointer to the breakpoint with id breakID. | |
lldb::BreakpointSP | GetBreakpointAtIndex (size_t i) const |
Returns a shared pointer to the breakpoint with index i. | |
llvm::Expected< std::vector< lldb::BreakpointSP > > | FindBreakpointsByName (const char *name) |
Find all the breakpoints with a given name. | |
size_t | GetSize () const |
Returns the number of elements in this breakpoint list. | |
bool | Remove (lldb::break_id_t breakID, bool notify) |
Removes the breakpoint given by breakID from this list. | |
void | RemoveInvalidLocations (const ArchSpec &arch) |
Removes all invalid breakpoint locations. | |
void | SetEnabledAll (bool enabled) |
void | SetEnabledAllowed (bool enabled) |
void | RemoveAll (bool notify) |
Removes all the breakpoints from this list. | |
void | RemoveAllowed (bool notify) |
Removes all the breakpoints from this list - first checking the ePermDelete on the breakpoints. | |
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 | UpdateBreakpointsWhenModuleIsReplaced (lldb::ModuleSP old_module_sp, lldb::ModuleSP new_module_sp) |
void | ClearAllBreakpointSites () |
void | ResetHitCounts () |
Resets the hit count of all breakpoints. | |
void | GetListMutex (std::unique_lock< std::recursive_mutex > &lock) |
Sets the passed in Locker to hold the Breakpoint List mutex. | |
BreakpointIterable | Breakpoints () |
Protected Types | |
typedef std::vector< lldb::BreakpointSP > | bp_collection |
Protected Member Functions | |
bp_collection::iterator | GetBreakpointIDIterator (lldb::break_id_t breakID) |
bp_collection::const_iterator | GetBreakpointIDConstIterator (lldb::break_id_t breakID) const |
std::recursive_mutex & | GetMutex () const |
Protected Attributes | |
std::recursive_mutex | m_mutex |
bp_collection | m_breakpoints |
lldb::break_id_t | m_next_break_id |
bool | m_is_internal |
Private Member Functions | |
BreakpointList (const BreakpointList &)=delete | |
const BreakpointList & | operator= (const BreakpointList &)=delete |
General Outline: Allows adding and removing breakpoints and find by ID and index.
This class manages a list of breakpoints.
Definition at line 25 of file BreakpointList.h.
|
protected |
Definition at line 151 of file BreakpointList.h.
typedef LockingAdaptedIterable<bp_collection, lldb::BreakpointSP, list_adapter, std::recursive_mutex> lldb_private::BreakpointList::BreakpointIterable |
Definition at line 168 of file BreakpointList.h.
BreakpointList::BreakpointList | ( | bool | is_internal | ) |
Definition at line 25 of file BreakpointList.cpp.
|
default |
|
privatedelete |
break_id_t BreakpointList::Add | ( | lldb::BreakpointSP & | bp_sp, |
bool | notify | ||
) |
Add the breakpoint bp_sp to the list.
[in] | bp_sp | Shared pointer to the breakpoint that will get added to the list. |
Definition at line 30 of file BreakpointList.cpp.
References m_breakpoints, m_is_internal, m_mutex, m_next_break_id, and NotifyChange().
Referenced by lldb_private::Target::AddBreakpoint().
|
inline |
Definition at line 169 of file BreakpointList.h.
References GetMutex(), and m_breakpoints.
Referenced by lldb_private::Target::DeleteBreakpointName(), CommandObjectBreakpointDelete::DoExecute(), CommandObjectBreakpointNameList::DoExecute(), CommandObjectProcessContinue::DoExecute(), lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), FindBreakpointsByName(), and lldb_private::Target::PrimeFromDummyTarget().
void BreakpointList::ClearAllBreakpointSites | ( | ) |
Definition at line 183 of file BreakpointList.cpp.
References m_breakpoints, and m_mutex.
Referenced by lldb_private::Target::CleanupProcess(), and RemoveAll().
void BreakpointList::Dump | ( | Stream * | s | ) | const |
Standard "Dump" method. At present it does nothing.
Definition at line 150 of file BreakpointList.cpp.
References lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_breakpoints, m_mutex, and lldb_private::Stream::Printf().
Referenced by lldb_private::Target::Dump().
BreakpointSP BreakpointList::FindBreakpointByID | ( | lldb::break_id_t | breakID | ) | const |
Returns a shared pointer to the breakpoint with id breakID.
Const version.
[in] | breakID | The breakpoint ID to seek for. |
Definition at line 121 of file BreakpointList.cpp.
References GetBreakpointIDConstIterator(), m_breakpoints, and m_mutex.
Referenced by lldb_private::Target::AddNameToBreakpoint(), lldb_private::Target::DisableBreakpointByID(), CommandObjectBreakpointClear::DoExecute(), CommandObjectBreakpointNameAdd::DoExecute(), CommandObjectBreakpointNameDelete::DoExecute(), CommandObjectBreakpointRead::DoExecute(), CommandObjectProcessContinue::DoExecute(), lldb_private::Target::EnableBreakpointByID(), lldb_private::Target::GetBreakpointByID(), and lldb::SBBreakpointCallbackBaton::PrivateBreakpointHitCallback().
llvm::Expected< std::vector< lldb::BreakpointSP > > BreakpointList::FindBreakpointsByName | ( | const char * | name | ) |
Find all the breakpoints with a given name.
[in] | name | The breakpoint name for which to search. |
Definition at line 131 of file BreakpointList.cpp.
References Breakpoints(), error(), and lldb_private::BreakpointID::StringIsBreakpointName().
Referenced by lldb_private::Target::ApplyNameToBreakpoints().
BreakpointSP BreakpointList::GetBreakpointAtIndex | ( | size_t | i | ) | const |
Returns a shared pointer to the breakpoint with index i.
[in] | i | The breakpoint index to seek for. |
Definition at line 162 of file BreakpointList.cpp.
References m_breakpoints, and m_mutex.
Referenced by lldb_private::CommandCompletions::Breakpoints(), CommandObjectBreakpointList::DoExecute(), CommandObjectBreakpointClear::DoExecute(), lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), lldb_private::Target::SerializeBreakpointsToFile(), and lldb_private::TargetStats::ToJSON().
|
protected |
Definition at line 115 of file BreakpointList.cpp.
References m_breakpoints.
Referenced by FindBreakpointByID().
|
protected |
Definition at line 108 of file BreakpointList.cpp.
References m_breakpoints.
void BreakpointList::GetListMutex | ( | std::unique_lock< std::recursive_mutex > & | lock | ) |
Sets the passed in Locker to hold the Breakpoint List mutex.
[in] | lock | The locker object that is set. |
Definition at line 195 of file BreakpointList.cpp.
References m_mutex.
Referenced by lldb_private::CommandCompletions::Breakpoints(), lldb_private::Target::CreateBreakpointsFromFile(), CommandObjectBreakpointModify::DoExecute(), CommandObjectBreakpointEnable::DoExecute(), CommandObjectBreakpointList::DoExecute(), CommandObjectBreakpointClear::DoExecute(), CommandObjectBreakpointDelete::DoExecute(), CommandObjectBreakpointNameConfigure::DoExecute(), CommandObjectBreakpointNameAdd::DoExecute(), CommandObjectBreakpointNameDelete::DoExecute(), CommandObjectBreakpointNameList::DoExecute(), CommandObjectBreakpointRead::DoExecute(), CommandObjectBreakpointWrite::DoExecute(), lldb_private::Target::SerializeBreakpointsToFile(), and lldb_private::TargetStats::ToJSON().
|
inlineprotected |
|
inline |
Returns the number of elements in this breakpoint list.
Definition at line 79 of file BreakpointList.h.
References m_breakpoints, and m_mutex.
Referenced by lldb_private::CommandCompletions::Breakpoints(), CommandObjectBreakpointEnable::DoExecute(), CommandObjectBreakpointList::DoExecute(), CommandObjectBreakpointClear::DoExecute(), CommandObjectBreakpointDelete::DoExecute(), CommandObjectBreakpointNameAdd::DoExecute(), CommandObjectBreakpointNameDelete::DoExecute(), CommandObjectBreakpointCommandDelete::DoExecute(), CommandObjectBreakpointCommandList::DoExecute(), lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), lldb_private::Target::SerializeBreakpointsToFile(), and lldb_private::TargetStats::ToJSON().
|
privatedelete |
bool BreakpointList::Remove | ( | lldb::break_id_t | breakID, |
bool | notify | ||
) |
Removes the breakpoint given by breakID from this list.
[in] | breakID | The breakpoint index to remove. |
Definition at line 44 of file BreakpointList.cpp.
References m_breakpoints, m_mutex, and NotifyChange().
Referenced by lldb_private::Target::RemoveBreakpointByID().
void BreakpointList::RemoveAll | ( | bool | notify | ) |
Removes all the breakpoints from this list.
Definition at line 81 of file BreakpointList.cpp.
References ClearAllBreakpointSites(), m_breakpoints, m_mutex, and NotifyChange().
Referenced by lldb_private::Target::Destroy(), and lldb_private::Target::RemoveAllBreakpoints().
void BreakpointList::RemoveAllowed | ( | bool | notify | ) |
Removes all the breakpoints from this list - first checking the ePermDelete on the breakpoints.
This call should be used unless you are shutting down and need to actually clear them all.
Definition at line 93 of file BreakpointList.cpp.
References m_breakpoints, m_mutex, and NotifyChange().
Referenced by lldb_private::Target::RemoveAllowedBreakpoints().
void BreakpointList::RemoveInvalidLocations | ( | const ArchSpec & | arch | ) |
Removes all invalid breakpoint locations.
Removes all breakpoint locations in the list with architectures that aren't compatible with arch. Also remove any breakpoint locations with whose locations have address where the section has been deleted (module and object files no longer exist).
This is typically used after the process calls exec, or anytime the architecture of the target changes.
[in] | arch | If valid, check the module in each breakpoint to make sure they are compatible, otherwise, ignore architecture. |
Definition at line 62 of file BreakpointList.cpp.
References m_breakpoints, and m_mutex.
Referenced by lldb_private::Target::DidExec().
void BreakpointList::ResetHitCounts | ( | ) |
Resets the hit count of all breakpoints.
Definition at line 189 of file BreakpointList.cpp.
References m_breakpoints, and m_mutex.
Referenced by lldb_private::Target::ResetBreakpointHitCounts().
void BreakpointList::SetEnabledAll | ( | bool | enabled | ) |
Definition at line 68 of file BreakpointList.cpp.
References m_breakpoints, and m_mutex.
Referenced by lldb_private::Target::DisableAllBreakpoints(), and lldb_private::Target::EnableAllBreakpoints().
void BreakpointList::SetEnabledAllowed | ( | bool | enabled | ) |
Definition at line 74 of file BreakpointList.cpp.
References m_breakpoints, and m_mutex.
Referenced by lldb_private::Target::DisableAllowedBreakpoints(), and lldb_private::Target::EnableAllowedBreakpoints().
void BreakpointList::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.
added says whether the module was loaded or unloaded.
[in] | module_list | The module list that has changed. |
[in] | load | true if the modules are loaded, false if unloaded. |
[in] | delete_locations | If load is false, then delete breakpoint locations when when updating breakpoints. |
Definition at line 169 of file BreakpointList.cpp.
References m_breakpoints, and m_mutex.
Referenced by lldb_private::Target::ModulesDidLoad(), lldb_private::Target::ModulesDidUnload(), and lldb_private::Target::SymbolsDidLoad().
void BreakpointList::UpdateBreakpointsWhenModuleIsReplaced | ( | lldb::ModuleSP | old_module_sp, |
lldb::ModuleSP | new_module_sp | ||
) |
Definition at line 176 of file BreakpointList.cpp.
References m_breakpoints, and m_mutex.
Referenced by lldb_private::Target::NotifyModuleUpdated().
|
protected |
Definition at line 161 of file BreakpointList.h.
Referenced by Add(), Breakpoints(), ClearAllBreakpointSites(), Dump(), FindBreakpointByID(), GetBreakpointAtIndex(), GetBreakpointIDConstIterator(), GetBreakpointIDIterator(), GetSize(), Remove(), RemoveAll(), RemoveAllowed(), RemoveInvalidLocations(), ResetHitCounts(), SetEnabledAll(), SetEnabledAllowed(), UpdateBreakpoints(), and UpdateBreakpointsWhenModuleIsReplaced().
|
protected |
Definition at line 163 of file BreakpointList.h.
Referenced by Add().
|
mutableprotected |
Definition at line 160 of file BreakpointList.h.
Referenced by Add(), ClearAllBreakpointSites(), Dump(), FindBreakpointByID(), GetBreakpointAtIndex(), GetListMutex(), GetMutex(), GetSize(), Remove(), RemoveAll(), RemoveAllowed(), RemoveInvalidLocations(), ResetHitCounts(), SetEnabledAll(), SetEnabledAllowed(), UpdateBreakpoints(), and UpdateBreakpointsWhenModuleIsReplaced().
|
protected |
Definition at line 162 of file BreakpointList.h.
Referenced by Add().