LLDB  mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
lldb_private::Breakpoint Class Reference

General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locations that have been determined for the filter/resolver pair, and finally a set of options for the breakpoint. More...

#include "lldb/Breakpoint/Breakpoint.h"

Inheritance diagram for lldb_private::Breakpoint:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::Breakpoint:
Collaboration graph
[legend]

Classes

class  BreakpointEventData
 
class  BreakpointPrecondition
 

Public Types

enum  MatchType { Exact, Regexp, Glob }
 An enum specifying the match style for breakpoint settings. More...
 
typedef std::shared_ptr< BreakpointPreconditionBreakpointPreconditionSP
 

Public Member Functions

virtual StructuredData::ObjectSP SerializeToStructuredData ()
 
 ~Breakpoint () override
 Destructor. More...
 
bool IsInternal () const
 Tell whether this breakpoint is an "internal" breakpoint. More...
 
void Dump (Stream *s) override
 Standard "Dump" method. At present it does nothing. More...
 
void ClearAllBreakpointSites ()
 Tell this breakpoint to clear all its breakpoint sites. More...
 
void ResolveBreakpoint ()
 Tell this breakpoint to scan it's target's module list and resolve any new locations that match the breakpoint's specifications. More...
 
void ResolveBreakpointInModules (ModuleList &module_list, bool send_event=true)
 Tell this breakpoint to scan a given module list and resolve any new locations that match the breakpoint's specifications. More...
 
void ResolveBreakpointInModules (ModuleList &module_list, BreakpointLocationCollection &new_locations)
 Tell this breakpoint to scan a given module list and resolve any new locations that match the breakpoint's specifications. More...
 
void ModulesChanged (ModuleList &changed_modules, bool load_event, bool delete_locations=false)
 Like ResolveBreakpointInModules, but allows for "unload" events, in which case we will remove any locations that are in modules that got unloaded. More...
 
void ModuleReplaced (lldb::ModuleSP old_module_sp, lldb::ModuleSP new_module_sp)
 Tells the breakpoint the old module old_module_sp has been replaced by new_module_sp (usually because the underlying file has been rebuilt, and the old version is gone.) More...
 
lldb::BreakpointLocationSP AddLocation (const Address &addr, bool *new_location=nullptr)
 Add a location to the breakpoint's location list. More...
 
lldb::BreakpointLocationSP FindLocationByAddress (const Address &addr)
 Find a breakpoint location by Address. More...
 
lldb::break_id_t FindLocationIDByAddress (const Address &addr)
 Find a breakpoint location ID by Address. More...
 
lldb::BreakpointLocationSP FindLocationByID (lldb::break_id_t bp_loc_id)
 Find a breakpoint location for a given breakpoint location ID. More...
 
lldb::BreakpointLocationSP GetLocationAtIndex (size_t index)
 Get breakpoint locations by index. More...
 
void RemoveInvalidLocations (const ArchSpec &arch)
 Removes all invalid breakpoint locations. More...
 
void SetEnabled (bool enable) override
 If enable is true, enable the breakpoint, if false disable it. More...
 
bool IsEnabled () override
 Check the Enable/Disable state. More...
 
void SetIgnoreCount (uint32_t count)
 Set the breakpoint to ignore the next count breakpoint hits. More...
 
uint32_t GetIgnoreCount () const
 Return the current ignore count/. More...
 
uint32_t GetHitCount () const
 Return the current hit count for all locations. More...
 
void SetOneShot (bool one_shot)
 If one_shot is true, breakpoint will be deleted on first hit. More...
 
bool IsOneShot () const
 Check the OneShot state. More...
 
void SetAutoContinue (bool auto_continue)
 If auto_continue is true, breakpoint will auto-continue when on hit. More...
 
bool IsAutoContinue () const
 Check the AutoContinue state. More...
 
void SetThreadID (lldb::tid_t thread_id)
 Set the valid thread to be checked when the breakpoint is hit. More...
 
