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"

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...
 
llvm::Expected< std::vector< lldb::BreakpointSP > > FindBreakpointsByName (const char *name)
 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
 

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

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

Definition at line 148 of file BreakpointList.h.

◆ BreakpointIterable

Definition at line 165 of file BreakpointList.h.

Constructor & Destructor Documentation

◆ BreakpointList() [1/2]

BreakpointList::BreakpointList ( bool  is_internal)

Definition at line 25 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 31 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

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 124 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()

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(), lldb_private::RenderScriptRuntime::CaptureDebugHintScriptGroup2(), CommandObjectBreakpointList::DoExecute(), CommandObjectBreakpointClear::DoExecute(), lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), and lldb_private::Target::SerializeBreakpointsToFile().

◆ 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 155 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 45 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 82 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 94 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 63 of file BreakpointList.cpp.

References m_breakpoints, and m_mutex.

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

◆ 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 160 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 159 of file BreakpointList.h.

Referenced by Add().


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