LLDB mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | 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]

Classes

class  BreakpointEventData
 

Public Types

enum  MatchType { Exact , Regexp , Glob }
 An enum specifying the match style for breakpoint settings. More...
 

Public Member Functions

virtual StructuredData::ObjectSP SerializeToStructuredData ()
 
 ~Breakpoint () override
 Destructor.
 
bool IsInternal () const
 Tell whether this breakpoint is an "internal" breakpoint.
 
void Dump (Stream *s) override
 Standard "Dump" method. At present it does nothing.
 
void ClearAllBreakpointSites ()
 Tell this breakpoint to clear all its breakpoint sites.
 
void ResolveBreakpoint ()
 Tell this breakpoint to scan it's target's module list and resolve any new locations that match the breakpoint's specifications.
 
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.
 
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.
 
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.
 
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.)
 
lldb::BreakpointLocationSP AddLocation (const Address &addr, bool *new_location=nullptr)
 Add a location to the breakpoint's location list.
 
lldb::BreakpointLocationSP FindLocationByAddress (const Address &addr)
 Find a breakpoint location by Address.
 
lldb::break_id_t FindLocationIDByAddress (const Address &addr)
 Find a breakpoint location ID by Address.
 
lldb::BreakpointLocationSP FindLocationByID (lldb::break_id_t bp_loc_id)
 Find a breakpoint location for a given breakpoint location ID.
 
lldb::BreakpointLocationSP GetLocationAtIndex (size_t index)
 Get breakpoint locations by index.
 
void RemoveInvalidLocations (const ArchSpec &arch)
 Removes all invalid breakpoint locations.
 
void SetEnabled (bool enable) override
 If enable is true, enable the breakpoint, if false disable it.
 
bool IsEnabled () override
 Check the Enable/Disable state.
 
void SetIgnoreCount (uint32_t count)
 Set the breakpoint to ignore the next count breakpoint hits.
 
uint32_t GetIgnoreCount () const
 Return the current ignore count/.
 
uint32_t GetHitCount () const
 Return the current hit count for all locations.
 
void ResetHitCount ()
 Resets the current hit count for all locations.
 
void SetOneShot (bool one_shot)
 If one_shot is true, breakpoint will be deleted on first hit.
 
bool IsOneShot () const
 Check the OneShot state.
 
void SetAutoContinue (bool auto_continue)
 If auto_continue is true, breakpoint will auto-continue when on hit.
 
bool IsAutoContinue () const
 Check the AutoContinue state.
 
void SetThreadID (lldb::tid_t thread_id)
 Set the valid thread to be checked when the breakpoint is hit.
 
lldb::tid_t GetThreadID () const
 Return the current stop thread value.
 
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.
 
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.
 
const char * GetConditionText () const
 Return a pointer to the text of the condition expression.
 
size_t GetNumResolvedLocations () const
 Return the number of breakpoint locations that have resolved to actual breakpoint sites.
 
bool HasResolvedLocations () const
 Return whether this breakpoint has any resolved locations.
 
size_t GetNumLocations () const
 Return the number of breakpoint locations.
 
void GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_locations=false)
 Put a description of this breakpoint into the stream s.
 
void SetBreakpointKind (const char *kind)
 Set the "kind" description for a breakpoint.
 
const char * GetBreakpointKind () const
 Return the "kind" description for a breakpoint.
 
TargetGetTarget ()
 Accessor for the breakpoint Target.
 
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.
 
void GetFilterDescription (Stream *s)
 
BreakpointOptionsGetOptions ()
 Returns the BreakpointOptions structure set at the breakpoint level.
 
const BreakpointOptionsGetOptions () const
 Returns the BreakpointOptions structure set at the breakpoint level.
 
bool InvokeCallback (StoppointCallbackContext *context, lldb::break_id_t bp_loc_id)
 Invoke the callback action when the breakpoint is hit.
 
bool IsHardware () const
 
lldb::BreakpointResolverSP GetResolver ()
 
lldb::SearchFilterSP GetSearchFilter ()
 
bool MatchesName (const char *name)
 
