LLDB  mainline
Public Member Functions | Protected Member Functions | Friends | List of all members
lldb_private::BreakpointLocation Class Reference

General Outline: A breakpoint location is defined by the breakpoint that produces it, and the address that resulted in this particular instantiation. More...

#include <BreakpointLocation.h>

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

Public Member Functions

 ~BreakpointLocation () override
 
lldb::addr_t GetLoadAddress () const override
 Gets the load address for this breakpoint location. More...
 
AddressGetAddress ()
 Gets the Address for this breakpoint location. More...
 
BreakpointGetBreakpoint ()
 Gets the Breakpoint that created this breakpoint location. More...
 
TargetGetTarget ()
 
bool ShouldStop (StoppointCallbackContext *context) override
 Determines whether we should stop due to a hit at this breakpoint location. More...
 
void SetEnabled (bool enabled)
 If enable is true, enable the breakpoint, if false disable it. More...
 
bool IsEnabled () const
 Check the Enable/Disable state. More...
 
void SetAutoContinue (bool auto_continue)
 If auto_continue is true, set the breakpoint to continue when hit. More...
 
bool IsAutoContinue () const
 Check the AutoContinue state. More...
 
uint32_t GetIgnoreCount ()
 Return the current Ignore Count. More...
 
void SetIgnoreCount (uint32_t n)
 Set the breakpoint to ignore the next count breakpoint hits. More...
 
void SetCallback (BreakpointHitCallback callback, const lldb::BatonSP &callback_baton_sp, bool is_synchronous)
 Set the callback action invoked when the breakpoint is hit. More...
 
void SetCallback (BreakpointHitCallback callback, void *baton, bool is_synchronous)
 
void ClearCallback ()
 
void SetCondition (const char *condition)
 Set the breakpoint location's condition. More...
 
const char * GetConditionText (size_t *hash=nullptr) const
 Return a pointer to the text of the condition expression. More...
 
bool ConditionSaysStop (ExecutionContext &exe_ctx, Status &error)
 
void SetThreadID (lldb::tid_t thread_id)
 Set the valid thread to be checked when the breakpoint is hit. More...
 
lldb::tid_t GetThreadID ()
 
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
 
bool ResolveBreakpointSite ()
 Try to resolve the breakpoint site for this location. More...
 
bool ClearBreakpointSite ()
 Clear this breakpoint location's breakpoint site - for instance when disabling the breakpoint. More...
 
bool IsResolved () const
 Return whether this breakpoint location has a breakpoint site. More...
 
lldb::BreakpointSiteSP GetBreakpointSite () const
 
void GetDescription (Stream *s, lldb::DescriptionLevel level)
 Print a description of this breakpoint location to the stream s. More...
 
void Dump (Stream *s) const override
 Standard "Dump" method. At present it does nothing. More...
 
BreakpointOptionsGetLocationOptions ()
 Use this to set location specific breakpoint options. More...
 
const BreakpointOptionsGetOptionsSpecifyingKind (BreakpointOptions::OptionKind kind) const
 Use this to access breakpoint options from this breakpoint location. More...
 
bool ValidForThisThread (Thread *thread)
 
bool InvokeCallback (StoppointCallbackContext *context)
 Invoke the callback action when the breakpoint is hit. More...
 
bool ShouldResolveIndirectFunctions ()
 Returns whether we should resolve Indirect functions in setting the breakpoint site for this location. More...
 
bool IsIndirect ()
 Returns whether the address set in the breakpoint site for this location was found by resolving an indirect symbol. More...
 
void SetIsIndirect (bool is_indirect)
 
bool IsReExported ()
 Returns whether the address set in the breakpoint location was re-routed to the target of a re-exported symbol. More...
 
void SetIsReExported (bool is_reexported)
 
bool EquivalentToLocation (BreakpointLocation &location)
 Returns whether the two breakpoint locations might represent "equivalent locations". More...
 
- Public Member Functions inherited from lldb_private::StoppointLocation
 StoppointLocation (lldb::break_id_t bid, lldb::addr_t m_addr, bool hardware)
 
 StoppointLocation (lldb::break_id_t bid, lldb::addr_t m_addr, uint32_t byte_size, bool hardware)
 
virtual ~StoppointLocation ()
 
virtual void SetLoadAddress (lldb::addr_t addr)
 
uint32_t GetByteSize () const
 
uint32_t GetHitCount () const
 
uint32_t GetHardwareIndex () const
 
bool HardwareRequired () const
 
virtual bool IsHardware () const
 
void SetHardwareIndex (uint32_t index)
 
lldb::break_id_t GetID () const
 

Protected Member Functions

bool SetBreakpointSite (lldb::BreakpointSiteSP &bp_site_sp)
 Set the breakpoint site for this location to bp_site_sp. More...
 