lldb::tid_t GetThreadID () const
 Return the current stop thread value. More...
 
void SetThreadIndex (uint32_t index)
 
uint32_t GetThreadIndex () const
 
void SetThreadName (const char *thread_name)
 
const char * GetThreadName () const
 
void SetQueueName (const char *queue_name)
 
const char * GetQueueName () const
 
void SetCallback (BreakpointHitCallback callback, void *baton, bool is_synchronous=false)
 Set the callback action invoked when the breakpoint is hit. More...
 
void SetCallback (BreakpointHitCallback callback, const lldb::BatonSP &callback_baton_sp, bool is_synchronous=false)
 
void ClearCallback ()
 
void SetCondition (const char *condition)
 Set the breakpoint's condition. More...
 
const char * GetConditionText () const
 Return a pointer to the text of the condition expression. More...
 
size_t GetNumResolvedLocations () const
 Return the number of breakpoint locations that have resolved to actual breakpoint sites. More...
 
bool HasResolvedLocations () const
 Return whether this breakpoint has any resolved locations. More...
 
size_t GetNumLocations () const
 Return the number of breakpoint locations. More...
 
void GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_locations=false)
 Put a description of this breakpoint into the stream s. More...
 
void SetBreakpointKind (const char *kind)
 Set the "kind" description for a breakpoint. More...
 
const char * GetBreakpointKind () const
 Return the "kind" description for a breakpoint. More...
 
TargetGetTarget ()
 Accessor for the breakpoint Target. More...
 
const TargetGetTarget () const
 
const lldb::TargetSP GetTargetSP ()
 
void GetResolverDescription (Stream *s)
 
bool GetMatchingFileLine (ConstString filename, uint32_t line_number, BreakpointLocationCollection &loc_coll)
 Find breakpoint locations which match the (filename, line_number) description. More...
 
void GetFilterDescription (Stream *s)
 
BreakpointOptionsGetOptions ()
 Returns the BreakpointOptions structure set at the breakpoint level. More...
 
const BreakpointOptionsGetOptions () const
 Returns the BreakpointOptions structure set at the breakpoint level. More...
 
bool InvokeCallback (StoppointCallbackContext *context, lldb::break_id_t bp_loc_id)
 Invoke the callback action when the breakpoint is hit. More...
 
bool IsHardware () const
 
lldb::BreakpointResolverSP GetResolver ()
 
lldb::SearchFilterSP GetSearchFilter ()
 
bool MatchesName (const char *name)
 
void GetNames (std::vector< std::string > &names)
 
void SetPrecondition (BreakpointPreconditionSP precondition_sp)
 Set a pre-condition filter that overrides all user provided filters/callbacks etc. More...
 
bool EvaluatePrecondition (StoppointCallbackContext &context)
 
BreakpointPreconditionSP GetPrecondition ()
 
const BreakpointName::PermissionsGetPermissions () const
 
BreakpointName::PermissionsGetPermissions ()
 
bool AllowList () const
 
bool AllowDisable () const
 
bool AllowDelete () const
 
- Public Member Functions inherited from lldb_private::Stoppoint
 Stoppoint ()
 
virtual ~Stoppoint ()
 
lldb::break_id_t GetID () const
 
void SetID (lldb::break_id_t bid)
 

Static Public Member Functions

static ConstString GetEventIdentifier ()
 
static lldb::BreakpointSP CreateFromStructuredData (Target &target, StructuredData::ObjectSP &data_object_sp, Status &error)
 
static bool SerializedBreakpointMatchesNames (StructuredData::ObjectSP &bkpt_object_sp, std::vector< std::string > &names)
 
static const char * GetSerializationKey ()
 

Protected Member Functions

 Breakpoint (Target &target, lldb::SearchFilterSP &filter_sp, lldb::BreakpointResolverSP &resolver_sp, bool hardware, bool resolve_indirect_symbols=true)
 Constructors and Destructors Only the Target can make a breakpoint, and it owns the breakpoint lifespans. More...
 
