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

General Outline: Allows adding and removing breakpoints and find by ID and index. More...

#include "lldb/Breakpoint/BreakpointList.h"

Public Types

typedef LockingAdaptedIterable< bp_collection, lldb::BreakpointSP, list_adapter, std::recursive_mutex > BreakpointIterable
 

Public Member Functions

 BreakpointList (bool is_internal)
 
 ~BreakpointList ()
 
lldb::break_id_t Add (lldb::BreakpointSP &bp_sp, bool notify)
 Add the breakpoint bp_sp to the list.
 
void Dump (Stream *s) const
 Standard "Dump" method. At present it does nothing.
 
lldb::BreakpointSP FindBreakpointByID (lldb::break_id_t breakID) const
 Returns a shared pointer to the breakpoint with id breakID.
 
lldb::BreakpointSP GetBreakpointAtIndex (size_t i) const
 Returns a shared pointer to the breakpoint with index i.
 
llvm::Expected< std::vector< lldb::BreakpointSP > > FindBreakpointsByName (const char *name)
 Find all the breakpoints with a given name.
 
size_t GetSize () const
 Returns the number of elements in this breakpoint list.
 
bool Remove (lldb::break_id_t breakID, bool notify)
 Removes the breakpoint given by breakID from this list.
 
void RemoveInvalidLocations (const ArchSpec &arch)
 Removes all invalid breakpoint locations.
 
void SetEnabledAll (bool enabled)
 
void SetEnabledAllowed (bool enabled)
 
void RemoveAll (bool notify)
 Removes all the breakpoints from this list.
 
void RemoveAllowed (bool notify)
 Removes all the breakpoints from this list - first checking the ePermDelete on the breakpoints.
 
void UpdateBreakpoints (ModuleList &module_list, bool load, bool delete_locations)
 Tell all the breakpoints to update themselves due to a change in the modules in module_list.
 
void UpdateBreakpointsWhenModuleIsReplaced (lldb::ModuleSP old_module_sp, lldb::ModuleSP new_module_sp)
 
void ClearAllBreakpointSites ()
 
void ResetHitCounts ()
 Resets the hit count of all breakpoints.
 
void GetListMutex (std::unique_lock< std::recursive_mutex > &lock)
 Sets the passed in Locker to hold the Breakpoint List mutex.
 
BreakpointIterable Breakpoints ()
 

Protected Types

typedef std::vector< lldb::BreakpointSPbp_collection
 

Protected Member Functions

bp_collection::iterator GetBreakpointIDIterator (lldb::break_id_t breakID)
 
bp_collection::const_iterator GetBreakpointIDConstIterator (lldb::break_id_t breakID) const
 
std::recursive_mutex & GetMutex () const
 

Protected Attributes

std::recursive_mutex m_mutex
 
bp_collection m_breakpoints
 
lldb::break_id_t m_next_break_id
 
bool m_is_internal
 

Private Member Functions

 BreakpointList (const BreakpointList &)=delete
 
const BreakpointListoperator= (const BreakpointList &)=delete
 

Detailed Description

General Outline: Allows adding and removing breakpoints and find by ID and index.

This class manages a list of breakpoints.

Definition at line 25 of file BreakpointList.h.

Member Typedef Documentation

◆ bp_collection

Definition at line 151 of file BreakpointList.h.

◆ BreakpointIterable

Definition at line 168 of file BreakpointList.h.

Constructor & Destructor Documentation

◆ BreakpointList() [1/2]

BreakpointList::BreakpointList ( bool  is_internal)

Definition at line 28 of file BreakpointList.cpp.

◆ ~BreakpointList()

BreakpointList::~BreakpointList ( )
default

◆ BreakpointList() [2/2]

lldb_private::BreakpointList::BreakpointList ( const BreakpointList )
privatedelete

Member Function Documentation

◆ Add()

break_id_t BreakpointList::Add ( lldb::BreakpointSP bp_sp,
bool  notify 
)

Add the breakpoint bp_sp to the list.

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

Definition at line 33 of file BreakpointList.cpp.

References m_breakpoints, m_is_internal, m_mutex, m_next_break_id, and NotifyChange().

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

◆ Breakpoints()

BreakpointIterable lldb_private::BreakpointList::Breakpoints ( )
inline

◆ ClearAllBreakpointSites()

void BreakpointList::ClearAllBreakpointSites ( )

Definition at line 186 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

Referenced by lldb_private::Target::CleanupProcess(), and RemoveAll().

◆ Dump()

void BreakpointList::Dump ( Stream s) const

◆ FindBreakpointByID()

BreakpointSP BreakpointList::FindBreakpointByID ( lldb::break_id_t  breakID) const

◆ FindBreakpointsByName()

llvm::Expected< std::vector< lldb::BreakpointSP > > BreakpointList::FindBreakpointsByName ( const char *  name)

Find all the breakpoints with a given name.

Parameters
[in]nameThe breakpoint name for which to search.
Returns
error if the input name was not a legal breakpoint name, vector of breakpoints otherwise.

Definition at line 134 of file BreakpointList.cpp.

