LLDB mainline
|
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>
Public Member Functions | |
~BreakpointLocation () | |
lldb::addr_t | GetLoadAddress () const |
Gets the load address for this breakpoint location. | |
Address & | GetAddress () |
Gets the Address for this breakpoint location. | |
Breakpoint & | GetBreakpoint () |
Gets the Breakpoint that created this breakpoint location. | |
Target & | GetTarget () |
lldb::BreakpointLocationSP | WasHit (StoppointCallbackContext *context) |
This is a programmatic version of a breakpoint "condition". | |
bool | ShouldStop (StoppointCallbackContext *context, lldb::BreakpointLocationSP &facade_loc_sp) |
Determines whether we should stop due to a hit at this breakpoint location. | |
llvm::Error | SetEnabled (bool enabled) |
If enabled is true, enable the breakpoint, if false disable it. | |
bool | IsEnabled () const |
Check the Enable/Disable state. | |
void | SetAutoContinue (bool auto_continue) |
If auto_continue is true, set the breakpoint to continue when hit. | |
bool | IsAutoContinue () const |
Check the AutoContinue state. | |
uint32_t | GetHitCount () const |
Return the current Hit Count. | |
void | ResetHitCount () |
Resets the current Hit Count. | |
uint32_t | GetIgnoreCount () const |
Return the current Ignore Count. | |
void | SetIgnoreCount (uint32_t n) |
Set the breakpoint to ignore the next count breakpoint hits. | |
void | SetCallback (BreakpointHitCallback callback, const lldb::BatonSP &callback_baton_sp, bool is_synchronous) |
Set the callback action invoked when the breakpoint is hit. | |
void | SetCallback (BreakpointHitCallback callback, void *baton, bool is_synchronous) |
void | ClearCallback () |
void | SetCondition (StopCondition condition) |
Set the breakpoint location's condition. | |
const StopCondition & | GetCondition () const |
Return the breakpoint condition. | |
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. | |
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 |
llvm::Error | ResolveBreakpointSite () |
Try to resolve the breakpoint site for this location. | |
llvm::Error | ClearBreakpointSite () |
Clear this breakpoint location's breakpoint site - for instance when disabling the breakpoint. | |
bool | IsResolved () const |
Return whether this breakpoint location has a breakpoint site. | |
lldb::BreakpointSiteSP | GetBreakpointSite () const |
void | GetDescription (Stream *s, lldb::DescriptionLevel level) |
Print a description of this breakpoint location to the stream s. | |
void | Dump (Stream *s) const |
Standard "Dump" method. At present it does nothing. | |
BreakpointOptions & | GetLocationOptions () |
Use this to set location specific breakpoint options. | |
const BreakpointOptions & | GetOptionsSpecifyingKind (BreakpointOptions::OptionKind kind) const |
Use this to access breakpoint options from this breakpoint location. | |
bool | ValidForThisThread (Thread &thread) |
bool | InvokeCallback (StoppointCallbackContext *context) |
Invoke the callback action when the breakpoint is hit. | |
bool | IsCallbackSynchronous () |
Report whether the callback for this location is synchronous or not. | |
bool | ShouldResolveIndirectFunctions () |
Returns whether we should resolve Indirect functions in setting the breakpoint site for this location. | |
bool | IsIndirect () |
Returns whether the address set in the breakpoint site for this location was found by resolving an indirect symbol. | |
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. | |
void | SetIsReExported (bool is_reexported) |
bool | EquivalentToLocation (BreakpointLocation &location) |
Returns whether the two breakpoint locations might represent "equivalent
locations". | |
lldb::break_id_t | GetID () const |
Returns the breakpoint location ID. | |
bool | SetPreferredLineEntry (const LineEntry &line_entry) |
Set the line entry that should be shown to users for this location. | |
const std::optional< LineEntry > | GetPreferredLineEntry () |
BreakpointLocation (lldb::break_id_t loc_id, Breakpoint &owner) | |
This is the constructor for locations with no address. | |
bool | IsValid () const |
bool | IsFacade () const |
Protected Member Functions | |
bool | SetBreakpointSite (lldb::BreakpointSiteSP &bp_site_sp) |
Set the breakpoint site for this location to bp_site_sp. | |
void | DecrementIgnoreCount () |
bool | IgnoreCountShouldStop () |
BreakpointLocation::IgnoreCountShouldStop can only be called once per stop. | |
std::optional< uint32_t > | GetSuggestedStackFrameIndex () |
If this location knows that the virtual stack frame it represents is not frame 0, return the suggested stack frame instead. |
Private Member Functions | |
void | SwapLocation (lldb::BreakpointLocationSP swap_from) |
void | BumpHitCount () |
void | UndoBumpHitCount () |
void | SetThreadIDInternal (lldb::tid_t thread_id) |
Updates the thread ID internally. | |
BreakpointLocation (lldb::break_id_t loc_id, Breakpoint &owner, const Address &addr, lldb::tid_t tid, bool check_for_resolver=true) | |
Constructor. | |
void | SetInvalid () |
void | SetShouldResolveIndirectFunctions (bool do_resolve) |
void | SendBreakpointLocationChangedEvent (lldb::BreakpointEventType eventKind) |
BreakpointLocation (const BreakpointLocation &)=delete | |
const BreakpointLocation & | operator= (const BreakpointLocation &)=delete |
Private Attributes | |
bool | m_should_resolve_indirect_functions |
bool | m_is_reexported |
bool | m_is_indirect |
The address defining this location. | |
Address | m_address |
The breakpoint that produced this object. | |
Breakpoint & | m_owner |
Breakpoint options pointer, nullptr if we're using our breakpoint's options. | |
std::unique_ptr< BreakpointOptions > | m_options_up |
Our breakpoint site (it may be shared by more than one location.) | |
lldb::BreakpointSiteSP | m_bp_site_sp |
The compiled expression to use in testing our condition. | |
lldb::UserExpressionSP | m_user_expression_sp |
Guards parsing and evaluation of the condition, which could be evaluated by multiple processes. | |
std::mutex | m_condition_mutex |
For testing whether the condition source code changed. | |
size_t | m_condition_hash |
Breakpoint location ID. | |
lldb::break_id_t | m_loc_id |
Number of times this breakpoint location has been hit. | |
StoppointHitCounter | m_hit_counter |
std::optional< LineEntry > | m_preferred_line_entry |
If this exists, use it to print the stop description rather than the LineEntry m_address resolves to directly. | |
bool | m_is_valid = true |
Because Facade locations don't have sites we can't use the presence of the site to mean this breakpoint is valid, but must manage the state directly. | |
bool | m_is_facade = false |
Facade locations aren't directly triggered and don't have a breakpoint site. |
Friends | |
class | BreakpointSite |
class | BreakpointLocationList |
class | Breakpoint |
class | Process |
class | StopInfoBreakpoint |
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 39 of file BreakpointLocation.h.
BreakpointLocation::~BreakpointLocation | ( | ) |
Definition at line 57 of file BreakpointLocation.cpp.
References ClearBreakpointSite().
|
private |
Constructor.
[in] | loc_id | The location id of the new location. |
[in] | owner | A back pointer to the breakpoint that owns this location. |
[in] | addr | The Address defining this location. |
[in] | tid | The thread for which this breakpoint location is valid, or LLDB_INVALID_THREAD_ID if it is valid for all threads. |
References Breakpoint.
Referenced by BreakpointLocation(), EquivalentToLocation(), and operator=().
lldb_private::BreakpointLocation::BreakpointLocation | ( | lldb::break_id_t | loc_id, |
Breakpoint & | owner ) |
This is the constructor for locations with no address.
Currently this is just used for Facade locations.
[in] | loc_id | The location id of the new location. |
[in] | owner | A back pointer to the breakpoint that owns this location. |
References Breakpoint.
|
privatedelete |
References BreakpointLocation().
|
private |
Definition at line 469 of file BreakpointLocation.cpp.
References IsEnabled(), m_hit_counter, and m_owner.
llvm::Error BreakpointLocation::ClearBreakpointSite | ( | ) |
Clear this breakpoint location's breakpoint site - for instance when disabling the breakpoint.
Definition at line 527 of file BreakpointLocation.cpp.
References GetBreakpoint(), GetID(), IsFacade(), m_bp_site_sp, and m_owner.
Referenced by SetEnabled(), and ~BreakpointLocation().
void BreakpointLocation::ClearCallback | ( | ) |
Definition at line 211 of file BreakpointLocation.cpp.
References lldb_private::BreakpointOptions::ClearCallback(), and GetLocationOptions().
bool BreakpointLocation::ConditionSaysStop | ( | ExecutionContext & | exe_ctx, |
Status & | error ) |
Definition at line 224 of file BreakpointLocation.cpp.
References lldb_private::Breakpoints, lldb_private::DiagnosticManager::Clear(), lldb_private::eExecutionPolicyOnlyWhenNeeded, lldb::eExpressionCompleted, lldb::eExpressionParseError, lldb::eLanguageTypeUnknown, lldb_private::Expression::eResultTypeAny, error(), lldb_private::Status::FromError(), lldb_private::Status::FromErrorString(), lldb_private::DiagnosticManager::GetAsError(), GetCondition(), lldb_private::StopCondition::GetHash(), lldb_private::StopCondition::GetLanguage(), lldb_private::GetLog(), GetTarget(), lldb_private::StopCondition::GetText(), LLDB_LOGF, m_address, m_condition_hash, m_condition_mutex, m_user_expression_sp, lldb_private::EvaluateExpressionOptions::SetIgnoreBreakpoints(), lldb_private::EvaluateExpressionOptions::SetSuppressPersistentResult(), lldb_private::EvaluateExpressionOptions::SetTryAllThreads(), and lldb_private::EvaluateExpressionOptions::SetUnwindOnError().
|
protected |
Definition at line 345 of file BreakpointLocation.cpp.
References m_options_up.
Referenced by IgnoreCountShouldStop().
void BreakpointLocation::Dump | ( | Stream * | s | ) | const |
Standard "Dump" method. At present it does nothing.
Definition at line 727 of file BreakpointLocation.cpp.
References lldb_private::BreakpointOptions::eIgnoreCount, lldb_private::BreakpointOptions::eThreadSpec, GetHitCount(), GetID(), GetIgnoreCount(), GetOptionsSpecifyingKind(), lldb_private::BreakpointOptions::GetThreadSpecNoCreate(), lldb_private::ThreadSpec::GetTID(), IsResolved(), m_address, m_bp_site_sp, m_options_up, m_owner, and lldb_private::Stream::Printf().
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.
[in] | location | The location to compare against. |
References BreakpointLocation().
Address & BreakpointLocation::GetAddress | ( | ) |
Gets the Address for this breakpoint location.
Definition at line 72 of file BreakpointLocation.cpp.
References m_address.
Referenced by lldb_private::BreakpointLocationList::RemoveInvalidLocations().
Breakpoint & BreakpointLocation::GetBreakpoint | ( | ) |
Gets the Breakpoint that created this breakpoint location.
Definition at line 74 of file BreakpointLocation.cpp.
References Breakpoint, and m_owner.
Referenced by ClearBreakpointSite(), GetDescription(), IgnoreCountShouldStop(), and WasHit().
lldb::BreakpointSiteSP BreakpointLocation::GetBreakpointSite | ( | ) | const |
Definition at line 492 of file BreakpointLocation.cpp.
References m_bp_site_sp.
const StopCondition & BreakpointLocation::GetCondition | ( | ) | const |
Return the breakpoint condition.
Definition at line 220 of file BreakpointLocation.cpp.
References lldb_private::BreakpointOptions::eCondition, lldb_private::BreakpointOptions::GetCondition(), and GetOptionsSpecifyingKind().
Referenced by ConditionSaysStop().
void BreakpointLocation::GetDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level ) |
Print a description of this breakpoint location to the stream s.
[in] | s | The stream to which to print the description. |
[in] | level | The description level that indicates the detail level to provide. |
Definition at line 548 of file BreakpointLocation.cpp.
References lldb_private::ConstString::AsCString(), lldb_private::Stream::AsRawOstream(), lldb_private::Address::CalculateSymbolContextSymbol(), lldb_private::SymbolContext::comp_unit, lldb_private::ConstString::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, GetBreakpoint(), lldb_private::BreakpointID::GetCanonicalReference(), lldb_private::ConstString::GetCString(), lldb_private::FileSpec::GetFilename(), GetHitCount(), GetID(), lldb_private::BreakpointResolverScripted::GetLocationDescription(), lldb_private::Function::GetMangled(), lldb_private::Mangled::GetMangledName(), lldb_private::Function::GetName(), lldb_private::Symbol::GetName(), GetPreferredLineEntry(), lldb_private::CompileUnit::GetPrimaryFile(), lldb_private::Target::GetProcessSP(), lldb_private::Breakpoint::GetResolver(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), IsIndirect(), IsReExported(), IsResolved(), lldb_private::LineEntry::line, lldb_private::SymbolContext::line_entry, m_address, m_bp_site_sp, m_options_up, m_owner, 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::GetDescriptionForType(), and ShouldStop().
|
inline |
Return the current Hit Count.
Definition at line 119 of file BreakpointLocation.h.
References m_hit_counter.
Referenced by Dump(), and GetDescription().
|
inline |
Returns the breakpoint location ID.
Definition at line 302 of file BreakpointLocation.h.
References m_loc_id.
Referenced by ClearBreakpointSite(), Dump(), lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), GetDescription(), and InvokeCallback().
uint32_t BreakpointLocation::GetIgnoreCount | ( | ) | const |
Return the current Ignore Count.
Definition at line 335 of file BreakpointLocation.cpp.
References lldb_private::BreakpointOptions::eIgnoreCount, lldb_private::BreakpointOptions::GetIgnoreCount(), and GetOptionsSpecifyingKind().
Referenced by Dump().
lldb::addr_t BreakpointLocation::GetLoadAddress | ( | ) | const |
Gets the load address for this breakpoint location.
Definition at line 61 of file BreakpointLocation.cpp.
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
Definition at line 368 of file BreakpointLocation.cpp.
References m_options_up.
Referenced by ClearCallback(), CommandObjectBreakpointModify::DoExecute(), SetAutoContinue(), SetCallback(), SetCallback(), SetCondition(), SetEnabled(), SetIgnoreCount(), SetQueueName(), SetThreadIDInternal(), SetThreadIndex(), and SetThreadName().
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.
[in] | kind | The particular option you are looking up. |
Definition at line 65 of file BreakpointLocation.cpp.
References m_options_up, and m_owner.
Referenced by Dump(), GetCondition(), GetIgnoreCount(), GetQueueName(), GetThreadID(), GetThreadIndex(), GetThreadName(), and ValidForThisThread().
|
inline |
Definition at line 319 of file BreakpointLocation.h.
References m_preferred_line_entry.
Referenced by GetDescription(), and GetSuggestedStackFrameIndex().
const char * BreakpointLocation::GetQueueName | ( | ) | const |
Definition at line 174 of file BreakpointLocation.cpp.
References lldb_private::BreakpointOptions::eThreadSpec, GetOptionsSpecifyingKind(), lldb_private::ThreadSpec::GetQueueName(), and lldb_private::BreakpointOptions::GetThreadSpecNoCreate().
|
protected |
If this location knows that the virtual stack frame it represents is not frame 0, return the suggested stack frame instead.
This will happen when the location's address contains a "virtual inlined call stack" and the breakpoint was set on a file & line that are not at the bottom of that stack. For now we key off the "preferred line entry" - looking for that in the blocks that start with the stop PC. This version of the API doesn't take an "inlined" parameter because it only changes frames in the inline stack.
Definition at line 762 of file BreakpointLocation.cpp.
References lldb_private::SymbolContext::block, lldb_private::LineEntry::column, lldb_private::LineEntry::Compare(), lldb_private::InlineFunctionInfo::GetCallSite(), lldb_private::Block::GetContainingInlinedBlock(), lldb_private::FunctionInfo::GetDeclaration(), lldb_private::LineEntry::GetFile(), lldb_private::Block::GetInlinedFunctionInfo(), lldb_private::Block::GetInlinedParent(), GetPreferredLineEntry(), lldb_private::Block::GetStartAddress(), lldb_private::LineEntry::line, lldb_private::SymbolContext::line_entry, and m_address.
Target & BreakpointLocation::GetTarget | ( | ) |
Definition at line 76 of file BreakpointLocation.cpp.
References m_owner.
Referenced by ConditionSaysStop().
lldb::tid_t BreakpointLocation::GetThreadID | ( | ) |
Definition at line 111 of file BreakpointLocation.cpp.
References lldb_private::BreakpointOptions::eThreadSpec, GetOptionsSpecifyingKind(), lldb_private::BreakpointOptions::GetThreadSpecNoCreate(), lldb_private::ThreadSpec::GetTID(), and LLDB_INVALID_THREAD_ID.
uint32_t BreakpointLocation::GetThreadIndex | ( | ) | const |
Definition at line 132 of file BreakpointLocation.cpp.
References lldb_private::BreakpointOptions::eThreadSpec, lldb_private::ThreadSpec::GetIndex(), GetOptionsSpecifyingKind(), and lldb_private::BreakpointOptions::GetThreadSpecNoCreate().
const char * BreakpointLocation::GetThreadName | ( | ) | const |
Definition at line 153 of file BreakpointLocation.cpp.
References lldb_private::BreakpointOptions::eThreadSpec, lldb_private::ThreadSpec::GetName(), GetOptionsSpecifyingKind(), and lldb_private::BreakpointOptions::GetThreadSpecNoCreate().
|
protected |
BreakpointLocation::IgnoreCountShouldStop can only be called once per stop.
This method checks first against the loc and then the owner. It also takes care of decrementing the ignore counters. If it returns false we should continue, otherwise stop.
Definition at line 353 of file BreakpointLocation.cpp.
References DecrementIgnoreCount(), GetBreakpoint(), lldb_private::Breakpoint::GetIgnoreCount(), m_options_up, and m_owner.
bool BreakpointLocation::InvokeCallback | ( | StoppointCallbackContext * | context | ) |
Invoke the callback action when the breakpoint is hit.
Meant to be used by the BreakpointLocation class.
[in] | context | Described the breakpoint event. |
Definition at line 183 of file BreakpointLocation.cpp.
References GetID(), m_options_up, and m_owner.
Referenced by ShouldStop().
bool BreakpointLocation::IsAutoContinue | ( | ) | const |
Check the AutoContinue state.
Definition at line 94 of file BreakpointLocation.cpp.
References lldb_private::BreakpointOptions::eAutoContinue, m_options_up, and m_owner.
bool BreakpointLocation::IsCallbackSynchronous | ( | ) |
Report whether the callback for this location is synchronous or not.
Definition at line 189 of file BreakpointLocation.cpp.
References m_options_up, and m_owner.
bool BreakpointLocation::IsEnabled | ( | ) | const |
Check the Enable/Disable state.
Definition at line 78 of file BreakpointLocation.cpp.
References m_options_up, and m_owner.
Referenced by BumpHitCount(), ShouldStop(), and UndoBumpHitCount().
|
inline |
Definition at line 405 of file BreakpointLocation.h.
References m_is_facade.
Referenced by ClearBreakpointSite(), IsResolved(), and ResolveBreakpointSite().
|
inline |
Returns whether the address set in the breakpoint site for this location was found by resolving an indirect symbol.
Definition at line 277 of file BreakpointLocation.h.
References m_is_indirect.
Referenced by GetDescription().
|
inline |
Returns whether the address set in the breakpoint location was re-routed to the target of a re-exported symbol.
Definition at line 286 of file BreakpointLocation.h.
References m_is_reexported.
Referenced by GetDescription().
bool BreakpointLocation::IsResolved | ( | ) | const |
Return whether this breakpoint location has a breakpoint site.
Definition at line 485 of file BreakpointLocation.cpp.
References IsFacade(), and m_bp_site_sp.
Referenced by Dump(), GetDescription(), and ResolveBreakpointSite().
|
inline |
Definition at line 404 of file BreakpointLocation.h.
References m_is_valid.
|
privatedelete |
References BreakpointLocation().
|
inline |
Resets the current Hit Count.
Definition at line 122 of file BreakpointLocation.h.
References m_hit_counter.
llvm::Error BreakpointLocation::ResolveBreakpointSite | ( | ) |
Try to resolve the breakpoint site for this location.
Definition at line 496 of file BreakpointLocation.cpp.
References lldb_private::Process::CreateBreakpointSite(), IsFacade(), IsResolved(), LLDB_INVALID_BREAK_ID, m_address, m_bp_site_sp, m_owner, and Process.
Referenced by SetEnabled().
|
private |
Definition at line 750 of file BreakpointLocation.cpp.
References lldb_private::Target::eBroadcastBitBreakpointChanged, and m_owner.
Referenced by SetAutoContinue(), SetBreakpointSite(), SetCallback(), SetCallback(), SetCondition(), SetEnabled(), SetIgnoreCount(), SetQueueName(), SetThreadID(), SetThreadIndex(), and SetThreadName().
void BreakpointLocation::SetAutoContinue | ( | bool | auto_continue | ) |
If auto_continue is true, set the breakpoint to continue when hit.
Definition at line 101 of file BreakpointLocation.cpp.
References GetLocationOptions(), SendBreakpointLocationChangedEvent(), and lldb_private::BreakpointOptions::SetAutoContinue().
|
protected |
Set the breakpoint site for this location to bp_site_sp.
[in] | bp_site_sp | The breakpoint site we are setting for this location. |
Definition at line 521 of file BreakpointLocation.cpp.
References m_bp_site_sp, and SendBreakpointLocationChangedEvent().
void 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.
[in] | callback | The method that will get called when the breakpoint is hit. |
[in] | callback_baton_sp | A shared pointer to a Baton that provides the void * needed for the callback. |
Definition at line 204 of file BreakpointLocation.cpp.
References GetLocationOptions(), SendBreakpointLocationChangedEvent(), and lldb_private::BreakpointOptions::SetCallback().
void BreakpointLocation::SetCallback | ( | BreakpointHitCallback | callback, |
void * | baton, | ||
bool | is_synchronous ) |
Definition at line 195 of file BreakpointLocation.cpp.
References GetLocationOptions(), SendBreakpointLocationChangedEvent(), and lldb_private::BreakpointOptions::SetCallback().
void BreakpointLocation::SetCondition | ( | StopCondition | condition | ) |
Set the breakpoint location's condition.
[in] | condition | The condition to evaluate when the breakpoint is hit. |
Definition at line 215 of file BreakpointLocation.cpp.
References GetLocationOptions(), SendBreakpointLocationChangedEvent(), and lldb_private::BreakpointOptions::SetCondition().
llvm::Error BreakpointLocation::SetEnabled | ( | bool | enabled | ) |
If enabled is true, enable the breakpoint, if false disable it.
Definition at line 86 of file BreakpointLocation.cpp.
References ClearBreakpointSite(), error(), GetLocationOptions(), ResolveBreakpointSite(), SendBreakpointLocationChangedEvent(), and lldb_private::BreakpointOptions::SetEnabled().
Referenced by CommandObjectBreakpointDelete::DoExecute(), and CommandObjectBreakpointEnable::DoExecute().
void BreakpointLocation::SetIgnoreCount | ( | uint32_t | n | ) |
Set the breakpoint to ignore the next count breakpoint hits.
[in] | n | The number of breakpoint hits to ignore. |
Definition at line 340 of file BreakpointLocation.cpp.
References GetLocationOptions(), SendBreakpointLocationChangedEvent(), and lldb_private::BreakpointOptions::SetIgnoreCount().
|
inlineprivate |
Definition at line 446 of file BreakpointLocation.h.
References m_is_valid.
|
inline |
Definition at line 279 of file BreakpointLocation.h.
References m_is_indirect.
|
inline |
Definition at line 288 of file BreakpointLocation.h.
References m_is_reexported.
Set the line entry that should be shown to users for this location.
It is up to the caller to verify that this is a valid entry to show. The current use of this is to distinguish among line entries from a virtual inlined call stack that all share the same address. The line entry must have the same start address as the address for this location.
Definition at line 310 of file BreakpointLocation.h.
References lldb_private::AddressRange::GetBaseAddress(), m_address, m_preferred_line_entry, and lldb_private::LineEntry::range.
void BreakpointLocation::SetQueueName | ( | const char * | queue_name | ) |
Definition at line 162 of file BreakpointLocation.cpp.
References GetLocationOptions(), lldb_private::BreakpointOptions::GetThreadSpec(), m_options_up, SendBreakpointLocationChangedEvent(), and lldb_private::ThreadSpec::SetQueueName().
|
inlineprivate |
Definition at line 448 of file BreakpointLocation.h.
References m_should_resolve_indirect_functions.
void BreakpointLocation::SetThreadID | ( | lldb::tid_t | thread_id | ) |
Set the valid thread to be checked when the breakpoint is hit.
[in] | thread_id | If this thread hits the breakpoint, we stop, otherwise not. |
Definition at line 106 of file BreakpointLocation.cpp.
References SendBreakpointLocationChangedEvent(), and SetThreadIDInternal().
|
private |
Updates the thread ID internally.
This method was created to handle actually mutating the thread ID internally because SetThreadID broadcasts an event in addition to mutating state. The constructor calls this instead of SetThreadID to avoid the broadcast.
[in] | thread_id | The new thread ID. |
Definition at line 815 of file BreakpointLocation.cpp.
References GetLocationOptions(), LLDB_INVALID_THREAD_ID, m_options_up, and lldb_private::BreakpointOptions::SetThreadID().
Referenced by SetThreadID().
void BreakpointLocation::SetThreadIndex | ( | uint32_t | index | ) |
Definition at line 120 of file BreakpointLocation.cpp.
References GetLocationOptions(), lldb_private::BreakpointOptions::GetThreadSpec(), m_options_up, SendBreakpointLocationChangedEvent(), and lldb_private::ThreadSpec::SetIndex().
void BreakpointLocation::SetThreadName | ( | const char * | thread_name | ) |
Definition at line 141 of file BreakpointLocation.cpp.
References GetLocationOptions(), lldb_private::BreakpointOptions::GetThreadSpec(), m_options_up, SendBreakpointLocationChangedEvent(), and lldb_private::ThreadSpec::SetName().
|
inline |
Returns whether we should resolve Indirect functions in setting the breakpoint site for this location.
Definition at line 268 of file BreakpointLocation.h.
References m_should_resolve_indirect_functions.
bool BreakpointLocation::ShouldStop | ( | StoppointCallbackContext * | context, |
lldb::BreakpointLocationSP & | facade_loc_sp ) |
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.
[in] | context | The context at the stop point |
[out] | facade_loc_sp | If this stop should be attributed not to the location that was hit, but to a facade location, it will be returned in this facade_loc_sp. |
Definition at line 419 of file BreakpointLocation.cpp.
References lldb_private::Breakpoints, lldb_private::StreamString::Clear(), lldb::eDescriptionLevelVerbose, lldb_private::StreamString::GetData(), GetDescription(), lldb_private::GetLog(), InvokeCallback(), lldb_private::StoppointCallbackContext::is_synchronous, IsEnabled(), LLDB_LOGF, UndoBumpHitCount(), and WasHit().
|
private |
Definition at line 806 of file BreakpointLocation.cpp.
References m_address, m_is_indirect, m_is_reexported, m_should_resolve_indirect_functions, and m_user_expression_sp.
|
private |
Definition at line 477 of file BreakpointLocation.cpp.
References IsEnabled(), m_hit_counter, and m_owner.
Referenced by ShouldStop().
Definition at line 378 of file BreakpointLocation.cpp.
References lldb_private::BreakpointOptions::eThreadSpec, and GetOptionsSpecifyingKind().
BreakpointLocationSP BreakpointLocation::WasHit | ( | StoppointCallbackContext * | context | ) |
This is a programmatic version of a breakpoint "condition".
When a breakpoint is hit, WasHit will get called before the synchronous ShouldStop callback is run, and if it returns an empty BreakpointLocationSP, lldb will act as if that breakpoint wasn't hit.
[in] | context | The context at the stop point |
Definition at line 385 of file BreakpointLocation.cpp.
References lldb_private::StoppointCallbackContext::exe_ctx_ref, GetBreakpoint(), lldb_private::ExecutionContextRef::GetFrameSP(), lldb_private::Breakpoint::GetResolver(), and lldb_private::BreakpointResolverScripted::WasHit().
Referenced by ShouldStop().
|
friend |
Definition at line 43 of file BreakpointLocation.h.
References Breakpoint.
Referenced by Breakpoint, BreakpointLocation(), BreakpointLocation(), GetBreakpoint(), and StopInfoBreakpoint.
|
friend |
Definition at line 42 of file BreakpointLocation.h.
References BreakpointLocationList.
Referenced by BreakpointLocationList.
|
friend |
Definition at line 41 of file BreakpointLocation.h.
References BreakpointSite.
Referenced by BreakpointSite.
|
friend |
Definition at line 44 of file BreakpointLocation.h.
References Process.
Referenced by Process, and ResolveBreakpointSite().
|
friend |
Definition at line 45 of file BreakpointLocation.h.
References Breakpoint, and StopInfoBreakpoint.
Referenced by StopInfoBreakpoint.
|
private |
The breakpoint that produced this object.
Definition at line 413 of file BreakpointLocation.h.
Referenced by ConditionSaysStop(), Dump(), GetAddress(), GetDescription(), GetLoadAddress(), GetSuggestedStackFrameIndex(), ResolveBreakpointSite(), SetPreferredLineEntry(), and SwapLocation().
|
private |
The compiled expression to use in testing our condition.
Definition at line 420 of file BreakpointLocation.h.
Referenced by ClearBreakpointSite(), Dump(), GetBreakpointSite(), GetDescription(), IsResolved(), ResolveBreakpointSite(), and SetBreakpointSite().
|
private |
Breakpoint location ID.
Definition at line 427 of file BreakpointLocation.h.
Referenced by ConditionSaysStop().
|
private |
For testing whether the condition source code changed.
Definition at line 425 of file BreakpointLocation.h.
Referenced by ConditionSaysStop().
|
private |
Definition at line 431 of file BreakpointLocation.h.
Referenced by BumpHitCount(), GetHitCount(), ResetHitCount(), and UndoBumpHitCount().
|
private |
Facade locations aren't directly triggered and don't have a breakpoint site.
They are a useful fiction when you want to represent the stop location as something lldb can't naturally stop at.
Definition at line 444 of file BreakpointLocation.h.
Referenced by IsFacade().
|
private |
The address defining this location.
Definition at line 411 of file BreakpointLocation.h.
Referenced by IsIndirect(), SetIsIndirect(), and SwapLocation().
|
private |
Definition at line 410 of file BreakpointLocation.h.
Referenced by IsReExported(), SetIsReExported(), and SwapLocation().
|
private |
Because Facade locations don't have sites we can't use the presence of the site to mean this breakpoint is valid, but must manage the state directly.
Definition at line 440 of file BreakpointLocation.h.
Referenced by IsValid(), and SetInvalid().
|
private |
Number of times this breakpoint location has been hit.
Definition at line 429 of file BreakpointLocation.h.
Referenced by GetID().
|
private |
Our breakpoint site (it may be shared by more than one location.)
Definition at line 418 of file BreakpointLocation.h.
Referenced by DecrementIgnoreCount(), Dump(), GetDescription(), GetLocationOptions(), GetOptionsSpecifyingKind(), IgnoreCountShouldStop(), InvokeCallback(), IsAutoContinue(), IsCallbackSynchronous(), IsEnabled(), SetQueueName(), SetThreadIDInternal(), SetThreadIndex(), and SetThreadName().
|
private |
Breakpoint options pointer, nullptr if we're using our breakpoint's options.
Definition at line 415 of file BreakpointLocation.h.
Referenced by BumpHitCount(), ClearBreakpointSite(), Dump(), GetBreakpoint(), GetDescription(), GetLoadAddress(), GetOptionsSpecifyingKind(), GetTarget(), IgnoreCountShouldStop(), InvokeCallback(), IsAutoContinue(), IsCallbackSynchronous(), IsEnabled(), ResolveBreakpointSite(), SendBreakpointLocationChangedEvent(), and UndoBumpHitCount().
|
private |
If this exists, use it to print the stop description rather than the LineEntry m_address resolves to directly.
Use this for instance when the location was given somewhere in the virtual inlined call stack since the Address always resolves to the lowest entry in the stack.
Definition at line 436 of file BreakpointLocation.h.
Referenced by GetPreferredLineEntry(), and SetPreferredLineEntry().
|
private |
Definition at line 409 of file BreakpointLocation.h.
Referenced by SetShouldResolveIndirectFunctions(), ShouldResolveIndirectFunctions(), and SwapLocation().
|
private |
Guards parsing and evaluation of the condition, which could be evaluated by multiple processes.
Definition at line 422 of file BreakpointLocation.h.
Referenced by ConditionSaysStop(), and SwapLocation().