void DecrementIgnoreCount ()
 
bool IgnoreCountShouldStop ()
 
void IncrementHitCount ()
 
void DecrementHitCount ()
 

Friends

class Target
 
class BreakpointLocation
 

Additional Inherited Members

- Protected Attributes inherited from lldb_private::Stoppoint
lldb::break_id_t m_bid
 

Detailed Description

General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locations that have been determined for the filter/resolver pair, and finally a set of options for the breakpoint.

Class that manages logical breakpoint setting.

Filter: This is an object derived from SearchFilter. It manages the search for breakpoint location matches through the symbols in the module list of the target that owns it. It also filters out locations based on whatever logic it wants.

Resolver: This is an object derived from BreakpointResolver. It provides a callback to the filter that will find breakpoint locations. How it does this is determined by what kind of resolver it is.

The Breakpoint class also provides constructors for the common breakpoint cases which make the appropriate filter and resolver for you.

Location List: This stores the breakpoint locations that have been determined to date. For a given breakpoint, there will be only one location with a given address. Adding a location at an already taken address will just return the location already at that address. Locations can be looked up by ID, or by address.

Options: This includes: Enabled/Disabled Ignore Count Callback Condition Note, these options can be set on the breakpoint, and they can also be set on the individual locations. The options set on the breakpoint take precedence over the options set on the individual location. So for instance disabling the breakpoint will cause NONE of the locations to get hit. But if the breakpoint is enabled, then the location's enabled state will be checked to determine whether to insert that breakpoint location. Similarly, if the breakpoint condition says "stop", we won't check the location's condition. But if the breakpoint condition says "continue", then we will check the location for whether to actually stop or not. One subtle point worth observing here is that you don't actually stop at a Breakpoint, you always stop at one of its locations. So the "should stop" tests are done by the location, not by the breakpoint.

Definition at line 78 of file Breakpoint.h.

Member Typedef Documentation

◆ BreakpointPreconditionSP

Definition at line 154 of file Breakpoint.h.

Member Enumeration Documentation

◆ MatchType

An enum specifying the match style for breakpoint settings.

At present only used for function name style breakpoints.

Enumerator
Exact 
Regexp 
Glob 

Definition at line 85 of file Breakpoint.h.

Constructor & Destructor Documentation

◆ ~Breakpoint()

Breakpoint::~Breakpoint ( )
overridedefault

Destructor.

The destructor is not virtual since there should be no reason to subclass breakpoints. The varieties of breakpoints are specified instead by providing different resolvers & filters.

Referenced by GetSerializationKey().

◆ Breakpoint()

lldb_private::Breakpoint::Breakpoint ( Target target,
lldb::SearchFilterSP &  filter_sp,
lldb::BreakpointResolverSP &  resolver_sp,
bool  hardware,
bool  resolve_indirect_symbols = true 
)
protected

Constructors and Destructors Only the Target can make a breakpoint, and it owns the breakpoint lifespans.

The constructor takes a filter and a resolver. Up in Target there are convenience variants that make breakpoints for some common cases.

Parameters
[in]targetThe target in which the breakpoint will be set.
[in]filter_spShared pointer to the search filter that restricts the search domain of the breakpoint.
[in]resolver_spShared pointer to the resolver object that will determine breakpoint matches.
hardwareIf true, request a hardware breakpoint to be used to implement the breakpoint locations.
resolve_indirect_symbolsIf true, and the address of a given breakpoint location in this breakpoint is set on an indirect symbol (i.e. Symbol::IsIndirect returns true) then the actual breakpoint site will be set on the target of the indirect symbol.

Referenced by DecrementHitCount().

Member Function Documentation

◆ AddLocation()

BreakpointLocationSP Breakpoint::AddLocation ( const Address addr,
bool *  new_location = nullptr 
)

Add a location to the breakpoint's location list.

This is only meant to be called by the breakpoint's resolver. FIXME: how do I ensure that?

