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>

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.
 
const lldb::BreakpointLocationSP FindByAddress (const Address &addr) const
 Returns a shared pointer to the breakpoint location at address addr - const version.
 
lldb::BreakpointLocationSP FindByID (lldb::break_id_t breakID) const
 Returns a shared pointer to the breakpoint location with id breakID, const version.
 
lldb::break_id_t FindIDByAddress (const Address &addr)
 Returns the breakpoint location id to the breakpoint location at address addr.
 
size_t FindInModule (Module *module, BreakpointLocationCollection &bp_loc_list)
 Returns a breakpoint location list of the breakpoint locations in the module module.
 
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.
 
void ClearAllBreakpointSites ()
 Removes all the locations in this list from their breakpoint site owners list.
 
void ResolveAllBreakpointSites ()
 Tells all the breakpoint locations in this list to attempt to resolve any possible breakpoint sites.
 
size_t GetNumResolvedLocations () const
 Returns the number of breakpoint locations in this list with resolved breakpoints.
 
uint32_t GetHitCount () const
 Returns the number hit count of all locations in this list.
 
void ResetHitCount ()
 Resets the hit count of all locations in this list.
 
bool ShouldStop (StoppointCallbackContext *context, lldb::break_id_t breakID)
 Enquires of the breakpoint location in this list with ID breakID whether we should stop.
 
size_t GetSize () const
 Returns the number of elements in this breakpoint location list.
 
void GetDescription (Stream *s, lldb::DescriptionLevel level)
 Print a description of the breakpoint locations in this list to the stream s.
 
BreakpointLocationIterable BreakpointLocations ()
 

Protected Types

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

Protected Member Functions

 BreakpointLocationList (Breakpoint &owner)
 This is the standard constructor.
 
lldb::BreakpointLocationSP Create (const Address &addr, bool resolve_indirect_symbols)
 
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 197 of file BreakpointLocationList.h.

◆ BreakpointLocationIterable

Definition at line 209 of file BreakpointLocationList.h.

◆ collection

Definition at line 194 of file BreakpointLocationList.h.

Constructor & Destructor Documentation

◆ ~BreakpointLocationList()

BreakpointLocationList::~BreakpointLocationList ( )
virtualdefault

◆ 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.

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

◆ ClearAllBreakpointSites()

void BreakpointLocationList::ClearAllBreakpointSites ( )

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

Definition at line 153 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

Referenced by lldb_private::Breakpoint::ClearAllBreakpointSites(), and lldb_private::Breakpoint::SetEnabled().

◆ Compact()

void BreakpointLocationList::Compact ( )
protected

Definition at line 308 of file BreakpointLocationList.cpp.

References m_locations, and m_next_id.

Referenced by lldb_private::Breakpoint::ModuleReplaced().

◆ Create()

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

◆ Dump()

void BreakpointLocationList::Dump ( Stream s) const

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

Definition at line 122 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 96 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(), FindIDByAddress(), and lldb_private::Breakpoint::FindLocationByAddress().

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

References Compare(), m_locations, and m_mutex.

Referenced by lldb_private::Breakpoint::FindLocationByID(), and 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 55 of file BreakpointLocationList.cpp.

References FindByAddress(), and LLDB_INVALID_BREAK_ID.

Referenced by lldb_private::Breakpoint::FindLocationIDByAddress().

◆ 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]bp_loc_listA breakpoint collection that gets any breakpoint locations that match module appended to.
Returns
The number of matches

Definition at line 79 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 135 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

Referenced by lldb_private::Breakpoint::GetLocationAtIndex(), and lldb_private::Breakpoint::ModulesChanged().

◆ 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 144 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 196 of file BreakpointLocationList.cpp.

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

◆ 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 170 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 185 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

Referenced by lldb_private::Breakpoint::GetNumResolvedLocations().

◆ 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 149 of file BreakpointLocationList.h.

References m_locations.

Referenced by lldb_private::Breakpoint::GetNumLocations(), and lldb_private::Breakpoint::ModulesChanged().

◆ RemoveInvalidLocations()

void BreakpointLocationList::RemoveInvalidLocations ( const ArchSpec arch)
protected

◆ RemoveLocation()

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

◆ RemoveLocationByIndex()

void BreakpointLocationList::RemoveLocationByIndex ( size_t  idx)
protected

Definition at line 260 of file BreakpointLocationList.cpp.

References m_address_to_location, and m_locations.

Referenced by RemoveInvalidLocations(), and RemoveLocation().

◆ ResetHitCount()

void BreakpointLocationList::ResetHitCount ( )

Resets the hit count of all locations in this list.

Definition at line 179 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

Referenced by lldb_private::Breakpoint::ResetHitCount().

◆ ResolveAllBreakpointSites()

void BreakpointLocationList::ResolveAllBreakpointSites ( )

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

Definition at line 160 of file BreakpointLocationList.cpp.

References m_locations, and m_mutex.

Referenced by lldb_private::Breakpoint::SetEnabled().

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

References FindByID().

◆ StartRecordingNewLocations()

void BreakpointLocationList::StartRecordingNewLocations ( BreakpointLocationCollection new_locations)
protected

◆ StopRecordingNewLocations()

void BreakpointLocationList::StopRecordingNewLocations ( )
protected

◆ SwapLocation()

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

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 203 of file BreakpointLocationList.h.

Referenced by Compact(), and Create().

◆ m_owner

Breakpoint& lldb_private::BreakpointLocationList::m_owner
protected

Definition at line 199 of file BreakpointLocationList.h.

Referenced by Create(), and FindByAddress().


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