void GetNames (std::vector< std::string > &names)
 
void SetPrecondition (lldb::BreakpointPreconditionSP precondition_sp)
 Set a pre-condition filter that overrides all user provided filters/callbacks etc.
 
bool EvaluatePrecondition (StoppointCallbackContext &context)
 
lldb::BreakpointPreconditionSP GetPrecondition ()
 
const BreakpointName::PermissionsGetPermissions () const
 
BreakpointName::PermissionsGetPermissions ()
 
bool AllowList () const
 
bool AllowDisable () const
 
bool AllowDelete () const
 
llvm::json::Value GetStatistics ()
 Get statistics associated with this breakpoint in JSON format.
 
StatsDuration::Duration GetResolveTime () const
 Get the time it took to resolve all locations in this breakpoint.
 
- Public Member Functions inherited from lldb_private::Stoppoint
 Stoppoint ()
 
virtual ~Stoppoint ()
 
virtual void Dump (Stream *)=0
 
virtual bool IsEnabled ()=0
 
virtual void SetEnabled (bool enable)=0
 
lldb::break_id_t GetID () const
 
void SetID (lldb::break_id_t bid)
 

Static Public Member Functions

static const char * BreakpointEventTypeAsCString (lldb::BreakpointEventType type)
 
static lldb::BreakpointSP CreateFromStructuredData (lldb::TargetSP target_sp, StructuredData::ObjectSP &data_object_sp, Status &error)
 
static bool SerializedBreakpointMatchesNames (StructuredData::ObjectSP &bkpt_object_sp, std::vector< std::string > &names)
 
static const char * GetSerializationKey ()
 
static lldb::BreakpointSP CopyFromBreakpoint (lldb::TargetSP new_target, const Breakpoint &bp_to_copy_from)
 

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.
 
void DecrementIgnoreCount ()
 

Private Types

enum class  OptionNames : uint32_t { Names = 0 , Hardware , LastOptionName }
 

Private Member Functions

void AddName (llvm::StringRef new_name)
 
void RemoveName (const char *name_to_remove)
 
 Breakpoint (Target &new_target, const Breakpoint &bp_to_copy_from)
 
void SendBreakpointChangedEvent (lldb::BreakpointEventType eventKind)
 
void SendBreakpointChangedEvent (const lldb::EventDataSP &breakpoint_data_sp)
 
 Breakpoint (const Breakpoint &)=delete
 
const Breakpointoperator= (const Breakpoint &)=delete
 

Static Private Member Functions

static const char * GetKey (OptionNames enum_value)
 

Private Attributes

bool m_hardware
 
Targetm_target
 
std::unordered_set< std::string > m_name_list
 
lldb::SearchFilterSP m_filter_sp
 
lldb::BreakpointResolverSP m_resolver_sp
 
lldb::BreakpointPreconditionSP m_precondition_sp
 
BreakpointOptions m_options
 
BreakpointLocationList m_locations
 
std::string m_kind_description
 
bool m_resolve_indirect_symbols
 
StoppointHitCounter m_hit_counter
 Number of times this breakpoint has been hit.
 
BreakpointName::Permissions m_permissions
 
StatsDuration m_resolve_time
 

Static Private Attributes

static const char * g_option_names [static_cast< uint32_t >(OptionNames::LastOptionName)] {"Names", "Hardware"}
 

Friends

class Target
 
class BreakpointLocation
 

Additional Inherited Members

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

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 80 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 88 of file Breakpoint.h.

◆ OptionNames

enum class lldb_private::Breakpoint::OptionNames : uint32_t
strongprivate
Enumerator
Names 
Hardware 
LastOptionName 

Definition at line 91 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.

◆ Breakpoint() [1/3]

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.

Definition at line 44 of file Breakpoint.cpp.

◆ Breakpoint() [2/3]

Breakpoint::Breakpoint ( Target new_target,
const Breakpoint bp_to_copy_from 
)
private

Definition at line 51 of file Breakpoint.cpp.

◆ Breakpoint() [3/3]

lldb_private::Breakpoint::Breakpoint ( const Breakpoint )
privatedelete

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 251 of file Breakpoint.cpp.