Parameters
[in]addrThe Address specifying the new location.
[out]new_locationSet to true if a new location was created, to false if there already was a location at this Address.
Returns
Returns a pointer to the new location.

Definition at line 253 of file Breakpoint.cpp.

Referenced by lldb_private::BreakpointResolver::AddLocation(), and GetSerializationKey().

◆ AllowDelete()

bool lldb_private::Breakpoint::AllowDelete ( ) const
inline

◆ AllowDisable()

bool lldb_private::Breakpoint::AllowDisable ( ) const
inline

◆ AllowList()

bool lldb_private::Breakpoint::AllowList ( ) const
inline

◆ ClearAllBreakpointSites()

void Breakpoint::ClearAllBreakpointSites ( )

Tell this breakpoint to clear all its breakpoint sites.

Done when the process holding the breakpoint sites is destroyed.

Definition at line 489 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ ClearCallback()

void Breakpoint::ClearCallback ( )

◆ CreateFromStructuredData()

lldb::BreakpointSP Breakpoint::CreateFromStructuredData ( Target target,
StructuredData::ObjectSP data_object_sp,
Status error 
)
static

◆ DecrementHitCount()

void lldb_private::Breakpoint::DecrementHitCount ( )
inlineprotected

Definition at line 639 of file Breakpoint.h.

References Breakpoint().

◆ DecrementIgnoreCount()

void Breakpoint::DecrementIgnoreCount ( )
protected

Definition at line 311 of file Breakpoint.cpp.

◆ Dump()

void Breakpoint::Dump ( Stream s)
overridevirtual

◆ EvaluatePrecondition()

bool Breakpoint::EvaluatePrecondition ( StoppointCallbackContext context)

Definition at line 991 of file Breakpoint.cpp.

Referenced by SetPrecondition().

◆ FindLocationByAddress()

BreakpointLocationSP Breakpoint::FindLocationByAddress ( const Address addr)

Find a breakpoint location by Address.

Parameters
[in]addrThe Address specifying the location.
Returns
Returns a shared pointer to the location at addr. The pointer in the shared pointer will be nullptr if there is no location at that address.

Definition at line 259 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ FindLocationByID()

BreakpointLocationSP Breakpoint::FindLocationByID ( lldb::break_id_t  bp_loc_id)

Find a breakpoint location for a given breakpoint location ID.

Parameters
[in]bp_loc_idThe ID specifying the location.
Returns
Returns a shared pointer to the location with ID bp_loc_id. The pointer in the shared pointer will be nullptr if there is no location with that ID.

Definition at line 267 of file Breakpoint.cpp.

Referenced by CommandObjectBreakpointCommandAdd::DoExecute(), CommandObjectBreakpointCommandDelete::DoExecute(), CommandObjectBreakpointCommandList::DoExecute(), CommandObjectBreakpointModify::DoExecute(), CommandObjectBreakpointEnable::DoExecute(), CommandObjectBreakpointDisable::DoExecute(), CommandObjectBreakpointDelete::DoExecute(), and GetSerializationKey().

◆ FindLocationIDByAddress()

break_id_t Breakpoint::FindLocationIDByAddress ( const Address addr)

Find a breakpoint location ID by Address.

Parameters
[in]addrThe Address specifying the location.
Returns
Returns the UID of the location at addr, or LLDB_INVALID_ID if there is no breakpoint location at that address.

Definition at line 263 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ GetBreakpointKind()

const char* lldb_private::Breakpoint::GetBreakpointKind ( ) const
inline

Return the "kind" description for a breakpoint.

Returns
The breakpoint kind, or nullptr if none is set.

Definition at line 462 of file Breakpoint.h.

◆ GetConditionText()

const char * Breakpoint::GetConditionText ( ) const

Return a pointer to the text of the condition expression.

Returns
A pointer to the condition expression text, or nullptr if no

Definition at line 416 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ GetDescription()