void DecrementIgnoreCount ()
 
bool IgnoreCountShouldStop ()
 
- Protected Member Functions inherited from lldb_private::StoppointLocation
void IncrementHitCount ()
 
void DecrementHitCount ()
 

Friends

class BreakpointSite
 
class BreakpointLocationList
 
class Process
 
class StopInfoBreakpoint
 

Additional Inherited Members

- Protected Attributes inherited from lldb_private::StoppointLocation
lldb::break_id_t m_loc_id
 
lldb::addr_t m_addr
 
bool m_hardware
 
uint32_t m_hardware_index
 
uint32_t m_byte_size
 
uint32_t m_hit_count
 

Detailed Description

General Outline: A breakpoint location is defined by the breakpoint that produces it, and the address that resulted in this particular instantiation.

"lldb/Breakpoint/BreakpointLocation.h" Class that manages one unique (by address) instance of a logical breakpoint.

Each breakpoint location also may have a breakpoint site if its address has been loaded into the program. Finally it has a settable options object.

FIXME: Should we also store some fingerprint for the location, so we can map one location to the "equivalent location" on rerun? This would be useful if you've set options on the locations.

Definition at line 37 of file BreakpointLocation.h.

Constructor & Destructor Documentation

◆ ~BreakpointLocation()

BreakpointLocation::~BreakpointLocation ( )
override

Definition at line 50 of file BreakpointLocation.cpp.

Member Function Documentation

◆ ClearBreakpointSite()

bool BreakpointLocation::ClearBreakpointSite ( )

Clear this breakpoint location's breakpoint site - for instance when disabling the breakpoint.

Returns
true if there was a breakpoint site to be cleared, false otherwise.

Definition at line 469 of file BreakpointLocation.cpp.

◆ ClearCallback()

void BreakpointLocation::ClearCallback ( )

Definition at line 215 of file BreakpointLocation.cpp.

◆ ConditionSaysStop()

bool BreakpointLocation::ConditionSaysStop ( ExecutionContext exe_ctx,
Status error 
)

◆ DecrementIgnoreCount()

void BreakpointLocation::DecrementIgnoreCount ( )
protected

Definition at line 346 of file BreakpointLocation.cpp.

◆ Dump()

void BreakpointLocation::Dump ( Stream s) const
overridevirtual

◆ EquivalentToLocation()

bool lldb_private::BreakpointLocation::EquivalentToLocation ( BreakpointLocation location)

Returns whether the two breakpoint locations might represent "equivalent locations".

This is used when modules changed to determine if a Location in the old module might be the "same as" the input location.

Parameters
[in]locationThe location to compare against.
Returns
true or false as given in the description above.

Referenced by SetIsReExported().

◆ GetAddress()

Address & BreakpointLocation::GetAddress ( )

Gets the Address for this breakpoint location.

Returns
Returns breakpoint location Address.

Definition at line 65 of file BreakpointLocation.cpp.

Referenced by lldb_private::BreakpointLocationList::RemoveInvalidLocations().

◆ GetBreakpoint()

Breakpoint & BreakpointLocation::GetBreakpoint ( )

Gets the Breakpoint that created this breakpoint location.

Returns
Returns the owning breakpoint.

Definition at line 67 of file BreakpointLocation.cpp.

◆ GetBreakpointSite()

lldb::BreakpointSiteSP BreakpointLocation::GetBreakpointSite ( ) const

Definition at line 438 of file BreakpointLocation.cpp.

◆ GetConditionText()

const char * BreakpointLocation::GetConditionText ( size_t *  hash = nullptr) 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 224 of file BreakpointLocation.cpp.

References lldb_private::BreakpointOptions::eCondition.

◆ GetDescription()

void BreakpointLocation::GetDescription ( Stream s,
lldb::DescriptionLevel  level 
)

Print a description of this breakpoint location to the stream s.

Parameters
[in]sThe stream to which to print the description.
[in]levelThe description level that indicates the detail level to provide.
See also
lldb::DescriptionLevel

Definition at line 487 of file BreakpointLocation.cpp.

References lldb_private::ConstString::AsCString(), lldb_private::Address::CalculateSymbolContextSymbol(), lldb_private::SymbolContext::comp_unit, lldb_private::FileSpec::Dump(), lldb_private::Target::Dump(), lldb_private::LineEntry::DumpStopContext(), lldb_private::SymbolContext::DumpStopContext(), lldb_private::Address::DumpStyleFileAddress, lldb_private::Address::DumpStyleLoadAddress, lldb_private::Address::DumpStyleModuleWithFileAddress, lldb::eDescriptionLevelBrief, lldb::eDescriptionLevelFull, lldb::eDescriptionLevelInitial, lldb::eDescriptionLevelVerbose, lldb_private::Stream::EOL(), lldb_private::SymbolContext::function, lldb_private::BreakpointID::GetCanonicalReference(), lldb_private::ConstString::GetCString(), lldb_private::Symbol::GetName(), lldb_private::Function::GetName(), lldb_private::Target::GetProcessSP(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), lldb_private::LineEntry::line, lldb_private::SymbolContext::line_entry, lldb_private::SymbolContext::module_sp, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), lldb_private::Address::SetLoadAddress(), and lldb_private::SymbolContext::symbol.