References Breakpoints(), error(), and lldb_private::BreakpointID::StringIsBreakpointName().

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

◆ GetBreakpointAtIndex()

BreakpointSP BreakpointList::GetBreakpointAtIndex ( size_t  i) const

Returns a shared pointer to the breakpoint with index i.

Parameters
[in]iThe breakpoint 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 165 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

Referenced by lldb_private::CommandCompletions::Breakpoints(), CommandObjectBreakpointList::DoExecute(), CommandObjectBreakpointClear::DoExecute(), lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), lldb_private::Target::SerializeBreakpointsToFile(), and lldb_private::TargetStats::ToJSON().

◆ GetBreakpointIDConstIterator()

BreakpointList::bp_collection::const_iterator BreakpointList::GetBreakpointIDConstIterator ( lldb::break_id_t  breakID) const
protected

Definition at line 118 of file BreakpointList.cpp.

References m_breakpoints.

Referenced by FindBreakpointByID().

◆ GetBreakpointIDIterator()

BreakpointList::bp_collection::iterator BreakpointList::GetBreakpointIDIterator ( lldb::break_id_t  breakID)
protected

Definition at line 111 of file BreakpointList.cpp.

References m_breakpoints.

◆ GetListMutex()

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

◆ GetMutex()

std::recursive_mutex & lldb_private::BreakpointList::GetMutex ( ) const
inlineprotected

Definition at line 158 of file BreakpointList.h.

References m_mutex.

Referenced by Breakpoints().

◆ GetSize()

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

◆ operator=()

const BreakpointList & lldb_private::BreakpointList::operator= ( const BreakpointList )
privatedelete

◆ Remove()

bool BreakpointList::Remove ( lldb::break_id_t  breakID,
bool  notify 
)

Removes the breakpoint given by breakID from this list.

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

Definition at line 47 of file BreakpointList.cpp.

References m_breakpoints, m_mutex, and NotifyChange().

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

◆ RemoveAll()

void BreakpointList::RemoveAll ( bool  notify)

Removes all the breakpoints from this list.

Definition at line 84 of file BreakpointList.cpp.

References ClearAllBreakpointSites(), m_breakpoints, m_mutex, and NotifyChange().

Referenced by lldb_private::Target::Destroy(), and lldb_private::Target::RemoveAllBreakpoints().

◆ RemoveAllowed()

void BreakpointList::RemoveAllowed ( bool  notify)

Removes all the breakpoints from this list - first checking the ePermDelete on the breakpoints.

This call should be used unless you are shutting down and need to actually clear them all.

Definition at line 96 of file BreakpointList.cpp.

References m_breakpoints, m_mutex, and NotifyChange().

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

◆ RemoveInvalidLocations()

void BreakpointList::RemoveInvalidLocations ( const ArchSpec arch)

Removes all invalid breakpoint locations.

Removes all breakpoint locations in the list with architectures that aren't compatible with arch. Also remove any breakpoint locations with whose locations have address where the section has been deleted (module and object files no longer exist).

This is typically used after the process calls exec, or anytime the architecture of the target changes.

Parameters
[in]archIf valid, check the module in each breakpoint to make sure they are compatible, otherwise, ignore architecture.

Definition at line 65 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

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

◆ ResetHitCounts()

void BreakpointList::ResetHitCounts ( )

Resets the hit count of all breakpoints.

Definition at line 192 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

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

◆ SetEnabledAll()

void BreakpointList::SetEnabledAll ( bool  enabled)

◆ SetEnabledAllowed()

void BreakpointList::SetEnabledAllowed ( bool  enabled)

◆ UpdateBreakpoints()

void BreakpointList::UpdateBreakpoints ( ModuleList module_list,
bool  load,
bool  delete_locations 
)

Tell all the breakpoints to update themselves due to a change in the modules in module_list.

added says whether the module was loaded or unloaded.

Parameters
[in]module_listThe module list that has changed.
[in]loadtrue if the modules are loaded, false if unloaded.
[in]delete_locationsIf load is false, then delete breakpoint locations when when updating breakpoints.

Definition at line 172 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

Referenced by lldb_private::Target::ModulesDidLoad(), lldb_private::Target::ModulesDidUnload(), and lldb_private::Target::SymbolsDidLoad().

◆ UpdateBreakpointsWhenModuleIsReplaced()

void BreakpointList::UpdateBreakpointsWhenModuleIsReplaced ( lldb::ModuleSP  old_module_sp,
lldb::ModuleSP  new_module_sp 
)

Definition at line 179 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

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

Member Data Documentation

◆ m_breakpoints

bp_collection lldb_private::BreakpointList::m_breakpoints
protected

◆ m_is_internal

bool lldb_private::BreakpointList::m_is_internal
protected

Definition at line 163 of file BreakpointList.h.

Referenced by Add().

◆ m_mutex

std::recursive_mutex lldb_private::BreakpointList::m_mutex
mutableprotected

◆ m_next_break_id

lldb::break_id_t lldb_private::BreakpointList::m_next_break_id
protected

Definition at line 162 of file BreakpointList.h.

Referenced by Add().


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