void Breakpoint::GetDescription ( Stream s,
lldb::DescriptionLevel  level,
bool  show_locations = false 
)

◆ GetEventIdentifier()

ConstString Breakpoint::GetEventIdentifier ( )
static

Definition at line 38 of file Breakpoint.cpp.

◆ GetFilterDescription()

void Breakpoint::GetFilterDescription ( Stream s)

Definition at line 987 of file Breakpoint.cpp.

References lldb_private::BreakpointResolverFileLine::GetDescription().

Referenced by GetTarget().

◆ GetHitCount()

uint32_t Breakpoint::GetHitCount ( ) const

Return the current hit count for all locations.

Returns
The current hit count for all locations.

Definition at line 333 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ GetIgnoreCount()

uint32_t Breakpoint::GetIgnoreCount ( ) const

Return the current ignore count/.

Returns
The number of breakpoint hits to be ignored.

Definition at line 317 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ GetLocationAtIndex()

BreakpointLocationSP Breakpoint::GetLocationAtIndex ( size_t  index)

Get breakpoint locations by index.

Parameters
[in]indexThe location index.
Returns
Returns a shared pointer to the location with index index. The shared pointer might contain nullptr if index is greater than then number of actual locations.

Definition at line 271 of file Breakpoint.cpp.

Referenced by lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), GetSerializationKey(), and lldb_private::BreakpointResolverAddress::SearchCallback().

◆ GetMatchingFileLine()

bool Breakpoint::GetMatchingFileLine ( ConstString  filename,
uint32_t  line_number,
BreakpointLocationCollection loc_coll 
)

Find breakpoint locations which match the (filename, line_number) description.

The breakpoint location collection is to be filled with the matching locations. It should be initialized with 0 size by the API client.

Returns
True if there is a match

The locations which match the filename and line_number in loc_coll. If its size is 0 and true is returned, it means the breakpoint fully matches the description.

Definition at line 967 of file Breakpoint.cpp.

References lldb_private::FileSpec::GetFilename(), lldb_private::BreakpointResolverFileLine::m_file_spec, and lldb_private::BreakpointResolverFileLine::m_line_number.

Referenced by CommandObjectBreakpointClear::DoExecute(), and GetTarget().

◆ GetNames()

void lldb_private::Breakpoint::GetNames ( std::vector< std::string > &  names)
inline

Definition at line 544 of file Breakpoint.h.

◆ GetNumLocations()

size_t Breakpoint::GetNumLocations ( ) const

◆ GetNumResolvedLocations()

size_t Breakpoint::GetNumResolvedLocations ( ) const

Return the number of breakpoint locations that have resolved to actual breakpoint sites.

Returns
The number locations resolved breakpoint sites.

Definition at line 843 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ GetOptions() [1/2]

BreakpointOptions * Breakpoint::GetOptions ( )

Returns the BreakpointOptions structure set at the breakpoint level.

Meant to be used by the BreakpointLocation class.

Returns
A pointer to this breakpoint's BreakpointOptions.

Definition at line 446 of file Breakpoint.cpp.

Referenced by CommandObjectBreakpointCommandAdd::DoExecute(), CommandObjectBreakpointCommandList::DoExecute(), CommandObjectBreakpointModify::DoExecute(), and GetTarget().

◆ GetOptions() [2/2]

const BreakpointOptions * Breakpoint::GetOptions ( ) const

Returns the BreakpointOptions structure set at the breakpoint level.

Meant to be used by the BreakpointLocation class.

Returns
A pointer to this breakpoint's BreakpointOptions.

Definition at line 448 of file Breakpoint.cpp.

◆ GetPermissions() [1/2]

const BreakpointName::Permissions& lldb_private::Breakpoint::GetPermissions ( ) const
inline

Definition at line 570 of file Breakpoint.h.

Referenced by AllowDelete(), AllowDisable(), and AllowList().

◆ GetPermissions() [2/2]