Referenced by lldb_private::Breakpoint::GetDescription().

◆ GetIgnoreCount()

uint32_t BreakpointLocation::GetIgnoreCount ( )

Return the current Ignore Count.

Returns
The number of breakpoint hits to be ignored.

Definition at line 336 of file BreakpointLocation.cpp.

References lldb_private::BreakpointOptions::eIgnoreCount.

◆ GetLoadAddress()

lldb::addr_t BreakpointLocation::GetLoadAddress ( ) const
overridevirtual

Gets the load address for this breakpoint location.

Returns
Returns breakpoint location load address, LLDB_INVALID_ADDRESS if not yet set.

Reimplemented from lldb_private::StoppointLocation.

Definition at line 52 of file BreakpointLocation.cpp.

◆ GetLocationOptions()

BreakpointOptions * BreakpointLocation::GetLocationOptions ( )

Use this to set location specific breakpoint options.

It will create a copy of the containing breakpoint's options if that hasn't been done already

Returns
A pointer to the breakpoint options.

Definition at line 368 of file BreakpointLocation.cpp.

Referenced by CommandObjectBreakpointModify::DoExecute().

◆ GetOptionsSpecifyingKind()

const BreakpointOptions * BreakpointLocation::GetOptionsSpecifyingKind ( BreakpointOptions::OptionKind  kind) const

Use this to access breakpoint options from this breakpoint location.

This will return the options that have a setting for the specified BreakpointOptions kind.

Parameters
[in]kindThe particular option you are looking up.
Returns
A pointer to the containing breakpoint's options if this location doesn't have its own copy.

Definition at line 57 of file BreakpointLocation.cpp.

◆ GetQueueName()

const char * BreakpointLocation::GetQueueName ( ) const

◆ GetTarget()

Target & BreakpointLocation::GetTarget ( )

Definition at line 69 of file BreakpointLocation.cpp.

◆ GetThreadID()

lldb::tid_t BreakpointLocation::GetThreadID ( )

◆ GetThreadIndex()

uint32_t BreakpointLocation::GetThreadIndex ( ) const

◆ GetThreadName()

const char * BreakpointLocation::GetThreadName ( ) const

◆ IgnoreCountShouldStop()

bool BreakpointLocation::IgnoreCountShouldStop ( )
protected

Definition at line 354 of file BreakpointLocation.cpp.

◆ InvokeCallback()

bool BreakpointLocation::InvokeCallback ( StoppointCallbackContext context)

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 192 of file BreakpointLocation.cpp.

◆ IsAutoContinue()

bool BreakpointLocation::IsAutoContinue ( ) const

Check the AutoContinue state.

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

Definition at line 91 of file BreakpointLocation.cpp.

References lldb_private::BreakpointOptions::eAutoContinue.

◆ IsEnabled()

bool BreakpointLocation::IsEnabled ( ) const

Check the Enable/Disable state.

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

Definition at line 71 of file BreakpointLocation.cpp.

◆ IsIndirect()

bool lldb_private::BreakpointLocation::IsIndirect ( )
inline

Returns whether the address set in the breakpoint site for this location was found by resolving an indirect symbol.

Returns
true or false as given in the description above.

Definition at line 250 of file BreakpointLocation.h.

◆ IsReExported()

bool lldb_private::BreakpointLocation::IsReExported ( )
inline

Returns whether the address set in the breakpoint location was re-routed to the target of a re-exported symbol.

Returns
true or false as given in the description above.

Definition at line 259 of file BreakpointLocation.h.

◆ IsResolved()

bool BreakpointLocation::IsResolved ( ) const

Return whether this breakpoint location has a breakpoint site.

Returns
true if there was a breakpoint site for this breakpoint location, false otherwise.

Definition at line 434 of file BreakpointLocation.cpp.

◆ ResolveBreakpointSite()

bool BreakpointLocation::ResolveBreakpointSite ( )

Try to resolve the breakpoint site for this location.

Returns
true if we were successful at setting a breakpoint site, false otherwise.

Definition at line 442 of file BreakpointLocation.cpp.

