LLDB mainline
lldb_private::BreakpointLocationCollection Class Reference

#include <BreakpointLocationCollection.h>

Public Types

typedef llvm::iterator_range< collection::const_iterator > BreakpointLocationCollectionIterable

Public Member Functions

 BreakpointLocationCollection (bool preserving=false)
 Breakpoint locations don't keep their breakpoint owners alive, so neither will a collection of breakpoint locations.
 ~BreakpointLocationCollection ()
BreakpointLocationCollectionoperator= (const BreakpointLocationCollection &rhs)
void Add (const lldb::BreakpointLocationSP &bp_loc_sp)
 Add the breakpoint bp_loc_sp to the list.
bool Remove (lldb::break_id_t break_id, lldb::break_id_t break_loc_id)
 Removes the breakpoint location given by breakID from this list.
lldb::BreakpointLocationSP FindByIDPair (lldb::break_id_t break_id, lldb::break_id_t break_loc_id)
 Returns a shared pointer to the breakpoint location with id breakID.
const lldb::BreakpointLocationSP FindByIDPair (lldb::break_id_t break_id, lldb::break_id_t break_loc_id) const
 Returns a shared pointer to the breakpoint location with id breakID, const version.
lldb::BreakpointLocationSP GetByIndex (size_t i)
 Returns a shared pointer to the breakpoint location with index i.
const lldb::BreakpointLocationSP GetByIndex (size_t i) const
 Returns a shared pointer to the breakpoint location with index i, const version.
size_t GetSize () const
 Returns the number of elements in this breakpoint location list.
bool ShouldStop (StoppointCallbackContext *context, BreakpointLocationCollection &stopped_bp_locs)
 Enquires of all the breakpoint locations in this list whether we should stop at a hit at breakID.
void GetDescription (Stream *s, lldb::DescriptionLevel level)
 Print a description of the breakpoint locations in this list to the stream s.
bool ValidForThisThread (Thread &thread)
 Check whether this collection of breakpoint locations have any thread specifiers, and if yes, is thread_id contained in any of these specifiers.
bool IsInternal () const
 Tell whether ALL the breakpoints in the location collection are internal.
BreakpointLocationCollectionIterable BreakpointLocations ()

Private Types

typedef std::vector< lldb::BreakpointLocationSPcollection

Private Member Functions

collection::iterator GetIDPairIterator (lldb::break_id_t break_id, lldb::break_id_t break_loc_id)
collection::const_iterator GetIDPairConstIterator (lldb::break_id_t break_id, lldb::break_id_t break_loc_id) const

Private Attributes

collection m_break_loc_collection
std::mutex m_collection_mutex
const bool m_preserving_bkpts = false
 These are used if we're preserving breakpoints in this list:
std::map< std::pair< lldb::break_id_t, lldb::break_id_t >, lldb::BreakpointSPm_preserved_bps

Detailed Description

Definition at line 21 of file BreakpointLocationCollection.h.

Member Typedef Documentation

◆ BreakpointLocationCollectionIterable

typedef llvm::iterator_range<collection::const_iterator> lldb_private::BreakpointLocationCollection::BreakpointLocationCollectionIterable

Definition at line 183 of file BreakpointLocationCollection.h.

◆ collection

Constructor & Destructor Documentation

◆ BreakpointLocationCollection()

BreakpointLocationCollection::BreakpointLocationCollection ( bool preserving = false)

Breakpoint locations don't keep their breakpoint owners alive, so neither will a collection of breakpoint locations.

However, if you need to use this collection in a context where some of the breakpoints whose locations are in the collection might get deleted during its lifespan, then you need to make sure the breakpoints don't get deleted out from under you. To do that, pass true for preserving, and so long as there is a location for a given breakpoint in the collection, the breakpoint will not get destroyed.

Definition at line 20 of file BreakpointLocationCollection.cpp.

References m_preserving_bkpts.

Referenced by operator=(), ShouldStop(), and ~BreakpointLocationCollection().

◆ ~BreakpointLocationCollection()

BreakpointLocationCollection::~BreakpointLocationCollection ( )
default

Member Function Documentation

◆ Add()

void BreakpointLocationCollection::Add ( const lldb::BreakpointLocationSP & bp_loc_sp)

◆ BreakpointLocations()

BreakpointLocationCollectionIterable lldb_private::BreakpointLocationCollection::BreakpointLocations ( )
inline

◆ FindByIDPair() [1/2]

BreakpointLocationSP BreakpointLocationCollection::FindByIDPair ( lldb::break_id_t break_id,
lldb::break_id_t break_loc_id )

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

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

Definition at line 98 of file BreakpointLocationCollection.cpp.

References GetIDPairIterator(), and m_break_loc_collection.

Referenced by Add(), and lldb_private::Breakpoint::ModuleReplaced().

◆ FindByIDPair() [2/2]

const BreakpointLocationSP BreakpointLocationCollection::FindByIDPair ( lldb::break_id_t break_id,
lldb::break_id_t break_loc_id ) const