References lldb_private::BreakpointLocationList::AddLocation(), m_locations, and m_resolve_indirect_symbols.

◆ AddName()

void Breakpoint::AddName ( llvm::StringRef  new_name)
private

Definition at line 832 of file Breakpoint.cpp.

References m_name_list.

◆ AllowDelete()

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

◆ AllowDisable()

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

◆ AllowList()

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

◆ BreakpointEventTypeAsCString()

const char * Breakpoint::BreakpointEventTypeAsCString ( lldb::BreakpointEventType  type)
static

Definition at line 999 of file Breakpoint.cpp.

Referenced by lldb_private::Breakpoint::BreakpointEventData::Dump().

◆ 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 474 of file Breakpoint.cpp.

References lldb_private::BreakpointLocationList::ClearAllBreakpointSites(), and m_locations.

◆ ClearCallback()

void Breakpoint::ClearCallback ( )

◆ CopyFromBreakpoint()

BreakpointSP Breakpoint::CopyFromBreakpoint ( lldb::TargetSP  new_target,
const Breakpoint bp_to_copy_from 
)
static

Definition at line 61 of file Breakpoint.cpp.

References m_filter_sp, and m_resolver_sp.

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

◆ CreateFromStructuredData()

lldb::BreakpointSP Breakpoint::CreateFromStructuredData ( lldb::TargetSP  target_sp,
StructuredData::ObjectSP data_object_sp,
Status error 
)
static

◆ DecrementIgnoreCount()

void Breakpoint::DecrementIgnoreCount ( )
protected

◆ Dump()

void Breakpoint::Dump ( Stream s)
overridevirtual

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

Implements lldb_private::Stoppoint.

Definition at line 818 of file Breakpoint.cpp.

Referenced by lldb_private::ThreadPlanRunToAddress::GetDescription(), and GetDescription().

◆ EvaluatePrecondition()

bool Breakpoint::EvaluatePrecondition ( StoppointCallbackContext context)

Definition at line 970 of file Breakpoint.cpp.

References m_precondition_sp.

◆ 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 257 of file Breakpoint.cpp.

References lldb_private::BreakpointLocationList::FindByAddress(), and m_locations.

◆ 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 265 of file Breakpoint.cpp.

References lldb_private::BreakpointLocationList::FindByID(), and m_locations.

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

◆ 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 261 of file Breakpoint.cpp.

References lldb_private::BreakpointLocationList::FindIDByAddress(), and m_locations.

◆ 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 458 of file Breakpoint.h.

References m_kind_description.

Referenced by GetDescription(), and lldb_private::TargetStats::ToJSON().

◆ 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 403 of file Breakpoint.cpp.

References lldb_private::BreakpointOptions::GetConditionText(), and m_options.

◆ GetDescription()

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

◆ GetFilterDescription()

void Breakpoint::GetFilterDescription ( Stream s)

Definition at line 966 of file Breakpoint.cpp.

References m_filter_sp.

Referenced by GetDescription().

◆ 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 319 of file Breakpoint.cpp.

References lldb_private::StoppointHitCounter::GetValue(), and m_hit_counter.

Referenced by GetDescription(), GetStatistics(), and lldb_private::TargetStats::ToJSON().

◆ GetIgnoreCount()

uint32_t Breakpoint::GetIgnoreCount ( ) const

Return the current ignore count/.

Returns
The number of breakpoint hits to be ignored.

Definition at line 315 of file Breakpoint.cpp.

References lldb_private::BreakpointOptions::GetIgnoreCount(), and m_options.

Referenced by lldb_private::BreakpointLocation::IgnoreCountShouldStop().

◆ GetKey()

static const char * lldb_private::Breakpoint::GetKey ( OptionNames  enum_value)
inlinestaticprivate

◆ 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 269 of file Breakpoint.cpp.

References lldb_private::BreakpointLocationList::GetByIndex(), and m_locations.

Referenced by lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), GetDescription(), 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 943 of file Breakpoint.cpp.