References lldb_private::Process::CreateBreakpointSite(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::Target::GetProcessSP(), lldb_private::Process::GetTarget(), LIBLLDB_LOG_BREAKPOINTS, LLDB_INVALID_BREAK_ID, and lldb_private::Log::Warning().

◆ SetAutoContinue()

void BreakpointLocation::SetAutoContinue ( bool  auto_continue)

If auto_continue is true, set the breakpoint to continue when hit.

Definition at line 99 of file BreakpointLocation.cpp.

◆ SetBreakpointSite()

bool BreakpointLocation::SetBreakpointSite ( lldb::BreakpointSiteSP &  bp_site_sp)
protected

Set the breakpoint site for this location to bp_site_sp.

Parameters
[in]bp_site_spThe breakpoint site we are setting for this location.
Returns
true if we were successful at setting the breakpoint site, false otherwise.

Definition at line 463 of file BreakpointLocation.cpp.

◆ SetCallback() [1/2]

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

Set the callback action invoked when the breakpoint is hit.

The callback will return a bool indicating whether the target should stop at this breakpoint or not.

Parameters
[in]callbackThe method that will get called when the breakpoint is hit.
[in]callback_baton_spA shared pointer to a Baton that provides the void * needed for the callback.
See also
lldb_private::Baton

Referenced by SetCallback().

◆ SetCallback() [2/2]

void BreakpointLocation::SetCallback ( BreakpointHitCallback  callback,
void *  baton,
bool  is_synchronous 
)

Definition at line 199 of file BreakpointLocation.cpp.

References SetCallback().

◆ SetCondition()

void BreakpointLocation::SetCondition ( const char *  condition)

Set the breakpoint location's condition.

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

Definition at line 219 of file BreakpointLocation.cpp.

◆ SetEnabled()

void BreakpointLocation::SetEnabled ( bool  enabled)

If enable is true, enable the breakpoint, if false disable it.

Definition at line 80 of file BreakpointLocation.cpp.

Referenced by CommandObjectBreakpointEnable::DoExecute(), CommandObjectBreakpointDisable::DoExecute(), and CommandObjectBreakpointDelete::DoExecute().

◆ SetIgnoreCount()

void BreakpointLocation::SetIgnoreCount ( uint32_t  n)

Set the breakpoint to ignore the next count breakpoint hits.

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

Definition at line 341 of file BreakpointLocation.cpp.

◆ SetIsIndirect()

void lldb_private::BreakpointLocation::SetIsIndirect ( bool  is_indirect)
inline

Definition at line 252 of file BreakpointLocation.h.

◆ SetIsReExported()

void lldb_private::BreakpointLocation::SetIsReExported ( bool  is_reexported)
inline

Definition at line 261 of file BreakpointLocation.h.

References EquivalentToLocation().

◆ SetQueueName()

void BreakpointLocation::SetQueueName ( const char *  queue_name)

Definition at line 170 of file BreakpointLocation.cpp.

◆ SetThreadID()

void BreakpointLocation::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 104 of file BreakpointLocation.cpp.

References LLDB_INVALID_THREAD_ID.

◆ SetThreadIndex()

void BreakpointLocation::SetThreadIndex ( uint32_t  index)

Definition at line 126 of file BreakpointLocation.cpp.

◆ SetThreadName()

void BreakpointLocation::SetThreadName ( const char *  thread_name)

Definition at line 148 of file BreakpointLocation.cpp.

◆ ShouldResolveIndirectFunctions()

bool lldb_private::BreakpointLocation::ShouldResolveIndirectFunctions ( )
inline

Returns whether we should resolve Indirect functions in setting the breakpoint site for this location.

Returns
true if the breakpoint SITE for this location should be set on the resolved location for Indirect functions.

Definition at line 241 of file BreakpointLocation.h.

◆ ShouldStop()

bool BreakpointLocation::ShouldStop ( StoppointCallbackContext context)
overridevirtual

Determines whether we should stop due to a hit at this breakpoint location.

Side Effects: This may evaluate the breakpoint condition, and run the callback. So this command may do a considerable amount of work.

Returns
true if this breakpoint location thinks we should stop, false otherwise.

Reimplemented from lldb_private::StoppointLocation.

Definition at line 389 of file BreakpointLocation.cpp.

References lldb::eDescriptionLevelVerbose, lldb_private::StreamString::GetData(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::StoppointCallbackContext::is_synchronous, LIBLLDB_LOG_BREAKPOINTS, and lldb_private::Log::Printf().

◆ ValidForThisThread()

bool BreakpointLocation::ValidForThisThread ( Thread thread)

Friends And Related Function Documentation

◆ BreakpointLocationList

friend class BreakpointLocationList
friend

Definition at line 276 of file BreakpointLocation.h.

◆ BreakpointSite

friend class BreakpointSite
friend

Definition at line 275 of file BreakpointLocation.h.

◆ Process

friend class Process
friend

Definition at line 277 of file BreakpointLocation.h.

◆ StopInfoBreakpoint

friend class StopInfoBreakpoint
friend

Definition at line 278 of file BreakpointLocation.h.


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