BreakpointName::Permissions& lldb_private::Breakpoint::GetPermissions ( )
inline

Definition at line 574 of file Breakpoint.h.

◆ GetPrecondition()

BreakpointPreconditionSP lldb_private::Breakpoint::GetPrecondition ( )
inline

Definition at line 567 of file Breakpoint.h.

◆ GetQueueName()

const char * Breakpoint::GetQueueName ( ) const

Definition at line 404 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ GetResolver()

lldb::BreakpointResolverSP lldb_private::Breakpoint::GetResolver ( )
inline

Definition at line 526 of file Breakpoint.h.

◆ GetResolverDescription()

void Breakpoint::GetResolverDescription ( Stream s)

Definition at line 962 of file Breakpoint.cpp.

Referenced by GetTarget().

◆ GetSearchFilter()

lldb::SearchFilterSP lldb_private::Breakpoint::GetSearchFilter ( )
inline

Definition at line 528 of file Breakpoint.h.

◆ GetSerializationKey()

static const char* lldb_private::Breakpoint::GetSerializationKey ( )
inlinestatic

◆ GetTarget() [1/2]

Target& lldb_private::Breakpoint::GetTarget ( )
inline

◆ GetTarget() [2/2]

const Target& lldb_private::Breakpoint::GetTarget ( ) const
inline

◆ GetTargetSP()

const lldb::TargetSP Breakpoint::GetTargetSP ( )

◆ GetThreadID()

lldb::tid_t Breakpoint::GetThreadID ( ) const

Return the current stop thread value.

Returns
The thread id for which the breakpoint hit will stop, LLDB_INVALID_THREAD_ID for all threads.

Definition at line 357 of file Breakpoint.cpp.

References LLDB_INVALID_THREAD_ID.

Referenced by GetSerializationKey().

◆ GetThreadIndex()

uint32_t Breakpoint::GetThreadIndex ( ) const

Definition at line 372 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ GetThreadName()

const char * Breakpoint::GetThreadName ( ) const

Definition at line 388 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ HasResolvedLocations()

bool Breakpoint::HasResolvedLocations ( ) const

◆ IgnoreCountShouldStop()

bool Breakpoint::IgnoreCountShouldStop ( )
protected

Definition at line 321 of file Breakpoint.cpp.

◆ IncrementHitCount()

void lldb_private::Breakpoint::IncrementHitCount ( )
inlineprotected

Definition at line 637 of file Breakpoint.h.

◆ InvokeCallback()

bool Breakpoint::InvokeCallback ( StoppointCallbackContext context,
lldb::break_id_t  bp_loc_id 
)

Invoke the callback action when the breakpoint is hit.

Meant to be used by the BreakpointLocation class.

Parameters
[in]contextDescribed the breakpoint event.
[in]bp_loc_idWhich breakpoint location hit this breakpoint.
Returns
true if the target should stop at this breakpoint and false not.

Definition at line 441 of file Breakpoint.cpp.

Referenced by GetTarget().

◆ IsAutoContinue()

bool Breakpoint::IsAutoContinue ( ) const

Check the AutoContinue state.

Returns
true if the breakpoint is set to auto-continue, false otherwise.

Definition at line 341 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ IsEnabled()

bool Breakpoint::IsEnabled ( )
overridevirtual

Check the Enable/Disable state.

Returns
true if the breakpoint is enabled, false if disabled.

Implements lldb_private::Stoppoint.

Definition at line 301 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ IsHardware()

bool lldb_private::Breakpoint::IsHardware ( ) const
inline

◆ IsInternal()

bool Breakpoint::IsInternal ( ) const

◆ IsOneShot()

bool Breakpoint::IsOneShot ( ) const

Check the OneShot state.

Returns
true if the breakpoint is one shot, false otherwise.

Definition at line 335 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ MatchesName()

bool lldb_private::Breakpoint::MatchesName ( const char *  name)
inline

Definition at line 540 of file Breakpoint.h.

◆ ModuleReplaced()