References lldb_private::FileSpec::GetFilename(), lldb_private::SourceLocationSpec::GetFileSpec(), lldb_private::SourceLocationSpec::GetLine(), lldb_private::BreakpointResolverFileLine::m_location_spec, and m_resolver_sp.

Referenced by CommandObjectBreakpointClear::DoExecute().

◆ GetNames()

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

Definition at line 539 of file Breakpoint.h.

References m_name_list.

◆ 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 820 of file Breakpoint.cpp.

References lldb_private::BreakpointLocationList::GetNumResolvedLocations(), and m_locations.

Referenced by GetDescription(), GetStatistics(), and HasResolvedLocations().

◆ 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 reference to this breakpoint's BreakpointOptions.

Definition at line 433 of file Breakpoint.cpp.

References m_options.

Referenced by CommandObjectBreakpointModify::DoExecute(), CommandObjectBreakpointCommandList::DoExecute(), lldb_private::BreakpointLocation::GetOptionsSpecifyingKind(), and lldb_private::BreakpointLocation::IsCallbackSynchronous().

◆ 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 reference to this breakpoint's BreakpointOptions.

Definition at line 435 of file Breakpoint.cpp.

References m_options.

◆ GetPermissions() [1/2]

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

Definition at line 569 of file Breakpoint.h.

References m_permissions.

◆ GetPermissions() [2/2]

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

Definition at line 565 of file Breakpoint.h.

References m_permissions.

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

◆ GetPrecondition()

lldb::BreakpointPreconditionSP lldb_private::Breakpoint::GetPrecondition ( )
inline

Definition at line 562 of file Breakpoint.h.

References m_precondition_sp.

◆ GetQueueName()

const char * Breakpoint::GetQueueName ( ) const

◆ GetResolver()

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

Definition at line 522 of file Breakpoint.h.

References m_resolver_sp.

◆ GetResolverDescription()

void Breakpoint::GetResolverDescription ( Stream s)

Definition at line 938 of file Breakpoint.cpp.

References m_resolver_sp.

Referenced by GetDescription().

◆ GetResolveTime()

StatsDuration::Duration lldb_private::Breakpoint::GetResolveTime ( ) const
inline

Get the time it took to resolve all locations in this breakpoint.

Definition at line 592 of file Breakpoint.h.

References m_resolve_time.

Referenced by lldb_private::TargetStats::ToJSON().

◆ GetSearchFilter()

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

Definition at line 524 of file Breakpoint.h.

References m_filter_sp.

◆ GetSerializationKey()

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

◆ GetStatistics()

json::Value Breakpoint::GetStatistics ( )

◆ GetTarget() [1/2]

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

◆ GetTarget() [2/2]

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

Definition at line 465 of file Breakpoint.h.

References m_target.

◆ GetTargetSP()

const lldb::TargetSP Breakpoint::GetTargetSP ( )

Definition at line 245 of file Breakpoint.cpp.

References m_target.

◆ 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 344 of file Breakpoint.cpp.

References lldb_private::BreakpointOptions::GetThreadSpecNoCreate(), lldb_private::ThreadSpec::GetTID(), LLDB_INVALID_THREAD_ID, and m_options.

◆ GetThreadIndex()

uint32_t Breakpoint::GetThreadIndex ( ) const

◆ GetThreadName()

const char * Breakpoint::GetThreadName ( ) const

◆ HasResolvedLocations()

bool Breakpoint::HasResolvedLocations ( ) const

◆ 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 428 of file Breakpoint.cpp.

References lldb_private::Stoppoint::GetID(), lldb_private::BreakpointOptions::InvokeCallback(), and m_options.

Referenced by lldb_private::BreakpointLocation::InvokeCallback().

◆ IsAutoContinue()

bool Breakpoint::IsAutoContinue ( ) const

Check the AutoContinue state.

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

Definition at line 330 of file Breakpoint.cpp.

References lldb_private::BreakpointOptions::IsAutoContinue(), and m_options.

Referenced by lldb_private::BreakpointLocation::IsAutoContinue().

◆ 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 299 of file Breakpoint.cpp.

