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

"lldb/Breakpoint/BreakpointSiteList.h" Class that manages lists of BreakpointSite shared pointers. More...

#include <BreakpointSiteList.h>

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

Public Types

typedef void(* BreakpointSiteSPMapFunc) (lldb::BreakpointSiteSP &bp, void *baton)
 

Public Member Functions

 BreakpointSiteList ()
 Default constructor makes an empty list. More...
 
 ~BreakpointSiteList ()
 Destructor, currently does nothing. More...
 
lldb::break_id_t Add (const lldb::BreakpointSiteSP &bp_site_sp)
 Add a BreakpointSite to the list. More...
 
void Dump (Stream *s) const
 Standard Dump routine, doesn't do anything at present. More...
 
lldb::BreakpointSiteSP FindByAddress (lldb::addr_t addr)
 Returns a shared pointer to the breakpoint site at address addr. More...
 
lldb::BreakpointSiteSP FindByID (lldb::break_id_t breakID)
 Returns a shared pointer to the breakpoint site with id breakID. More...
 
const lldb::BreakpointSiteSP FindByID (lldb::break_id_t breakID) const
 Returns a shared pointer to the breakpoint site with id breakID - const version. More...
 
lldb::break_id_t FindIDByAddress (lldb::addr_t addr)
 Returns the breakpoint site id to the breakpoint site at address addr. More...
 
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. More...
 
void ForEach (std::function< void(BreakpointSite *)> const &callback)
 
bool Remove (lldb::break_id_t breakID)
 Removes the breakpoint site given by breakID from this list. More...
 
bool RemoveByAddress (lldb::addr_t addr)
 Removes the breakpoint site at address addr from this list. More...
 
bool FindInRange (lldb::addr_t lower_bound, lldb::addr_t upper_bound, BreakpointSiteList &bp_site_list) const
 
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 breakpoint or not. More...
 
size_t GetSize () const
 Returns the number of elements in the list. More...
 
bool IsEmpty () const
 

Protected Types

typedef std::map< lldb::addr_t, lldb::BreakpointSiteSP > collection
 

Protected Member Functions

collection::iterator GetIDIterator (lldb::break_id_t breakID)
 
collection::const_iterator GetIDConstIterator (lldb::break_id_t breakID) const
 

Protected Attributes

std::recursive_mutex m_mutex
 
collection m_bp_site_list
 

Friends

class Process
 

Detailed Description

"lldb/Breakpoint/BreakpointSiteList.h" Class that manages lists of BreakpointSite shared pointers.

Definition at line 23 of file BreakpointSiteList.h.

Member Typedef Documentation

◆ BreakpointSiteSPMapFunc

typedef void(* lldb_private::BreakpointSiteList::BreakpointSiteSPMapFunc) (lldb::BreakpointSiteSP &bp, void *baton)

Definition at line 130 of file BreakpointSiteList.h.

◆ collection

typedef std::map<lldb::addr_t, lldb::BreakpointSiteSP> lldb_private::BreakpointSiteList::collection
protected

Definition at line 161 of file BreakpointSiteList.h.

Constructor & Destructor Documentation

◆ BreakpointSiteList()

BreakpointSiteList::BreakpointSiteList ( )

Default constructor makes an empty list.

Definition at line 17 of file BreakpointSiteList.cpp.

◆ ~BreakpointSiteList()

BreakpointSiteList::~BreakpointSiteList ( )

Destructor, currently does nothing.

Definition at line 19 of file BreakpointSiteList.cpp.

Member Function Documentation

◆ Add()

lldb::break_id_t BreakpointSiteList::Add ( const lldb::BreakpointSiteSP &  bp_site_sp)

Add a BreakpointSite to the list.

Parameters
[in]bp_site_spA shared pointer to a breakpoint site being added to the list.
Returns
The ID of the BreakpointSite in the list.

Definition at line 24 of file BreakpointSiteList.cpp.

References LLDB_INVALID_BREAK_ID, m_bp_site_list, and m_mutex.

Referenced by FindInRange().

◆ BreakpointSiteContainsBreakpoint()

bool BreakpointSiteList::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.

Parameters
[in]bp_site_idThe breakpoint site id to query.
[in]bp_idThe breakpoint id to look for in bp_site_id.
Returns
True if bp_site_id exists in the site list AND bp_id is one of the owners of that site.

Definition at line 141 of file BreakpointSiteList.cpp.

References GetIDConstIterator(), m_bp_site_list, and m_mutex.

Referenced by lldb_private::AppleObjCRuntime::ExceptionBreakpointsExplainStop().

◆ Dump()

void BreakpointSiteList::Dump ( Stream s) const

Standard Dump routine, doesn't do anything at present.

Parameters
[in]sStream into which to dump the description.

Definition at line 151 of file BreakpointSiteList.cpp.

References lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_bp_site_list, and lldb_private::Stream::Printf().

◆ FindByAddress()

BreakpointSiteSP BreakpointSiteList::FindByAddress ( lldb::addr_t  addr)

Returns a shared pointer to the breakpoint site at address addr.

Parameters
[in]addrThe address to look for.
Returns
A shared pointer to the breakpoint site. May contain a NULL pointer if no breakpoint site exists with a matching address.

Definition at line 132 of file BreakpointSiteList.cpp.

References m_bp_site_list, and m_mutex.

Referenced by FindIDByAddress().

◆ FindByID() [1/2]

BreakpointSiteSP BreakpointSiteList::FindByID ( lldb::break_id_t  breakID)

Returns a shared pointer to the breakpoint site with id breakID.

Parameters
[in]breakIDThe breakpoint site ID to seek for.
Returns
A shared pointer to the breakpoint site. May contain a NULL pointer if the breakpoint doesn't exist.

Definition at line 111 of file BreakpointSiteList.cpp.

References GetIDIterator(), m_bp_site_list, and m_mutex.

Referenced by CommandObjectProcessContinue::DoExecute(), and ShouldStop().

◆ FindByID() [2/2]

const BreakpointSiteSP BreakpointSiteList::FindByID ( lldb::break_id_t  breakID) const

Returns a shared pointer to the breakpoint site with id breakID - const version.

Parameters
[in]breakIDThe breakpoint site ID to seek for.
Returns
A shared pointer to the breakpoint site. May contain a NULL pointer if the breakpoint doesn't exist.

Definition at line 122 of file BreakpointSiteList.cpp.

References GetIDConstIterator(), m_bp_site_list, and m_mutex.

◆ FindIDByAddress()

lldb::break_id_t BreakpointSiteList::FindIDByAddress ( lldb::addr_t  addr)

Returns the breakpoint site id to the breakpoint site at address addr.

Parameters
[in]addrThe address to match.
Returns
The ID of the breakpoint site, or LLDB_INVALID_BREAK_ID.

Definition at line 50 of file BreakpointSiteList.cpp.

References FindByAddress(), and LLDB_INVALID_BREAK_ID.

◆ FindInRange()

bool BreakpointSiteList::FindInRange ( lldb::addr_t  lower_bound,
lldb::addr_t  upper_bound,
BreakpointSiteList bp_site_list 
) const

Definition at line 171 of file BreakpointSiteList.cpp.

References Add(), m_bp_site_list, and m_mutex.

◆ ForEach()

void BreakpointSiteList::ForEach ( std::function< void(BreakpointSite *)> const &  callback)

◆ GetIDConstIterator()

BreakpointSiteList::collection::const_iterator BreakpointSiteList::GetIDConstIterator ( lldb::break_id_t  breakID) const
protected

Definition at line 104 of file BreakpointSiteList.cpp.

References m_bp_site_list, and m_mutex.

Referenced by BreakpointSiteContainsBreakpoint(), and FindByID().

◆ GetIDIterator()

BreakpointSiteList::collection::iterator BreakpointSiteList::GetIDIterator ( lldb::break_id_t  breakID)
protected

Definition at line 96 of file BreakpointSiteList.cpp.

References m_bp_site_list, and m_mutex.

Referenced by FindByID(), and Remove().

◆ GetSize()

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

Returns the number of elements in the list.

Returns
The number of elements.

Definition at line 150 of file BreakpointSiteList.h.

References m_bp_site_list, and m_mutex.

◆ IsEmpty()

bool lldb_private::BreakpointSiteList::IsEmpty ( ) const
inline

Definition at line 155 of file BreakpointSiteList.h.

References m_bp_site_list, and m_mutex.

Referenced by lldb_private::Process::WriteMemory().

◆ Remove()

bool BreakpointSiteList::Remove ( lldb::break_id_t  breakID)

Removes the breakpoint site given by breakID from this list.

Parameters
[in]breakIDThe breakpoint site index to remove.
Returns
true if the breakpoint site breakID was in the list.

Definition at line 63 of file BreakpointSiteList.cpp.

References GetIDIterator(), m_bp_site_list, and m_mutex.

◆ RemoveByAddress()

bool BreakpointSiteList::RemoveByAddress ( lldb::addr_t  addr)

Removes the breakpoint site at address addr from this list.

Parameters
[in]addrThe address from which to remove a breakpoint site.
Returns
true if addr had a breakpoint site to remove from the list.

Definition at line 73 of file BreakpointSiteList.cpp.

References m_bp_site_list, and m_mutex.

◆ ShouldStop()

bool BreakpointSiteList::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 breakpoint or not.

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

Definition at line 37 of file BreakpointSiteList.cpp.

References FindByID().

Friends And Related Function Documentation

◆ Process

friend class Process
friend

Definition at line 27 of file BreakpointSiteList.h.

Member Data Documentation

◆ m_bp_site_list

collection lldb_private::BreakpointSiteList::m_bp_site_list
protected

◆ m_mutex

std::recursive_mutex lldb_private::BreakpointSiteList::m_mutex
mutableprotected

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