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

"lldb/Breakpoint/BreakpointLocationList.h" This class is used by Breakpoint to manage a list of breakpoint locations, each breakpoint location in the list has a unique ID, and is unique by Address as well. More...

#include <BreakpointLocationList.h>

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

Public Types

typedef AdaptedIterable< collection, lldb::BreakpointLocationSP, vector_adapterBreakpointLocationIterable
 

Public Member Functions

virtual ~BreakpointLocationList ()
 
void Dump (Stream *s) const
 Standard "Dump" method. At present it does nothing. More...
 
const lldb::BreakpointLocationSP FindByAddress (const Address &addr) const
 Returns a shared pointer to the breakpoint location at address addr - const version. More...
 
lldb::BreakpointLocationSP FindByID (lldb::break_id_t breakID) const
 Returns a shared pointer to the breakpoint location with id breakID, const version. More...
 
lldb::break_id_t FindIDByAddress (const Address &addr)
 Returns the breakpoint location id to the breakpoint location at address addr. More...
 
size_t FindInModule (Module *module, BreakpointLocationCollection &bp_loc_list)
 Returns a breakpoint location list of the breakpoint locations in the module module. More...
 
lldb::BreakpointLocationSP GetByIndex (size_t i)
 Returns a shared pointer to the breakpoint location with index i. More...
 
const lldb::BreakpointLocationSP GetByIndex (size_t i) const
 Returns a shared pointer to the breakpoint location with index i, const version. More...
 
void ClearAllBreakpointSites ()
 Removes all the locations in this list from their breakpoint site owners list. More...
 
void ResolveAllBreakpointSites ()
 Tells all the breakpoint locations in this list to attempt to resolve any possible breakpoint sites. More...
 
size_t GetNumResolvedLocations () const
 Returns the number of breakpoint locations in this list with resolved breakpoints. More...
 
uint32_t GetHitCount () const
 Returns the number hit count of all locations in this list. More...
 
bool ShouldStop (StoppointCallbackContext *context, lldb::break_id_t breakID)
 Enquires of the breakpoint location in this list with ID breakID whether we should stop. More...
 
size_t GetSize () const
 Returns the number of elements in this breakpoint location list. More...
 
void GetDescription (Stream *s, lldb::DescriptionLevel level)
 Print a description of the breakpoint locations in this list to the stream s. More...
 
BreakpointLocationIterable BreakpointLocations ()
 

Protected Types

typedef std::vector< lldb::BreakpointLocationSP > collection
 
typedef std::map< lldb_private::Address, lldb::BreakpointLocationSP, Address::ModulePointerAndOffsetLessThanFunctionObjectaddr_map
 

Protected Member Functions

 BreakpointLocationList (Breakpoint &owner)
 This is the standard constructor. More...
 
lldb::BreakpointLocationSP Create (const Address &addr, bool resolve_indirect_symbols)
 Add the breakpoint bp_loc_sp to the list. More...
 
void StartRecordingNewLocations (BreakpointLocationCollection &new_locations)
 
void StopRecordingNewLocations ()
 
lldb::BreakpointLocationSP AddLocation (const Address &addr, bool resolve_indirect_symbols, bool *new_location=nullptr)
 
void SwapLocation (lldb::BreakpointLocationSP to_location_sp, lldb::BreakpointLocationSP from_location_sp)
 
bool RemoveLocation (const lldb::BreakpointLocationSP &bp_loc_sp)
 
void RemoveLocationByIndex (size_t idx)
 
void RemoveInvalidLocations (const ArchSpec &arch)
 
void Compact ()
 

Protected Attributes

Breakpointm_owner
 
collection m_locations
 
addr_map m_address_to_location
 
std::recursive_mutex m_mutex
 
lldb::break_id_t m_next_id
 
BreakpointLocationCollectionm_new_location_recorder
 

Friends

class Breakpoint
 

Detailed Description

"lldb/Breakpoint/BreakpointLocationList.h" This class is used by Breakpoint to manage a list of breakpoint locations, each breakpoint location in the list has a unique ID, and is unique by Address as well.

Definition at line 26 of file BreakpointLocationList.h.

Member Typedef Documentation

◆ addr_map

Definition at line 202 of file BreakpointLocationList.h.

◆ BreakpointLocationIterable

Definition at line 214 of file BreakpointLocationList.h.

◆ collection

