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]
Collaboration diagram for lldb_private::Breakpoint:
Collaboration 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. 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 (lldb::BreakpointPreconditionSP precondition_sp)
 Set a pre-condition filter that overrides all user provided filters/callbacks etc. More...
 
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. More...
 
StatsDuration GetResolveTime () const
 Get the time it took to resolve all locations in this breakpoint. More...
 
- 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 (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. More...
 
void DecrementIgnoreCount ()
 

Private Types

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

Private Member Functions

bool 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 (BreakpointEventData *data)
 
 Breakpoint (const Breakpoint &)=delete
 
const Breakpointoperator= (const Breakpoint &)=delete
 

Static Private Member Functions

static const char * GetKey (OptionNames enum_value)
 

Private Attributes

bool m_being_created
 
bool m_hardware
 
Targetm_target
 
std::unordered_set< std::stringm_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. More...
 
BreakpointName::Permissions m_permissions
 
StatsDuration m_resolve_time {0.0}
 

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.

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.

Class that manages logical breakpoint setting.

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

◆ OptionNames

Enumerator
Names 
Hardware 
LastOptionName 

Definition at line 90 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]

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 CopyFromBreakpoint().

◆ Breakpoint() [2/3]

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

Definition at line 58 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 260 of file Breakpoint.cpp.

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

Referenced by lldb_private::lldb_renderscript::RSScriptGroupBreakpointResolver::SearchCallback().

◆ AddName()

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

Definition at line 843 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

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

References Breakpoint(), 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 829 of file Breakpoint.cpp.

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

◆ EvaluatePrecondition()

bool Breakpoint::EvaluatePrecondition ( StoppointCallbackContext context)

Definition at line 982 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 266 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 274 of file Breakpoint.cpp.

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

Referenced by CommandObjectBreakpointCommandDelete::DoExecute(), CommandObjectBreakpointCommandList::DoExecute(), CommandObjectBreakpointModify::DoExecute(), CommandObjectBreakpointEnable::DoExecute(), and CommandObjectBreakpointDelete::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 270 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 449 of file Breakpoint.h.

References m_kind_description.

Referenced by GetDescription().

◆ 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 407 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 
)

◆ GetEventIdentifier()

ConstString Breakpoint::GetEventIdentifier ( )
static

Definition at line 39 of file Breakpoint.cpp.

◆ GetFilterDescription()

void Breakpoint::GetFilterDescription ( Stream s)

Definition at line 978 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 328 of file Breakpoint.cpp.

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

Referenced by GetDescription().

◆ GetIgnoreCount()

uint32_t Breakpoint::GetIgnoreCount ( ) const

Return the current ignore count/.

Returns
The number of breakpoint hits to be ignored.

Definition at line 324 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 278 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 955 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

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

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

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

◆ GetOptions() [1/2]

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

References m_options.

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

◆ GetOptions() [2/2]

const BreakpointOptions& lldb_private::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.

◆ GetPermissions() [1/2]

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

Definition at line 561 of file Breakpoint.h.

References m_permissions.

◆ GetPermissions() [2/2]

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

Definition at line 557 of file Breakpoint.h.

References m_permissions.

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

◆ GetPrecondition()

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

Definition at line 554 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 513 of file Breakpoint.h.

References m_resolver_sp.

◆ GetResolverDescription()

void Breakpoint::GetResolverDescription ( Stream s)

Definition at line 950 of file Breakpoint.cpp.

References m_resolver_sp.

Referenced by GetDescription().

◆ GetResolveTime()

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

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

Definition at line 584 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 515 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 456 of file Breakpoint.h.

References m_target.

◆ GetTargetSP()

const lldb::TargetSP Breakpoint::GetTargetSP ( )

Definition at line 254 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 348 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 432 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 334 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 308 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 330 of file Breakpoint.cpp.

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

◆ MatchesName()

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

Definition at line 527 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 282 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 521 of file Breakpoint.h.

References m_name_list.

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

References elapsed(), lldb_private::Breakpoint::BreakpointEventData::GetBreakpointLocationCollection(), lldb_private::BreakpointLocationCollection::GetSize(), IsInternal(), m_filter_sp, m_resolve_time, m_resolver_sp, and SendBreakpointChangedEvent().

Referenced by ModuleReplaced(), and ModulesChanged().

◆ 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 448 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 ( BreakpointEventData data)
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 336 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 lldb_private::Breakpoint::SetCallback ( BreakpointHitCallback  callback,
const lldb::BatonSP &  callback_baton_sp,
bool  is_synchronous = false 
)

◆ 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 after the stop has been posted.

Definition at line 412 of file Breakpoint.cpp.

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

Referenced by lldb_private::InstrumentationRuntimeASan::Activate(), lldb_private::InstrumentationRuntimeTSan::Activate(), lldb_private::InstrumentationRuntimeMainThreadChecker::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 402 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 310 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 332 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 548 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 622 of file Breakpoint.h.

◆ Target

friend class Target
friend

Definition at line 587 of file Breakpoint.h.

Member Data Documentation

◆ g_option_names

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

Definition at line 93 of file Breakpoint.h.

Referenced by GetKey().

◆ m_being_created

bool lldb_private::Breakpoint::m_being_created
private

Definition at line 632 of file Breakpoint.h.

Referenced by SendBreakpointChangedEvent().

◆ m_filter_sp

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

◆ m_hardware

bool lldb_private::Breakpoint::m_hardware
private

Definition at line 634 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 659 of file Breakpoint.h.

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

◆ m_kind_description

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

Definition at line 653 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 661 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 654 of file Breakpoint.h.

Referenced by AddLocation().

◆ m_resolve_time

StatsDuration lldb_private::Breakpoint::m_resolve_time {0.0}
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 635 of file Breakpoint.h.

Referenced by GetTarget(), and GetTargetSP().


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