Returns a shared pointer to the breakpoint location with id breakID, const version.

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

Definition at line 108 of file BreakpointLocationCollection.cpp.

References GetIDPairConstIterator(), and m_break_loc_collection.

◆ GetByIndex() [1/2]

BreakpointLocationSP BreakpointLocationCollection::GetByIndex ( size_t i)

Returns a shared pointer to the breakpoint location with index i.

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

Definition at line 119 of file BreakpointLocationCollection.cpp.

References m_break_loc_collection, and m_collection_mutex.

Referenced by lldb_private::Breakpoint::BreakpointEventData::GetBreakpointLocationAtIndexFromEvent(), lldb_private::Breakpoint::ModuleReplaced(), lldb_private::Breakpoint::ModulesChanged(), lldb_private::StopInfoBreakpoint::PerformAction(), and ShouldStop().

◆ GetByIndex() [2/2]

const BreakpointLocationSP BreakpointLocationCollection::GetByIndex ( size_t i) const

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

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

Definition at line 129 of file BreakpointLocationCollection.cpp.

References m_break_loc_collection, and m_collection_mutex.

◆ GetDescription()

void BreakpointLocationCollection::GetDescription ( Stream * s,
lldb::DescriptionLevel level )

Print a description of the breakpoint locations 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 198 of file BreakpointLocationCollection.cpp.

References m_break_loc_collection, m_collection_mutex, and lldb_private::Stream::PutChar().

◆ GetIDPairConstIterator()

BreakpointLocationCollection::collection::const_iterator BreakpointLocationCollection::GetIDPairConstIterator ( lldb::break_id_t break_id,
lldb::break_id_t break_loc_id ) const
private

Definition at line 90 of file BreakpointLocationCollection.cpp.

References m_break_loc_collection.

Referenced by FindByIDPair().

◆ GetIDPairIterator()

BreakpointLocationCollection::collection::iterator BreakpointLocationCollection::GetIDPairIterator ( lldb::break_id_t break_id,
lldb::break_id_t break_loc_id )
private

Definition at line 82 of file BreakpointLocationCollection.cpp.

References m_break_loc_collection.

Referenced by FindByIDPair(), and Remove().

◆ GetSize()

◆ IsInternal()

bool BreakpointLocationCollection::IsInternal ( ) const

Tell whether ALL the breakpoints in the location collection are internal.

Returns
true if all breakpoint locations are owned by internal breakpoints, false otherwise.

Definition at line 182 of file BreakpointLocationCollection.cpp.

References m_break_loc_collection, and m_collection_mutex.

◆ operator=()

BreakpointLocationCollection & BreakpointLocationCollection::operator= ( const BreakpointLocationCollection & rhs)

◆ Remove()

bool BreakpointLocationCollection::Remove ( lldb::break_id_t break_id,
lldb::break_id_t break_loc_id )

Removes the breakpoint location given by breakID from this list.

Parameters
[in]break_idThe breakpoint index to remove.
[in]break_loc_idThe breakpoint location index in break_id to remove.
Returns
true if the breakpoint was in the list.

Definition at line 45 of file BreakpointLocationCollection.cpp.

References GetIDPairIterator(), m_break_loc_collection, m_collection_mutex, m_preserved_bps, and m_preserving_bkpts.

◆ ShouldStop()

bool BreakpointLocationCollection::ShouldStop ( StoppointCallbackContext * context,
BreakpointLocationCollection & stopped_bp_locs )

Enquires of all the breakpoint locations in this list whether we should stop at a hit at breakID.

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

Definition at line 138 of file BreakpointLocationCollection.cpp.

References Add(), BreakpointLocationCollection(), GetByIndex(), and GetSize().

Referenced by lldb_private::BreakpointSite::ShouldStop().

◆ ValidForThisThread()

bool BreakpointLocationCollection::ValidForThisThread ( Thread & thread)

Check whether this collection of breakpoint locations have any thread specifiers, and if yes, is thread_id contained in any of these specifiers.

Parameters
[in]threadThe thread against which to test.

return true if the collection contains at least one location that would be valid for this thread, false otherwise.

Definition at line 170 of file BreakpointLocationCollection.cpp.

References m_break_loc_collection, and m_collection_mutex.

Member Data Documentation

◆ m_break_loc_collection

◆ m_collection_mutex

std::mutex lldb_private::BreakpointLocationCollection::m_collection_mutex
mutableprivate

◆ m_preserved_bps

std::map<std::pair<lldb::break_id_t, lldb::break_id_t>, lldb::BreakpointSP> lldb_private::BreakpointLocationCollection::m_preserved_bps
private

Definition at line 179 of file BreakpointLocationCollection.h.

Referenced by Add(), and Remove().

◆ m_preserving_bkpts

const bool lldb_private::BreakpointLocationCollection::m_preserving_bkpts = false
private

These are used if we're preserving breakpoints in this list:

Definition at line 177 of file BreakpointLocationCollection.h.

Referenced by Add(), BreakpointLocationCollection(), and Remove().


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