typedef std::vector<lldb::BreakpointLocationSP> lldb_private::BreakpointLocationList::collection
protected

Definition at line 199 of file BreakpointLocationList.h.

Constructor & Destructor Documentation

◆ ~BreakpointLocationList()

BreakpointLocationList::~BreakpointLocationList ( )
virtualdefault

Referenced by BreakpointLocationList().

◆ BreakpointLocationList()

BreakpointLocationList::BreakpointLocationList ( Breakpoint owner)
protected

This is the standard constructor.

It creates an empty breakpoint location list. It is protected here because only Breakpoints are allowed to create the breakpoint location list.

Definition at line 22 of file BreakpointLocationList.cpp.

References ~BreakpointLocationList().

Referenced by GetSize().

Member Function Documentation

◆ AddLocation()

BreakpointLocationSP BreakpointLocationList::AddLocation ( const Address addr,
bool  resolve_indirect_symbols,
bool *  new_location = nullptr 
)
protected

◆ BreakpointLocations()

BreakpointLocationIterable lldb_private::BreakpointLocationList::BreakpointLocations ( )
inline

Definition at line 216 of file BreakpointLocationList.h.

◆ ClearAllBreakpointSites()

void BreakpointLocationList::ClearAllBreakpointSites ( )

Removes all the locations in this list from their breakpoint site owners list.

Definition at line 154 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

◆ Compact()

void BreakpointLocationList::Compact ( )
protected

Definition at line 303 of file BreakpointLocationList.cpp.

References m_locations, and m_next_id.

Referenced by GetSize().

◆ Create()

BreakpointLocationSP BreakpointLocationList::Create ( const Address addr,
bool  resolve_indirect_symbols 
)
protected

Add the breakpoint bp_loc_sp to the list.

Parameters
[in]bp_spShared pointer to the breakpoint location that will get added to the list.
Returns
Returns breakpoint location id.

Definition at line 29 of file BreakpointLocationList.cpp.

References lldb_private::Breakpoint::IsHardware(), LLDB_INVALID_THREAD_ID, m_address_to_location, m_locations, m_mutex, m_next_id, and m_owner.

Referenced by AddLocation(), and GetSize().

◆ Dump()

void BreakpointLocationList::Dump ( Stream s) const

Standard "Dump" method. At present it does nothing.

Definition at line 123 of file BreakpointLocationList.cpp.

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

◆ FindByAddress()

const BreakpointLocationSP BreakpointLocationList::FindByAddress ( const Address addr) const

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

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

Definition at line 97 of file BreakpointLocationList.cpp.

References lldb_private::Address::GetOffset(), lldb_private::Target::GetSectionLoadList(), lldb_private::Breakpoint::GetTarget(), lldb_private::Address::IsSectionOffset(), lldb_private::Address::IsValid(), m_address_to_location, m_locations, m_mutex, m_owner, and lldb_private::SectionLoadList::ResolveLoadAddress().

Referenced by AddLocation(), and FindIDByAddress().

◆ FindByID()

BreakpointLocationSP BreakpointLocationList::FindByID ( lldb::break_id_t  breakID) const

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

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

Definition at line 69 of file BreakpointLocationList.cpp.

References Compare(), m_locations, and m_mutex.

Referenced by ShouldStop().

◆ FindIDByAddress()

lldb::break_id_t BreakpointLocationList::FindIDByAddress ( const Address addr)

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

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

Definition at line 56 of file BreakpointLocationList.cpp.

References FindByAddress(), and LLDB_INVALID_BREAK_ID.

◆ FindInModule()

size_t BreakpointLocationList::FindInModule ( Module module,
BreakpointLocationCollection bp_loc_list 
)

Returns a breakpoint location list of the breakpoint locations in the module module.

This list is allocated, and owned by the caller.

Parameters
[in]moduleThe module to seek in.
[in]Abreakpoint collection that gets any breakpoint locations that match module appended to.
Returns
The number of matches

Definition at line 80 of file BreakpointLocationList.cpp.

References lldb_private::BreakpointLocationCollection::Add(), lldb_private::BreakpointLocationCollection::GetSize(), m_locations, and m_mutex.

◆ GetByIndex() [1/2]

BreakpointLocationSP BreakpointLocationList::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 nullptr pointer if the breakpoint doesn't exist.

Definition at line 136 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

◆ GetByIndex() [2/2]