References lldb_private::BreakpointOptions::IsEnabled(), and m_options.

Referenced by lldb_private::BreakpointLocation::Dump(), and lldb_private::BreakpointLocation::IsEnabled().

◆ 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 326 of file Breakpoint.cpp.

References lldb_private::BreakpointOptions::IsOneShot(), and m_options.

Referenced by lldb_private::StopInfoBreakpoint::StoreBPInfo().

◆ MatchesName()

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

Definition at line 535 of file Breakpoint.h.

References m_name_list.

◆ ModuleReplaced()

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

◆ ModulesChanged()

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

◆ operator=()

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

◆ 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 273 of file Breakpoint.cpp.

References m_locations, and lldb_private::BreakpointLocationList::RemoveInvalidLocations().

◆ RemoveName()

void lldb_private::Breakpoint::RemoveName ( const char *  name_to_remove)
inlineprivate

Definition at line 529 of file Breakpoint.h.

References m_name_list.

◆ ResetHitCount()

void Breakpoint::ResetHitCount ( )

Resets the current hit count for all locations.

Definition at line 321 of file Breakpoint.cpp.

References m_hit_counter, m_locations, lldb_private::StoppointHitCounter::Reset(), and lldb_private::BreakpointLocationList::ResetHitCount().

◆ 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 437 of file Breakpoint.cpp.

References elapsed(), m_filter_sp, m_resolve_time, and m_resolver_sp.

◆ 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 454 of file Breakpoint.cpp.

References elapsed(), IsInternal(), m_filter_sp, m_resolve_time, m_resolver_sp, ResolveBreakpointInModules(), and SendBreakpointChangedEvent().

Referenced by ModuleReplaced(), ModulesChanged(), and ResolveBreakpointInModules().

◆ 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]module_listThe list of modules to look in for new locations.
[in]new_locationsFills new_locations with the new locations that were made.

Definition at line 444 of file Breakpoint.cpp.

References elapsed(), m_filter_sp, m_locations, m_resolve_time, m_resolver_sp, lldb_private::BreakpointLocationList::StartRecordingNewLocations(), and lldb_private::BreakpointLocationList::StopRecordingNewLocations().

◆ SendBreakpointChangedEvent() [1/2]

void Breakpoint::SendBreakpointChangedEvent ( const lldb::EventDataSP breakpoint_data_sp)
private

◆ SendBreakpointChangedEvent() [2/2]

void Breakpoint::SendBreakpointChangedEvent ( lldb::BreakpointEventType  eventKind)
private

◆ SerializedBreakpointMatchesNames()

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

◆ SerializeToStructuredData()

StructuredData::ObjectSP Breakpoint::SerializeToStructuredData ( )
virtual

◆ SetAutoContinue()

void Breakpoint::SetAutoContinue ( bool  auto_continue)

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

Definition at line 332 of file Breakpoint.cpp.

References m_options, and lldb_private::BreakpointOptions::SetAutoContinue().

◆ SetBreakpointKind()

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

◆ SetCallback() [1/2]

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

Definition at line 420 of file Breakpoint.cpp.

References m_options, and lldb_private::BreakpointOptions::SetCallback().