void Breakpoint::ModuleReplaced ( lldb::ModuleSP  old_module_sp,
lldb::ModuleSP  new_module_sp 
)

Tells the breakpoint the old module old_module_sp has been replaced by new_module_sp (usually because the underlying file has been rebuilt, and the old version is gone.)

Parameters
[in]old_module_spThe old module that is going away.
[in]new_module_spThe new module that is replacing it.

Definition at line 658 of file Breakpoint.cpp.

References lldb_private::BreakpointLocationCollection::Add(), lldb_private::ModuleList::Append(), lldb_private::BreakpointLocationCollection::BreakpointLocations(), lldb_private::BreakpointLocationCollection::FindByIDPair(), lldb_private::Breakpoint::BreakpointEventData::GetBreakpointLocationCollection(), lldb_private::BreakpointLocationCollection::GetByIndex(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::BreakpointLocationCollection::GetSize(), LIBLLDB_LOG_BREAKPOINTS, and lldb_private::Log::Printf().

Referenced by GetSerializationKey().

◆ ModulesChanged()

void Breakpoint::ModulesChanged ( ModuleList changed_modules,
bool  load_event,
bool  delete_locations = false 
)

◆ RemoveInvalidLocations()

void Breakpoint::RemoveInvalidLocations ( const ArchSpec arch)

Removes all invalid breakpoint locations.

Removes all breakpoint locations 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 275 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ ResolveBreakpoint()

void Breakpoint::ResolveBreakpoint ( )

Tell this breakpoint to scan it's target's module list and resolve any new locations that match the breakpoint's specifications.

Definition at line 452 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ ResolveBreakpointInModules() [1/2]

void Breakpoint::ResolveBreakpointInModules ( ModuleList module_list,
bool  send_event = true 
)

Tell this breakpoint to scan a given module list and resolve any new locations that match the breakpoint's specifications.

Parameters
[in]module_listThe list of modules to look in for new locations.
[in]send_eventIf true, send a breakpoint location added event for non-internal breakpoints.

Definition at line 466 of file Breakpoint.cpp.

References lldb_private::Breakpoint::BreakpointEventData::GetBreakpointLocationCollection(), and lldb_private::BreakpointLocationCollection::GetSize().

Referenced by GetSerializationKey().

◆ ResolveBreakpointInModules() [2/2]

void Breakpoint::ResolveBreakpointInModules ( ModuleList module_list,
BreakpointLocationCollection new_locations 
)

Tell this breakpoint to scan a given module list and resolve any new locations that match the breakpoint's specifications.

Parameters
[in]changed_modulesThe list of modules to look in for new locations.
[in]new_locationsFills new_locations with the new locations that were made.

Definition at line 457 of file Breakpoint.cpp.

◆ SerializedBreakpointMatchesNames()

bool Breakpoint::SerializedBreakpointMatchesNames ( StructuredData::ObjectSP bkpt_object_sp,
std::vector< std::string > &  names 
)
static

◆ SerializeToStructuredData()

StructuredData::ObjectSP Breakpoint::SerializeToStructuredData ( )
virtual

Definition at line 73 of file Breakpoint.cpp.

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

◆ SetAutoContinue()

void Breakpoint::SetAutoContinue ( bool  auto_continue)

If auto_continue is true, breakpoint will auto-continue when on hit.

Definition at line 345 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ SetBreakpointKind()

void lldb_private::Breakpoint::SetBreakpointKind ( const char *  kind)
inline

◆ SetCallback() [1/2]

void Breakpoint::SetCallback ( BreakpointHitCallback  callback,
void *  baton,
bool  is_synchronous = false 
)

Set the callback action invoked when the breakpoint is hit.

Parameters
[in]callbackThe method that will get called when the breakpoint is hit.
[in]batonA void * pointer that will get passed back to the callback function.
[in]is_synchronousIf true the callback will be run on the private event thread before the stop event gets reported. If false, the callback will get handled on the public event thread after the stop has been posted.
Returns
true if the process should stop when you hit the breakpoint. false if it should continue.

Definition at line 421 of file Breakpoint.cpp.

Referenced by GetSerializationKey(), GetStopReasonDescription(), GetSymbolDeclarationFromAddress(), lldb_private::MainThreadCheckerRuntime::GetTypeStatic(), JITLoaderGDB::ModulesDidLoad(), DynamicLoaderPOSIXDYLD::ProbeEntry(), DynamicLoaderMacOS::SetNotificationBreakpoint(), DynamicLoaderMacOSXDYLD::SetNotificationBreakpoint(), DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded(), DynamicLoaderHexagonDYLD::SetRendezvousBreakpoint(), and ProcessFreeBSD::SetSoftwareSingleStepBreakpoint().

◆ SetCallback() [2/2]

void lldb_private::Breakpoint::SetCallback ( BreakpointHitCallback  callback,
const lldb::BatonSP &  callback_baton_sp,
bool  is_synchronous = false 
)

◆ SetCondition()

void Breakpoint::SetCondition ( const char *  condition)

Set the breakpoint's condition.

Parameters
[in]conditionThe condition expression to evaluate when the breakpoint is hit. Pass in nullptr to clear the condition.

Definition at line 411 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ SetEnabled()

void Breakpoint::SetEnabled ( bool  enable)
overridevirtual

◆ SetIgnoreCount()

void Breakpoint::SetIgnoreCount ( uint32_t  count)

Set the breakpoint to ignore the next count breakpoint hits.

Parameters
[in]countThe number of breakpoint hits to ignore.

Definition at line 303 of file Breakpoint.cpp.

Referenced by CommandObjectProcessContinue::DoExecute(), and GetSerializationKey().

◆ SetOneShot()

void Breakpoint::SetOneShot ( bool  one_shot)

If one_shot is true, breakpoint will be deleted on first hit.

Definition at line 337 of file Breakpoint.cpp.

Referenced by GetSerializationKey(), and DynamicLoaderPOSIXDYLD::ProbeEntry().

◆ SetPrecondition()

void lldb_private::Breakpoint::SetPrecondition ( BreakpointPreconditionSP  precondition_sp)
inline

Set a pre-condition filter that overrides all user provided filters/callbacks etc.

Used to define fancy breakpoints that can do dynamic hit detection without taking up the condition slot - which really belongs to the user anyway...

The Precondition should not continue the target, it should return true if the condition says to stop and false otherwise.

Definition at line 561 of file Breakpoint.h.

References EvaluatePrecondition().

◆ SetQueueName()

void Breakpoint::SetQueueName ( const char *  queue_name)

Definition at line 395 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ SetThreadID()

void Breakpoint::SetThreadID ( lldb::tid_t  thread_id)

Set the valid thread to be checked when the breakpoint is hit.

Parameters
[in]thread_idIf this thread hits the breakpoint, we stop, otherwise not.

Definition at line 349 of file Breakpoint.cpp.

Referenced by GetSerializationKey(), lldb_private::ThreadPlanRunToAddress::SetInitialBreakpoints(), lldb_private::ThreadPlanStepOut::ThreadPlanStepOut(), lldb_private::ThreadPlanStepThrough::ThreadPlanStepThrough(), and lldb_private::ThreadPlanStepUntil::ThreadPlanStepUntil().

◆ SetThreadIndex()

void Breakpoint::SetThreadIndex ( uint32_t  index)

Definition at line 364 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

◆ SetThreadName()

void Breakpoint::SetThreadName ( const char *  thread_name)

Definition at line 379 of file Breakpoint.cpp.

Referenced by GetSerializationKey().

Friends And Related Function Documentation

◆ BreakpointLocation

friend class BreakpointLocation
friend

Definition at line 624 of file Breakpoint.h.

◆ Target

friend class Target
friend

Definition at line 589 of file Breakpoint.h.


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