LLDB  mainline
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | 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"

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

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. More...
 
void Dump (Stream *s) const
 Standard "Dump" method. At present it does nothing. More...
 
lldb::BreakpointSP FindBreakpointByID (lldb::break_id_t breakID) const
 Returns a shared pointer to the breakpoint with id breakID. More...
 
lldb::BreakpointSP GetBreakpointAtIndex (size_t i) const
 Returns a shared pointer to the breakpoint with index i. More...
 
bool FindBreakpointsByName (const char *name, BreakpointList &matching_bps)
 Find all the breakpoints with a given name. More...
 
size_t GetSize () const
 Returns the number of elements in this breakpoint list. More...
 
bool Remove (lldb::break_id_t breakID, bool notify)
 Removes the breakpoint given by breakID from this list. More...
 
void RemoveInvalidLocations (const ArchSpec &arch)
 Removes all invalid breakpoint locations. More...
 
void SetEnabledAll (bool enabled)
 
void SetEnabledAllowed (bool enabled)
 
void RemoveAll (bool notify)
 Removes all the breakpoints from this list. More...
 
void RemoveAllowed (bool notify)
 Removes all the breakpoints from this list - first checking the ePermDelete on the breakpoints. More...
 
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. More...
 
void UpdateBreakpointsWhenModuleIsReplaced (lldb::ModuleSP old_module_sp, lldb::ModuleSP new_module_sp)
 
void ClearAllBreakpointSites ()
 
void GetListMutex (std::unique_lock< std::recursive_mutex > &lock)
 Sets the passed in Locker to hold the Breakpoint List mutex. More...
 
BreakpointIterable Breakpoints ()
 

Protected Types

typedef std::vector< lldb::BreakpointSP > bp_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
 

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

typedef std::vector<lldb::BreakpointSP> lldb_private::BreakpointList::bp_collection
protected

Definition at line 146 of file BreakpointList.h.

◆ BreakpointIterable

Definition at line 163 of file BreakpointList.h.

Constructor & Destructor Documentation

◆ BreakpointList()

BreakpointList::BreakpointList ( bool  is_internal)

Definition at line 23 of file BreakpointList.cpp.

◆ ~BreakpointList()

BreakpointList::~BreakpointList ( )

Definition at line 27 of file BreakpointList.cpp.

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 29 of file BreakpointList.cpp.

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

Referenced by lldb_private::Target::CreateScriptedBreakpoint(), and FindBreakpointsByName().

◆ Breakpoints()

BreakpointIterable lldb_private::BreakpointList::Breakpoints ( )
inline

◆ ClearAllBreakpointSites()

void BreakpointList::ClearAllBreakpointSites ( )

Definition at line 182 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

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

◆ Dump()

void BreakpointList::Dump ( Stream s) const

◆ FindBreakpointByID()

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

Returns a shared pointer to the breakpoint with id breakID.

Const version.

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

References GetBreakpointIDConstIterator(), m_breakpoints, and m_mutex.

Referenced by lldb_private::Target::AddNameToBreakpoint(), lldb_private::Target::DisableBreakpointByID(), CommandObjectBreakpointClear::DoExecute(), CommandObjectBreakpointNameAdd::DoExecute(), CommandObjectBreakpointNameDelete::DoExecute(), CommandObjectBreakpointRead::DoExecute(), lldb_private::Target::EnableBreakpointByID(), lldb_private::Target::GetBreakpointByID(), and lldb::SBBreakpointCallbackBaton::PrivateBreakpointHitCallback().

◆ FindBreakpointsByName()

bool BreakpointList::FindBreakpointsByName ( const char *  name,
BreakpointList matching_bps 
)

Find all the breakpoints with a given name.

Parameters
[in]nameThe breakpoint name for which to search.
Returns
if the input name was not a legal breakpoint name.

Definition at line 131 of file BreakpointList.cpp.

References Add(), Breakpoints(), 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 161 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

Referenced by lldb_private::RenderScriptRuntime::CreateExceptionResolver(), CommandObjectBreakpointList::DoExecute(), CommandObjectBreakpointClear::DoExecute(), lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), lldb_private::Target::SerializeBreakpointsToFile(), and SourceFileWindowDelegate::WindowDelegateDraw().

◆ GetBreakpointIDConstIterator()

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

Definition at line 116 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 109 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 153 of file BreakpointList.h.

References m_mutex.

Referenced by Breakpoints().

◆ GetSize()

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

◆ 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 43 of file BreakpointList.cpp.

References m_breakpoints, m_mutex, and NotifyChange().

Referenced by GetSize(), and lldb_private::Target::RemoveBreakpointByID().

◆ RemoveAll()

void BreakpointList::RemoveAll ( bool  notify)

Removes all the breakpoints from this list.

Definition at line 80 of file BreakpointList.cpp.

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

Referenced by lldb_private::Target::Destroy(), GetSize(), 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 92 of file BreakpointList.cpp.

References m_breakpoints, m_mutex, and NotifyChange().

Referenced by GetSize(), and 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 61 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

Referenced by lldb_private::Target::DidExec(), and GetSize().

◆ 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 168 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

Referenced by GetSize(), 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 175 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

Referenced by GetSize(), and 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 158 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 157 of file BreakpointList.h.

Referenced by Add().


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