◆ SetCallback() [2/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 while the stop event is being pulled off the event queue. Note: synchronous callbacks cannot cause the target to run, in particular, they should not try to run the expression evaluator.

Definition at line 408 of file Breakpoint.cpp.

References m_options, SendBreakpointChangedEvent(), and lldb_private::BreakpointOptions::SetCallback().

Referenced by lldb_private::InstrumentationRuntimeASan::Activate(), InstrumentationRuntimeASanLibsanitizers::Activate(), lldb_private::InstrumentationRuntimeMainThreadChecker::Activate(), lldb_private::InstrumentationRuntimeTSan::Activate(), lldb_private::InstrumentationRuntimeUBSan::Activate(), DynamicLoaderPOSIXDYLD::ProbeEntry(), JITLoaderGDB::SetJITBreakpoint(), DynamicLoaderMacOS::SetNotificationBreakpoint(), DynamicLoaderMacOSXDYLD::SetNotificationBreakpoint(), DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded(), and DynamicLoaderHexagonDYLD::SetRendezvousBreakpoint().

◆ 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 398 of file Breakpoint.cpp.

References m_options, SendBreakpointChangedEvent(), and lldb_private::BreakpointOptions::SetCondition().

◆ 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 301 of file Breakpoint.cpp.

References lldb_private::BreakpointOptions::GetIgnoreCount(), m_options, SendBreakpointChangedEvent(), and lldb_private::BreakpointOptions::SetIgnoreCount().

Referenced by CommandObjectProcessContinue::DoExecute().

◆ SetOneShot()

void Breakpoint::SetOneShot ( bool  one_shot)

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

Definition at line 328 of file Breakpoint.cpp.

References m_options, and lldb_private::BreakpointOptions::SetOneShot().

Referenced by DynamicLoaderPOSIXDYLD::ProbeEntry().

◆ SetPrecondition()

void lldb_private::Breakpoint::SetPrecondition ( lldb::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 556 of file Breakpoint.h.

References m_precondition_sp.

◆ SetQueueName()

void Breakpoint::SetQueueName ( const char *  queue_name)

◆ SetThreadID()

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

◆ SetThreadIndex()

void Breakpoint::SetThreadIndex ( uint32_t  index)

◆ SetThreadName()

void Breakpoint::SetThreadName ( const char *  thread_name)

Friends And Related Function Documentation

◆ BreakpointLocation

friend class BreakpointLocation
friend

Definition at line 630 of file Breakpoint.h.

◆ Target

friend class Target
friend

Definition at line 595 of file Breakpoint.h.

Member Data Documentation

◆ g_option_names

const char * Breakpoint::g_option_names {"Names", "Hardware"}
staticprivate

Definition at line 94 of file Breakpoint.h.

Referenced by GetKey().

◆ m_filter_sp

lldb::SearchFilterSP lldb_private::Breakpoint::m_filter_sp
private

◆ m_hardware

bool lldb_private::Breakpoint::m_hardware
private

Definition at line 641 of file Breakpoint.h.

Referenced by IsHardware(), and SerializeToStructuredData().

◆ m_hit_counter

StoppointHitCounter lldb_private::Breakpoint::m_hit_counter
private

Number of times this breakpoint has been hit.

This is kept separately from the locations hit counts, since locations can go away when their backing library gets unloaded, and we would lose hit counts.

Definition at line 666 of file Breakpoint.h.

Referenced by lldb_private::BreakpointLocation::BumpHitCount(), GetHitCount(), ResetHitCount(), and lldb_private::BreakpointLocation::UndoBumpHitCount().

◆ m_kind_description

std::string lldb_private::Breakpoint::m_kind_description
private

Definition at line 660 of file Breakpoint.h.

Referenced by GetBreakpointKind(), GetDescription(), GetStatistics(), and SetBreakpointKind().

◆ m_locations

BreakpointLocationList lldb_private::Breakpoint::m_locations
private

◆ m_name_list

std::unordered_set<std::string> lldb_private::Breakpoint::m_name_list
private

◆ m_options

BreakpointOptions lldb_private::Breakpoint::m_options
private

◆ m_permissions

BreakpointName::Permissions lldb_private::Breakpoint::m_permissions
private

Definition at line 668 of file Breakpoint.h.

Referenced by GetPermissions().

◆ m_precondition_sp

lldb::BreakpointPreconditionSP lldb_private::Breakpoint::m_precondition_sp
private

◆ m_resolve_indirect_symbols

bool lldb_private::Breakpoint::m_resolve_indirect_symbols
private

Definition at line 661 of file Breakpoint.h.

Referenced by AddLocation().

◆ m_resolve_time

StatsDuration lldb_private::Breakpoint::m_resolve_time
private

◆ m_resolver_sp

lldb::BreakpointResolverSP lldb_private::Breakpoint::m_resolver_sp
private

◆ m_target

Target& lldb_private::Breakpoint::m_target
private

Definition at line 642 of file Breakpoint.h.

Referenced by GetTarget(), and GetTargetSP().


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