LLDB  mainline
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
lldb_private::WatchpointList Class Reference

This class is used by Watchpoint to manage a list of watchpoints,. More...

#include "lldb/Breakpoint/WatchpointList.h"

Collaboration diagram for lldb_private::WatchpointList:
Collaboration graph
[legend]

Public Member Functions

 WatchpointList ()
 Default constructor makes an empty list. More...
 
 ~WatchpointList ()
 Destructor, currently does nothing. More...
 
lldb::watch_id_t Add (const lldb::WatchpointSP &wp_sp, bool notify)
 Add a Watchpoint to the list. More...
 
void Dump (Stream *s) const
 Standard "Dump" method. More...
 
void DumpWithLevel (Stream *s, lldb::DescriptionLevel description_level) const
 Dump with lldb::DescriptionLevel. More...
 
const lldb::WatchpointSP FindByAddress (lldb::addr_t addr) const
 Returns a shared pointer to the watchpoint at address addr - const version. More...
 
const lldb::WatchpointSP FindBySpec (std::string spec) const
 Returns a shared pointer to the watchpoint with watchpoint spec spec. More...
 
lldb::WatchpointSP FindByID (lldb::watch_id_t watchID) const
 Returns a shared pointer to the watchpoint with id watchID, const version. More...
 
lldb::watch_id_t FindIDByAddress (lldb::addr_t addr)
 Returns the watchpoint id to the watchpoint at address addr. More...
 
lldb::watch_id_t FindIDBySpec (std::string spec)
 Returns the watchpoint id to the watchpoint with watchpoint spec spec. More...
 
lldb::WatchpointSP GetByIndex (uint32_t i)
 Returns a shared pointer to the watchpoint with index i. More...
 
const lldb::WatchpointSP GetByIndex (uint32_t i) const
 Returns a shared pointer to the watchpoint with index i, const version. More...
 
bool Remove (lldb::watch_id_t watchID, bool notify)
 Removes the watchpoint given by watchID from this list. More...
 
uint32_t GetHitCount () const
 Returns the number hit count of all watchpoints in this list. More...
 
bool ShouldStop (StoppointCallbackContext *context, lldb::watch_id_t watchID)
 Enquires of the watchpoint in this list with ID watchID whether we should stop. More...
 
size_t GetSize () const
 Returns the number of elements in this watchpoint list. More...
 
void GetDescription (Stream *s, lldb::DescriptionLevel level)
 Print a description of the watchpoints in this list to the stream s. More...
 
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. More...
 

Protected Types

typedef std::list< lldb::WatchpointSP > wp_collection
 
typedef std::vector< lldb::watch_id_tid_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
 

Friends

class Watchpoint
 
class Target
 

Detailed Description

This class is used by Watchpoint to manage a list of watchpoints,.

Definition at line 26 of file WatchpointList.h.

Member Typedef Documentation

◆ id_vector

Definition at line 189 of file WatchpointList.h.

◆ wp_collection

typedef std::list<lldb::WatchpointSP> lldb_private::WatchpointList::wp_collection
protected

Definition at line 188 of file WatchpointList.h.

Constructor & Destructor Documentation

◆ WatchpointList()

WatchpointList::WatchpointList ( )

Default constructor makes an empty list.

Definition at line 15 of file WatchpointList.cpp.

◆ ~WatchpointList()

WatchpointList::~WatchpointList ( )

Destructor, currently does nothing.

Definition at line 18 of file WatchpointList.cpp.

Member Function Documentation

◆ Add()

lldb::watch_id_t WatchpointList::Add ( const lldb::WatchpointSP &  wp_sp,
bool  notify 
)

Add a Watchpoint to the list.

Parameters
[in]wp_spA shared pointer to a watchpoint being added to the list.
Returns
The ID of the Watchpoint in the list.

Definition at line 21 of file WatchpointList.cpp.

References lldb_private::Target::eBroadcastBitWatchpointChanged, m_mutex, m_next_wp_id, and m_watchpoints.

Referenced by lldb_private::Target::CreateWatchpoint().

◆ Dump()

void WatchpointList::Dump ( Stream s) const

Standard "Dump" method.

Definition at line 35 of file WatchpointList.cpp.

References DumpWithLevel(), and lldb::eDescriptionLevelBrief.

◆ DumpWithLevel()

void WatchpointList::DumpWithLevel ( Stream s,
lldb::DescriptionLevel  description_level 
) const

◆ FindByAddress()

const WatchpointSP WatchpointList::FindByAddress ( lldb::addr_t  addr) const

Returns a shared pointer to the watchpoint at address addr - const version.

Parameters
[in]addrThe address to look for.
Returns
A shared pointer to the watchpoint. May contain a NULL pointer if the watchpoint doesn't exist.

Definition at line 53 of file WatchpointList.cpp.

References m_mutex, and m_watchpoints.

Referenced by lldb_private::Target::CreateWatchpoint(), FindIDByAddress(), lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo(), and FreeBSDThread::WatchNotify().

◆ FindByID()

WatchpointSP WatchpointList::FindByID ( lldb::watch_id_t  watchID) const

◆ FindBySpec()

const WatchpointSP WatchpointList::FindBySpec ( std::string  spec) const

Returns a shared pointer to the watchpoint with watchpoint spec spec.

  • const version.
Parameters
[in]specThe watchpoint spec to look for.
Returns
A shared pointer to the watchpoint. May contain a NULL pointer if the watchpoint doesn't exist.

Definition at line 71 of file WatchpointList.cpp.

References m_mutex, and m_watchpoints.

Referenced by FindIDBySpec().

◆ FindIDByAddress()

