LLDB mainline
|
This class is used by Watchpoint to manage a list of watchpoints,. More...
#include "lldb/Breakpoint/WatchpointList.h"
Public Types | |
typedef std::list< lldb::WatchpointSP > | wp_collection |
typedef LockingAdaptedIterable< wp_collection, lldb::WatchpointSP, vector_adapter, std::recursive_mutex > | WatchpointIterable |
Public Member Functions | |
WatchpointList () | |
Default constructor makes an empty list. | |
~WatchpointList () | |
Destructor, currently does nothing. | |
lldb::watch_id_t | Add (const lldb::WatchpointSP &wp_sp, bool notify) |
Add a Watchpoint to the list. | |
void | Dump (Stream *s) const |
Standard "Dump" method. | |
void | DumpWithLevel (Stream *s, lldb::DescriptionLevel description_level) const |
Dump with lldb::DescriptionLevel. | |
const lldb::WatchpointSP | FindByAddress (lldb::addr_t addr) const |
Returns a shared pointer to the watchpoint at address addr - const version. | |
const lldb::WatchpointSP | FindBySpec (std::string spec) const |
Returns a shared pointer to the watchpoint with watchpoint spec spec. | |
lldb::WatchpointSP | FindByID (lldb::watch_id_t watchID) const |
Returns a shared pointer to the watchpoint with id watchID, const version. | |
lldb::watch_id_t | FindIDByAddress (lldb::addr_t addr) |
Returns the watchpoint id to the watchpoint at address addr. | |
lldb::watch_id_t | FindIDBySpec (std::string spec) |
Returns the watchpoint id to the watchpoint with watchpoint spec spec. | |
lldb::WatchpointSP | GetByIndex (uint32_t i) |
Returns a shared pointer to the watchpoint with index i. | |
const lldb::WatchpointSP | GetByIndex (uint32_t i) const |
Returns a shared pointer to the watchpoint with index i, const version. | |
bool | Remove (lldb::watch_id_t watchID, bool notify) |
Removes the watchpoint given by watchID from this list. | |
uint32_t | GetHitCount () const |
Returns the number hit count of all watchpoints in this list. | |
bool | ShouldStop (StoppointCallbackContext *context, lldb::watch_id_t watchID) |
Enquires of the watchpoint in this list with ID watchID whether we should stop. | |
size_t | GetSize () const |
Returns the number of elements in this watchpoint list. | |
void | GetDescription (Stream *s, lldb::DescriptionLevel level) |
Print a description of the watchpoints in this list to the stream s. | |
void | SetEnabledAll (bool enabled) |
void | RemoveAll (bool notify) |
void | GetListMutex (std::unique_lock< std::recursive_mutex > &lock) |
Sets the passed in Locker to hold the Watchpoint List mutex. | |
WatchpointIterable | Watchpoints () const |
Protected Types | |
typedef std::vector< lldb::watch_id_t > | id_vector |
Protected Member Functions | |
id_vector | GetWatchpointIDs () const |
wp_collection::iterator | GetIDIterator (lldb::watch_id_t watchID) |
wp_collection::const_iterator | GetIDConstIterator (lldb::watch_id_t watchID) const |
Protected Attributes | |
wp_collection | m_watchpoints |
std::recursive_mutex | m_mutex |
lldb::watch_id_t | m_next_wp_id = 0 |
Friends | |
class | Watchpoint |
class | Target |
This class is used by Watchpoint to manage a list of watchpoints,.
Definition at line 27 of file WatchpointList.h.
|
protected |
Definition at line 198 of file WatchpointList.h.
typedef LockingAdaptedIterable<wp_collection, lldb::WatchpointSP, vector_adapter, std::recursive_mutex> lldb_private::WatchpointList::WatchpointIterable |
Definition at line 44 of file WatchpointList.h.
typedef std::list<lldb::WatchpointSP> lldb_private::WatchpointList::wp_collection |
Definition at line 41 of file WatchpointList.h.
|
default |
Default constructor makes an empty list.
|
default |
Destructor, currently does nothing.
lldb::watch_id_t WatchpointList::Add | ( | const lldb::WatchpointSP & | wp_sp, |
bool | notify | ||
) |
Add a Watchpoint to the list.
[in] | wp_sp | A shared pointer to a watchpoint being added to the list. |
Definition at line 20 of file WatchpointList.cpp.
References lldb_private::Target::eBroadcastBitWatchpointChanged, m_mutex, m_next_wp_id, and m_watchpoints.
Referenced by lldb_private::Target::CreateWatchpoint().
void WatchpointList::Dump | ( | Stream * | s | ) | const |
Standard "Dump" method.
Definition at line 36 of file WatchpointList.cpp.
References DumpWithLevel(), and lldb::eDescriptionLevelBrief.
void WatchpointList::DumpWithLevel | ( | Stream * | s, |
lldb::DescriptionLevel | description_level | ||
) | const |
Dump with lldb::DescriptionLevel.
Definition at line 40 of file WatchpointList.cpp.
References lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_mutex, m_watchpoints, and lldb_private::Stream::Printf().
Referenced by Dump().
const WatchpointSP WatchpointList::FindByAddress | ( | lldb::addr_t | addr | ) | const |
Returns a shared pointer to the watchpoint at address addr - const version.
[in] | addr | The address to look for. |
Definition at line 54 of file WatchpointList.cpp.
References m_mutex, and m_watchpoints.
Referenced by lldb_private::StopInfoMachException::CreateStopReasonWithMachException(), lldb_private::Target::CreateWatchpoint(), and FindIDByAddress().
WatchpointSP WatchpointList::FindByID | ( | lldb::watch_id_t | watchID | ) | const |
Returns a shared pointer to the watchpoint with id watchID, const version.
[in] | watchID | The watchpoint location ID to seek for. |
Definition at line 113 of file WatchpointList.cpp.
References GetIDConstIterator(), m_mutex, and m_watchpoints.
Referenced by lldb_private::Target::DisableWatchpointByID(), CommandObjectWatchpointList::DoExecute(), CommandObjectWatchpointModify::DoExecute(), CommandObjectWatchpointCommandDelete::DoExecute(), CommandObjectWatchpointCommandList::DoExecute(), lldb_private::Target::EnableWatchpointByID(), lldb_private::Target::IgnoreWatchpointByID(), lldb_private::Target::RemoveWatchpointByID(), ShouldStop(), and lldb_private::ScriptInterpreterLua::WatchpointCallbackFunction().
const WatchpointSP WatchpointList::FindBySpec | ( | std::string | spec | ) | const |
Returns a shared pointer to the watchpoint with watchpoint spec spec.
[in] | spec | The watchpoint spec to look for. |
Definition at line 72 of file WatchpointList.cpp.
References m_mutex, and m_watchpoints.
Referenced by FindIDBySpec().
lldb::watch_id_t WatchpointList::FindIDByAddress | ( | lldb::addr_t | addr | ) |
Returns the watchpoint id to the watchpoint at address addr.
[in] | addr | The address to match. |
Definition at line 123 of file WatchpointList.cpp.
References FindByAddress(), and LLDB_INVALID_WATCH_ID.
lldb::watch_id_t WatchpointList::FindIDBySpec | ( | std::string | spec | ) |
Returns the watchpoint id to the watchpoint with watchpoint spec spec.
[in] | spec | The watchpoint spec to match. |
Definition at line 131 of file WatchpointList.cpp.
References FindBySpec(), and LLDB_INVALID_WATCH_ID.
WatchpointSP WatchpointList::GetByIndex | ( | uint32_t | i | ) |
Returns a shared pointer to the watchpoint with index i.
[in] | i | The watchpoint index to seek for. |
Definition at line 139 of file WatchpointList.cpp.
References m_mutex, and m_watchpoints.
Referenced by CommandObjectWatchpointList::DoExecute().
const WatchpointSP WatchpointList::GetByIndex | ( | uint32_t | i | ) | const |
Returns a shared pointer to the watchpoint with index i, const version.
[in] | i | The watchpoint index to seek for. |
Definition at line 150 of file WatchpointList.cpp.
References m_mutex, and m_watchpoints.
void WatchpointList::GetDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level | ||
) |
Print a description of the watchpoints in this list to the stream s.
[in] | s | The stream to which to print the description. |
[in] | level | The description level that indicates the detail level to provide. |
Definition at line 213 of file WatchpointList.cpp.
References m_mutex, m_watchpoints, and lldb_private::Stream::Printf().
uint32_t WatchpointList::GetHitCount | ( | ) | const |
Returns the number hit count of all watchpoints in this list.
Definition at line 189 of file WatchpointList.cpp.
References m_mutex, and m_watchpoints.
|
protected |
Definition at line 107 of file WatchpointList.cpp.
References m_watchpoints.
Referenced by FindByID().
|
protected |
Definition at line 100 of file WatchpointList.cpp.
References m_watchpoints.
Referenced by Remove().
void WatchpointList::GetListMutex | ( | std::unique_lock< std::recursive_mutex > & | lock | ) |
Sets the passed in Locker to hold the Watchpoint List mutex.
[in] | lock | The locker object that is set. |
Definition at line 251 of file WatchpointList.cpp.
References m_mutex.
Referenced by lldb_private::Target::CleanupProcess(), lldb_private::Target::CreateWatchpoint(), CommandObjectWatchpointList::DoExecute(), CommandObjectWatchpointEnable::DoExecute(), CommandObjectWatchpointDisable::DoExecute(), CommandObjectWatchpointDelete::DoExecute(), CommandObjectWatchpointIgnore::DoExecute(), and CommandObjectWatchpointModify::DoExecute().
|
inline |
Returns the number of elements in this watchpoint list.
Definition at line 166 of file WatchpointList.h.
References m_mutex, and m_watchpoints.
Referenced by CommandObjectWatchpointList::DoExecute(), CommandObjectWatchpointEnable::DoExecute(), CommandObjectWatchpointDisable::DoExecute(), CommandObjectWatchpointDelete::DoExecute(), CommandObjectWatchpointIgnore::DoExecute(), CommandObjectWatchpointModify::DoExecute(), CommandObjectWatchpointCommandDelete::DoExecute(), and CommandObjectWatchpointCommandList::DoExecute().
|
protected |
Definition at line 161 of file WatchpointList.cpp.
References m_watchpoints.
bool WatchpointList::Remove | ( | lldb::watch_id_t | watchID, |
bool | notify | ||
) |
Removes the watchpoint given by watchID from this list.
[in] | watchID | The watchpoint ID to remove. |
Definition at line 169 of file WatchpointList.cpp.
References lldb_private::Target::eBroadcastBitWatchpointChanged, GetIDIterator(), m_mutex, and m_watchpoints.
Referenced by lldb_private::Target::CreateWatchpoint(), and lldb_private::Target::RemoveWatchpointByID().
void WatchpointList::RemoveAll | ( | bool | notify | ) |
Definition at line 231 of file WatchpointList.cpp.
References lldb_private::Target::eBroadcastBitBreakpointChanged, lldb_private::Target::eBroadcastBitWatchpointChanged, m_mutex, and m_watchpoints.
Referenced by lldb_private::Target::Destroy(), and lldb_private::Target::RemoveAllWatchpoints().
void WatchpointList::SetEnabledAll | ( | bool | enabled | ) |
Definition at line 223 of file WatchpointList.cpp.
References m_mutex, and m_watchpoints.
Referenced by lldb_private::Target::DisableAllWatchpoints(), and lldb_private::Target::EnableAllWatchpoints().
bool WatchpointList::ShouldStop | ( | StoppointCallbackContext * | context, |
lldb::watch_id_t | watchID | ||
) |
Enquires of the watchpoint in this list with ID watchID whether we should stop.
[in] | context | This contains the information about this stop. |
[in] | watchID | This watch ID that we hit. |
Definition at line 198 of file WatchpointList.cpp.
References FindByID().
|
inline |
Definition at line 193 of file WatchpointList.h.
References m_mutex, and m_watchpoints.
Referenced by lldb_private::Target::ClearAllWatchpointHistoricValues(), lldb_private::Target::ClearAllWatchpointHitCounts(), lldb_private::Target::DisableAllWatchpoints(), lldb_private::Target::EnableAllWatchpoints(), lldb_private::Target::IgnoreAllWatchpoints(), lldb_private::Target::RemoveAllWatchpoints(), and lldb_private::CommandCompletions::WatchPointIDs().
|
friend |
Definition at line 32 of file WatchpointList.h.
|
friend |
Definition at line 31 of file WatchpointList.h.
|
mutableprotected |
Definition at line 208 of file WatchpointList.h.
Referenced by Add(), DumpWithLevel(), FindByAddress(), FindByID(), FindBySpec(), GetByIndex(), GetDescription(), GetHitCount(), GetListMutex(), GetSize(), Remove(), RemoveAll(), SetEnabledAll(), and Watchpoints().
|
protected |
Definition at line 210 of file WatchpointList.h.
Referenced by Add().
|
protected |
Definition at line 207 of file WatchpointList.h.
Referenced by Add(), DumpWithLevel(), FindByAddress(), FindByID(), FindBySpec(), GetByIndex(), GetDescription(), GetHitCount(), GetIDConstIterator(), GetIDIterator(), GetSize(), GetWatchpointIDs(), Remove(), RemoveAll(), SetEnabledAll(), and Watchpoints().