const BreakpointLocationSP BreakpointLocationList::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 nullptr pointer if the breakpoint doesn't exist.

Definition at line 145 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

◆ GetDescription()

void BreakpointLocationList::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 191 of file BreakpointLocationList.cpp.

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

Referenced by GetSize().

◆ GetHitCount()

uint32_t BreakpointLocationList::GetHitCount ( ) const

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

Returns
Hit count of all locations in this list.

Definition at line 171 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

◆ GetNumResolvedLocations()

size_t BreakpointLocationList::GetNumResolvedLocations ( ) const

Returns the number of breakpoint locations in this list with resolved breakpoints.

Returns
Number of qualifying breakpoint locations.

Definition at line 180 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

◆ GetSize()

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

Returns the number of elements in this breakpoint location list.

Returns
The number of elements.

Definition at line 146 of file BreakpointLocationList.h.

References AddLocation(), BreakpointLocationList(), Compact(), Create(), GetDescription(), m_locations, RemoveInvalidLocations(), RemoveLocation(), RemoveLocationByIndex(), StartRecordingNewLocations(), StopRecordingNewLocations(), and SwapLocation().

◆ RemoveInvalidLocations()

void BreakpointLocationList::RemoveInvalidLocations ( const ArchSpec arch)
protected

◆ RemoveLocation()

bool BreakpointLocationList::RemoveLocation ( const lldb::BreakpointLocationSP &  bp_loc_sp)
protected

Definition at line 237 of file BreakpointLocationList.cpp.

References m_address_to_location, m_locations, m_mutex, and RemoveLocationByIndex().

Referenced by GetSize(), and SwapLocation().

◆ RemoveLocationByIndex()

void BreakpointLocationList::RemoveLocationByIndex ( size_t  idx)
protected

Definition at line 255 of file BreakpointLocationList.cpp.

References m_address_to_location, and m_locations.

Referenced by GetSize(), RemoveInvalidLocations(), and RemoveLocation().

◆ ResolveAllBreakpointSites()

void BreakpointLocationList::ResolveAllBreakpointSites ( )

Tells all the breakpoint locations in this list to attempt to resolve any possible breakpoint sites.

Definition at line 161 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

◆ ShouldStop()

bool BreakpointLocationList::ShouldStop ( StoppointCallbackContext context,
lldb::break_id_t  breakID 
)

Enquires of the breakpoint location in this list with ID breakID whether we should stop.

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 42 of file BreakpointLocationList.cpp.

References FindByID().

◆ StartRecordingNewLocations()

void BreakpointLocationList::StartRecordingNewLocations ( BreakpointLocationCollection new_locations)
protected

Definition at line 291 of file BreakpointLocationList.cpp.

References m_mutex, and m_new_location_recorder.

Referenced by GetSize().

◆ StopRecordingNewLocations()

void BreakpointLocationList::StopRecordingNewLocations ( )
protected

Definition at line 298 of file BreakpointLocationList.cpp.

References m_mutex, and m_new_location_recorder.

Referenced by GetSize().

◆ SwapLocation()

void BreakpointLocationList::SwapLocation ( lldb::BreakpointLocationSP  to_location_sp,
lldb::BreakpointLocationSP  from_location_sp 
)
protected

Definition at line 224 of file BreakpointLocationList.cpp.

References m_address_to_location, and RemoveLocation().

Referenced by GetSize().

Friends And Related Function Documentation

◆ Breakpoint

friend class Breakpoint
friend

Definition at line 32 of file BreakpointLocationList.h.

Member Data Documentation

◆ m_address_to_location

addr_map lldb_private::BreakpointLocationList::m_address_to_location
protected

◆ m_locations

collection lldb_private::BreakpointLocationList::m_locations
protected

◆ m_mutex

std::recursive_mutex lldb_private::BreakpointLocationList::m_mutex
mutableprotected

◆ m_new_location_recorder

BreakpointLocationCollection* lldb_private::BreakpointLocationList::m_new_location_recorder
protected

◆ m_next_id

lldb::break_id_t lldb_private::BreakpointLocationList::m_next_id
protected

Definition at line 208 of file BreakpointLocationList.h.

Referenced by Compact(), and Create().

◆ m_owner

Breakpoint& lldb_private::BreakpointLocationList::m_owner
protected

Definition at line 204 of file BreakpointLocationList.h.

Referenced by Create(), and FindByAddress().


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