lldb::watch_id_t WatchpointList::FindIDByAddress ( lldb::addr_t  addr)

Returns the watchpoint id to the watchpoint at address addr.

Parameters
[in]addrThe address to match.
Returns
The ID of the watchpoint, or LLDB_INVALID_WATCH_ID.

Definition at line 122 of file WatchpointList.cpp.

References FindByAddress(), and LLDB_INVALID_WATCH_ID.

◆ FindIDBySpec()

lldb::watch_id_t WatchpointList::FindIDBySpec ( std::string  spec)

Returns the watchpoint id to the watchpoint with watchpoint spec spec.

Parameters
[in]specThe watchpoint spec to match.
Returns
The ID of the watchpoint, or LLDB_INVALID_WATCH_ID.

Definition at line 130 of file WatchpointList.cpp.

References FindBySpec(), and LLDB_INVALID_WATCH_ID.

◆ GetByIndex() [1/2]

WatchpointSP WatchpointList::GetByIndex ( uint32_t  i)

Returns a shared pointer to the watchpoint with index i.

Parameters
[in]iThe watchpoint index to seek for.
Returns
A shared pointer to the watchpoint. May contain a NULL pointer if the watchpoint doesn't exist.

Definition at line 138 of file WatchpointList.cpp.

References m_mutex, and m_watchpoints.

Referenced by lldb_private::Target::ClearAllWatchpointHistoricValues(), lldb_private::Target::ClearAllWatchpointHitCounts(), lldb_private::Target::DisableAllWatchpoints(), CommandObjectWatchpointList::DoExecute(), lldb_private::Target::EnableAllWatchpoints(), FreeBSDThread::FreeBSDThread(), lldb_private::Target::IgnoreAllWatchpoints(), and lldb_private::Target::RemoveAllWatchpoints().

◆ GetByIndex() [2/2]

const WatchpointSP WatchpointList::GetByIndex ( uint32_t  i) const

Returns a shared pointer to the watchpoint with index i, const version.

Parameters
[in]iThe watchpoint index to seek for.
Returns
A shared pointer to the watchpoint. May contain a NULL pointer if the watchpoint location doesn't exist.

Definition at line 149 of file WatchpointList.cpp.

References m_mutex, and m_watchpoints.

◆ GetDescription()

void WatchpointList::GetDescription ( Stream s,
lldb::DescriptionLevel  level 
)

Print a description of the watchpoints in this list to the stream s.

Parameters
[in]sThe stream to which to print the description.
[in]levelThe description level that indicates the detail level to provide.
See also
lldb::DescriptionLevel

Definition at line 211 of file WatchpointList.cpp.

References m_mutex, m_watchpoints, and lldb_private::Stream::Printf().

Referenced by GetSize().

◆ GetHitCount()

uint32_t WatchpointList::GetHitCount ( ) const

Returns the number hit count of all watchpoints in this list.

Returns
Hit count of all watchpoints in this list.

Definition at line 187 of file WatchpointList.cpp.

References m_mutex, and m_watchpoints.

◆ GetIDConstIterator()

WatchpointList::wp_collection::const_iterator WatchpointList::GetIDConstIterator ( lldb::watch_id_t  watchID) const
protected

Definition at line 106 of file WatchpointList.cpp.

References m_watchpoints.

Referenced by FindByID().

◆ GetIDIterator()

WatchpointList::wp_collection::iterator WatchpointList::GetIDIterator ( lldb::watch_id_t  watchID)
protected

Definition at line 99 of file WatchpointList.cpp.

References m_watchpoints.

Referenced by Remove().

◆ GetListMutex()

void WatchpointList::GetListMutex ( std::unique_lock< std::recursive_mutex > &  lock)

◆ GetSize()

size_t lldb_private::WatchpointList::GetSize ( ) const
inline

◆ GetWatchpointIDs()

std::vector< lldb::watch_id_t > WatchpointList::GetWatchpointIDs ( ) const
protected

Definition at line 160 of file WatchpointList.cpp.

References m_watchpoints.

◆ Remove()

bool WatchpointList::Remove ( lldb::watch_id_t  watchID,
bool  notify 
)

Removes the watchpoint given by watchID from this list.

Parameters
[in]watchIDThe watchpoint ID to remove.
Returns
true if the watchpoint watchID was in the list.

Definition at line 168 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().

◆ RemoveAll()

void WatchpointList::RemoveAll ( bool  notify)

◆ SetEnabledAll()

void WatchpointList::SetEnabledAll ( bool  enabled)

◆ ShouldStop()

bool WatchpointList::ShouldStop ( StoppointCallbackContext context,
lldb::watch_id_t  watchID 
)

Enquires of the watchpoint in this list with ID watchID whether we should stop.

Parameters
[in]contextThis contains the information about this stop.
[in]watchIDThis watch ID that we hit.
Returns
true if we should stop, false otherwise.

Definition at line 196 of file WatchpointList.cpp.

References FindByID().

Friends And Related Function Documentation

◆ Target

friend class Target
friend

Definition at line 31 of file WatchpointList.h.

◆ Watchpoint

friend class Watchpoint
friend

Definition at line 30 of file WatchpointList.h.

Member Data Documentation

◆ m_mutex

std::recursive_mutex lldb_private::WatchpointList::m_mutex
mutableprotected

◆ m_next_wp_id

lldb::watch_id_t lldb_private::WatchpointList::m_next_wp_id
protected

Definition at line 201 of file WatchpointList.h.

Referenced by Add().

◆ m_watchpoints

wp_collection lldb_private::WatchpointList::m_watchpoints
protected

The documentation for this class was generated from the following files: