LLDB mainline
|
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"
Classes | |
class | BreakpointEventData |
Public Types | |
enum | MatchType { Exact , Regexp , Glob } |
An enum specifying the match style for breakpoint settings. More... | |
Public Member Functions | |
virtual StructuredData::ObjectSP | SerializeToStructuredData () |
~Breakpoint () override | |
Destructor. | |
bool | IsInternal () const |
Tell whether this breakpoint is an "internal" breakpoint. | |
void | Dump (Stream *s) override |
Standard "Dump" method. At present it does nothing. | |
void | ClearAllBreakpointSites () |
Tell this breakpoint to clear all its breakpoint sites. | |
void | ResolveBreakpoint () |
Tell this breakpoint to scan it's target's module list and resolve any new locations that match the breakpoint's specifications. | |
void | ResolveBreakpointInModules (ModuleList &module_list, bool send_event=true) |
Tell this breakpoint to scan a given module list and resolve any new locations that match the breakpoint's specifications. | |
void | ResolveBreakpointInModules (ModuleList &module_list, BreakpointLocationCollection &new_locations) |
Tell this breakpoint to scan a given module list and resolve any new locations that match the breakpoint's specifications. | |
void | ModulesChanged (ModuleList &changed_modules, bool load_event, bool delete_locations=false) |
Like ResolveBreakpointInModules, but allows for "unload" events, in which case we will remove any locations that are in modules that got unloaded. | |
void | ModuleReplaced (lldb::ModuleSP old_module_sp, lldb::ModuleSP new_module_sp) |
Tells the breakpoint the old module old_module_sp has been replaced by new_module_sp (usually because the underlying file has been rebuilt, and the old version is gone.) | |
lldb::BreakpointLocationSP | AddLocation (const Address &addr, bool *new_location=nullptr) |
Add a location to the breakpoint's location list. | |
lldb::BreakpointLocationSP | FindLocationByAddress (const Address &addr) |
Find a breakpoint location by Address. | |
lldb::break_id_t | FindLocationIDByAddress (const Address &addr) |
Find a breakpoint location ID by Address. | |
lldb::BreakpointLocationSP | FindLocationByID (lldb::break_id_t bp_loc_id) |
Find a breakpoint location for a given breakpoint location ID. | |
lldb::BreakpointLocationSP | GetLocationAtIndex (size_t index) |
Get breakpoint locations by index. | |
void | RemoveInvalidLocations (const ArchSpec &arch) |
Removes all invalid breakpoint locations. | |
void | SetEnabled (bool enable) override |
If enable is true, enable the breakpoint, if false disable it. | |
bool | IsEnabled () override |
Check the Enable/Disable state. | |
void | SetIgnoreCount (uint32_t count) |
Set the breakpoint to ignore the next count breakpoint hits. | |
uint32_t | GetIgnoreCount () const |
Return the current ignore count/. | |
uint32_t | GetHitCount () const |
Return the current hit count for all locations. | |
void | ResetHitCount () |
Resets the current hit count for all locations. | |
void | SetOneShot (bool one_shot) |
If one_shot is true, breakpoint will be deleted on first hit. | |
bool | IsOneShot () const |
Check the OneShot state. | |
void | SetAutoContinue (bool auto_continue) |
If auto_continue is true, breakpoint will auto-continue when on hit. | |
bool | IsAutoContinue () const |
Check the AutoContinue state. | |
void | SetThreadID (lldb::tid_t thread_id) |
Set the valid thread to be checked when the breakpoint is hit. | |
lldb::tid_t | GetThreadID () const |
Return the current stop thread value. | |
void | SetThreadIndex (uint32_t index) |
uint32_t | GetThreadIndex () const |
void | SetThreadName (const char *thread_name) |
const char * | GetThreadName () const |
void | SetQueueName (const char *queue_name) |
const char * | GetQueueName () const |
void | SetCallback (BreakpointHitCallback callback, void *baton, bool is_synchronous=false) |
Set the callback action invoked when the breakpoint is hit. | |
void | SetCallback (BreakpointHitCallback callback, const lldb::BatonSP &callback_baton_sp, bool is_synchronous=false) |
void | ClearCallback () |
void | SetCondition (const char *condition) |
Set the breakpoint's condition. | |
const char * | GetConditionText () const |
Return a pointer to the text of the condition expression. | |
size_t | GetNumResolvedLocations () const |
Return the number of breakpoint locations that have resolved to actual breakpoint sites. | |
bool | HasResolvedLocations () const |
Return whether this breakpoint has any resolved locations. | |
size_t | GetNumLocations () const |
Return the number of breakpoint locations. | |
void | GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_locations=false) |
Put a description of this breakpoint into the stream s. | |
void | SetBreakpointKind (const char *kind) |
Set the "kind" description for a breakpoint. | |
const char * | GetBreakpointKind () const |
Return the "kind" description for a breakpoint. | |
Target & | GetTarget () |
Accessor for the breakpoint Target. | |
const Target & | GetTarget () const |
const lldb::TargetSP | GetTargetSP () |
void | GetResolverDescription (Stream *s) |
bool | GetMatchingFileLine (ConstString filename, uint32_t line_number, BreakpointLocationCollection &loc_coll) |
Find breakpoint locations which match the (filename, line_number) description. | |
void | GetFilterDescription (Stream *s) |
BreakpointOptions & | GetOptions () |
Returns the BreakpointOptions structure set at the breakpoint level. | |
const BreakpointOptions & | GetOptions () const |
Returns the BreakpointOptions structure set at the breakpoint level. | |
bool | InvokeCallback (StoppointCallbackContext *context, lldb::break_id_t bp_loc_id) |
Invoke the callback action when the breakpoint is hit. | |
bool | IsHardware () const |
lldb::BreakpointResolverSP | GetResolver () |
lldb::SearchFilterSP | GetSearchFilter () |
bool | MatchesName (const char *name) |
void | GetNames (std::vector< std::string > &names) |
void | SetPrecondition (lldb::BreakpointPreconditionSP precondition_sp) |
Set a pre-condition filter that overrides all user provided filters/callbacks etc. | |
bool | EvaluatePrecondition (StoppointCallbackContext &context) |
lldb::BreakpointPreconditionSP | GetPrecondition () |
const BreakpointName::Permissions & | GetPermissions () const |
BreakpointName::Permissions & | GetPermissions () |
bool | AllowList () const |
bool | AllowDisable () const |
bool | AllowDelete () const |
llvm::json::Value | GetStatistics () |
Get statistics associated with this breakpoint in JSON format. | |
StatsDuration::Duration | GetResolveTime () const |
Get the time it took to resolve all locations in this breakpoint. | |
![]() | |
Stoppoint () | |
virtual | ~Stoppoint () |
virtual void | Dump (Stream *)=0 |
virtual bool | IsEnabled ()=0 |
virtual void | SetEnabled (bool enable)=0 |
lldb::break_id_t | GetID () const |
void | SetID (lldb::break_id_t bid) |
Static Public Member Functions | |
static ConstString | GetEventIdentifier () |
static const char * | BreakpointEventTypeAsCString (lldb::BreakpointEventType type) |
static lldb::BreakpointSP | CreateFromStructuredData (lldb::TargetSP target_sp, StructuredData::ObjectSP &data_object_sp, Status &error) |
static bool | SerializedBreakpointMatchesNames (StructuredData::ObjectSP &bkpt_object_sp, std::vector< std::string > &names) |
static const char * | GetSerializationKey () |
static lldb::BreakpointSP | CopyFromBreakpoint (lldb::TargetSP new_target, const Breakpoint &bp_to_copy_from) |
Protected Member Functions | |
Breakpoint (Target &target, lldb::SearchFilterSP &filter_sp, lldb::BreakpointResolverSP &resolver_sp, bool hardware, bool resolve_indirect_symbols=true) | |
Constructors and Destructors Only the Target can make a breakpoint, and it owns the breakpoint lifespans. | |
void | DecrementIgnoreCount () |
Private Types | |
enum class | OptionNames : uint32_t { Names = 0 , Hardware , LastOptionName } |
Private Member Functions | |
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 Breakpoint & | operator= (const Breakpoint &)=delete |
Static Private Member Functions | |
static const char * | GetKey (OptionNames enum_value) |
Private Attributes | |
bool | m_being_created |
bool | m_hardware |
Target & | m_target |
std::unordered_set< std::string > | m_name_list |
lldb::SearchFilterSP | m_filter_sp |
lldb::BreakpointResolverSP | m_resolver_sp |
lldb::BreakpointPreconditionSP | m_precondition_sp |
BreakpointOptions | m_options |
BreakpointLocationList | m_locations |
std::string | m_kind_description |
bool | m_resolve_indirect_symbols |
StoppointHitCounter | m_hit_counter |
Number of times this breakpoint has been hit. | |
BreakpointName::Permissions | m_permissions |
StatsDuration | m_resolve_time |
Static Private Attributes | |
static const char * | g_option_names [static_cast< uint32_t >(OptionNames::LastOptionName)] {"Names", "Hardware"} |
Friends | |
class | Target |
class | BreakpointLocation |
Additional Inherited Members | |
![]() | |
lldb::break_id_t | m_bid = LLDB_INVALID_BREAK_ID |
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locations that have been determined for the filter/resolver pair, and finally a set of options for the breakpoint.
Class that manages logical breakpoint setting.
Filter: This is an object derived from SearchFilter. It manages the search for breakpoint location matches through the symbols in the module list of the target that owns it. It also filters out locations based on whatever logic it wants.
Resolver: This is an object derived from BreakpointResolver. It provides a callback to the filter that will find breakpoint locations. How it does this is determined by what kind of resolver it is.
The Breakpoint class also provides constructors for the common breakpoint cases which make the appropriate filter and resolver for you.
Location List: This stores the breakpoint locations that have been determined to date. For a given breakpoint, there will be only one location with a given address. Adding a location at an already taken address will just return the location already at that address. Locations can be looked up by ID, or by address.
Options: This includes: Enabled/Disabled Ignore Count Callback Condition Note, these options can be set on the breakpoint, and they can also be set on the individual locations. The options set on the breakpoint take precedence over the options set on the individual location. So for instance disabling the breakpoint will cause NONE of the locations to get hit. But if the breakpoint is enabled, then the location's enabled state will be checked to determine whether to insert that breakpoint location. Similarly, if the breakpoint condition says "stop", we won't check the location's condition. But if the breakpoint condition says "continue", then we will check the location for whether to actually stop or not. One subtle point worth observing here is that you don't actually stop at a Breakpoint, you always stop at one of its locations. So the "should stop" tests are done by the location, not by the breakpoint.
Definition at line 80 of file Breakpoint.h.
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 89 of file Breakpoint.h.
|
strongprivate |
Enumerator | |
---|---|
Names | |
Hardware | |
LastOptionName |
Definition at line 92 of file Breakpoint.h.
|
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.
|
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.
[in] | target | The target in which the breakpoint will be set. |
[in] | filter_sp | Shared pointer to the search filter that restricts the search domain of the breakpoint. |
[in] | resolver_sp | Shared pointer to the resolver object that will determine breakpoint matches. |
hardware | If true, request a hardware breakpoint to be used to implement the breakpoint locations. | |
resolve_indirect_symbols | If 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. |
|
private |
Definition at line 59 of file Breakpoint.cpp.
|
privatedelete |
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?
[in] | addr | The Address specifying the new location. |
[out] | new_location | Set to true if a new location was created, to false if there already was a location at this Address. |
Definition at line 261 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationList::AddLocation(), m_locations, and m_resolve_indirect_symbols.
|
private |
Definition at line 849 of file Breakpoint.cpp.
References m_name_list.
|
inline |
Definition at line 581 of file Breakpoint.h.
References lldb_private::BreakpointName::Permissions::GetAllowDelete(), and GetPermissions().
|
inline |
Definition at line 578 of file Breakpoint.h.
References lldb_private::BreakpointName::Permissions::GetAllowDisable(), and GetPermissions().
|
inline |
Definition at line 575 of file Breakpoint.h.
References lldb_private::BreakpointName::Permissions::GetAllowList(), and GetPermissions().
Referenced by CommandObjectBreakpointList::DoExecute().
|
static |
Definition at line 1018 of file Breakpoint.cpp.
Referenced by lldb_private::Breakpoint::BreakpointEventData::Dump().
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 488 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationList::ClearAllBreakpointSites(), and m_locations.
void Breakpoint::ClearCallback | ( | ) |
Definition at line 436 of file Breakpoint.cpp.
References lldb_private::BreakpointOptions::ClearCallback(), and m_options.
Referenced by CommandObjectBreakpointCommandDelete::DoExecute().
|
static |
Definition at line 69 of file Breakpoint.cpp.
References m_filter_sp, and m_resolver_sp.
Referenced by lldb_private::Target::PrimeFromDummyTarget().
|
static |
Definition at line 130 of file Breakpoint.cpp.
References lldb_private::Target::AddNameToBreakpoint(), lldb_private::Status::AsCString(), lldb_private::Target::CreateBreakpoint(), lldb_private::SearchFilter::CreateFromStructuredData(), lldb_private::BreakpointResolver::CreateFromStructuredData(), lldb_private::BreakpointOptions::CreateFromStructuredData(), error(), lldb_private::Status::Fail(), lldb_private::StructuredData::Object::GetAsDictionary(), lldb_private::StructuredData::Array::GetItemAtIndexAsString(), GetKey(), lldb_private::BreakpointOptions::GetSerializationKey(), lldb_private::BreakpointResolver::GetSerializationKey(), lldb_private::SearchFilter::GetSerializationKey(), lldb_private::StructuredData::Array::GetSize(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsArray(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsBoolean(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsDictionary(), Hardware, lldb_private::StructuredData::Object::IsValid(), and Names.
Referenced by lldb_private::Target::CreateBreakpointsFromFile().
|
protected |
Definition at line 319 of file Breakpoint.cpp.
References lldb_private::BreakpointOptions::GetIgnoreCount(), m_options, and lldb_private::BreakpointOptions::SetIgnoreCount().
Referenced by lldb_private::BreakpointLocation::IgnoreCountShouldStop().
|
overridevirtual |
Standard "Dump" method. At present it does nothing.
Implements lldb_private::Stoppoint.
Definition at line 835 of file Breakpoint.cpp.
Referenced by lldb_private::ThreadPlanRunToAddress::GetDescription(), and GetDescription().
bool Breakpoint::EvaluatePrecondition | ( | StoppointCallbackContext & | context | ) |
Definition at line 988 of file Breakpoint.cpp.
References m_precondition_sp.
BreakpointLocationSP Breakpoint::FindLocationByAddress | ( | const Address & | addr | ) |
Find a breakpoint location by Address.
[in] | addr | The Address specifying the location. |
Definition at line 267 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationList::FindByAddress(), and m_locations.
BreakpointLocationSP Breakpoint::FindLocationByID | ( | lldb::break_id_t | bp_loc_id | ) |
Find a breakpoint location for a given breakpoint location ID.
[in] | bp_loc_id | The ID specifying the location. |
Definition at line 275 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationList::FindByID(), and m_locations.
Referenced by CommandObjectBreakpointModify::DoExecute(), CommandObjectBreakpointEnable::DoExecute(), CommandObjectBreakpointDelete::DoExecute(), CommandObjectBreakpointCommandDelete::DoExecute(), and CommandObjectBreakpointCommandList::DoExecute().
break_id_t Breakpoint::FindLocationIDByAddress | ( | const Address & | addr | ) |
Find a breakpoint location ID by Address.
[in] | addr | The Address specifying the location. |
Definition at line 271 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationList::FindIDByAddress(), and m_locations.
|
inline |
Return the "kind" description for a breakpoint.
Definition at line 459 of file Breakpoint.h.
References m_kind_description.
Referenced by GetDescription().
const char * Breakpoint::GetConditionText | ( | ) | const |
Return a pointer to the text of the condition expression.
Definition at line 413 of file Breakpoint.cpp.
References lldb_private::BreakpointOptions::GetConditionText(), and m_options.
void Breakpoint::GetDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level, | ||
bool | show_locations = false |
||
) |
Put a description of this breakpoint into the stream s.
[in] | s | Stream into which to dump the description. |
[in] | level | The description level that indicates the detail level to provide. |
Definition at line 854 of file Breakpoint.cpp.
References Dump(), lldb::eDescriptionLevelBrief, lldb::eDescriptionLevelFull, lldb::eDescriptionLevelInitial, lldb::eDescriptionLevelVerbose, lldb_private::Stream::EOL(), lldb_private::BreakpointResolver::ExceptionResolver, GetBreakpointKind(), lldb_private::BreakpointLocation::GetDescription(), lldb_private::BreakpointOptions::GetDescription(), GetFilterDescription(), GetHitCount(), lldb_private::Stoppoint::GetID(), GetLocationAtIndex(), GetNumLocations(), GetNumResolvedLocations(), GetResolverDescription(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_kind_description, m_name_list, m_options, m_precondition_sp, m_resolver_sp, lldb_private::Stream::Printf(), and lldb_private::Stream::PutCString().
Referenced by AddBreakpointDescription(), CommandObjectBreakpointClear::DoExecute(), and CommandObjectBreakpointRead::DoExecute().
|
static |
Definition at line 40 of file Breakpoint.cpp.
void Breakpoint::GetFilterDescription | ( | Stream * | s | ) |
Definition at line 984 of file Breakpoint.cpp.
References m_filter_sp.
Referenced by GetDescription().
uint32_t Breakpoint::GetHitCount | ( | ) | const |
Return the current hit count for all locations.
Definition at line 329 of file Breakpoint.cpp.
References lldb_private::StoppointHitCounter::GetValue(), and m_hit_counter.
Referenced by GetDescription(), and GetStatistics().
uint32_t Breakpoint::GetIgnoreCount | ( | ) | const |
Return the current ignore count/.
Definition at line 325 of file Breakpoint.cpp.
References lldb_private::BreakpointOptions::GetIgnoreCount(), and m_options.
Referenced by lldb_private::BreakpointLocation::IgnoreCountShouldStop().
|
inlinestaticprivate |
Definition at line 97 of file Breakpoint.h.
References g_option_names.
Referenced by CreateFromStructuredData(), SerializedBreakpointMatchesNames(), and SerializeToStructuredData().
BreakpointLocationSP Breakpoint::GetLocationAtIndex | ( | size_t | index | ) |
Get breakpoint locations by index.
[in] | index | The location index. |
Definition at line 279 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationList::GetByIndex(), and m_locations.
Referenced by lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), GetDescription(), and lldb_private::BreakpointResolverAddress::SearchCallback().
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.
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 961 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().
|
inline |
Definition at line 541 of file Breakpoint.h.
References m_name_list.
size_t Breakpoint::GetNumLocations | ( | ) | const |
Return the number of breakpoint locations.
Definition at line 847 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationList::GetSize(), and m_locations.
Referenced by lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), GetDescription(), GetStatistics(), lldb_private::BreakpointResolverAddress::SearchCallback(), and lldb_private::CommandObjectMultiwordBreakpoint::VerifyIDs().
size_t Breakpoint::GetNumResolvedLocations | ( | ) | const |
Return the number of breakpoint locations that have resolved to actual breakpoint sites.
Definition at line 837 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationList::GetNumResolvedLocations(), and m_locations.
Referenced by GetDescription(), GetStatistics(), and HasResolvedLocations().
BreakpointOptions & Breakpoint::GetOptions | ( | ) |
Returns the BreakpointOptions structure set at the breakpoint level.
Meant to be used by the BreakpointLocation class.
Definition at line 443 of file Breakpoint.cpp.
References m_options.
Referenced by CommandObjectBreakpointModify::DoExecute(), CommandObjectBreakpointCommandList::DoExecute(), lldb_private::BreakpointLocation::GetOptionsSpecifyingKind(), and lldb_private::BreakpointLocation::IsCallbackSynchronous().
const BreakpointOptions & Breakpoint::GetOptions | ( | ) | const |
Returns the BreakpointOptions structure set at the breakpoint level.
Meant to be used by the BreakpointLocation class.
Definition at line 445 of file Breakpoint.cpp.
References m_options.
|
inline |
Definition at line 571 of file Breakpoint.h.
References m_permissions.
|
inline |
Definition at line 567 of file Breakpoint.h.
References m_permissions.
Referenced by AllowDelete(), AllowDisable(), and AllowList().
|
inline |
Definition at line 564 of file Breakpoint.h.
References m_precondition_sp.
const char * Breakpoint::GetQueueName | ( | ) | const |
Definition at line 401 of file Breakpoint.cpp.
References lldb_private::ThreadSpec::GetQueueName(), lldb_private::BreakpointOptions::GetThreadSpecNoCreate(), and m_options.
|
inline |
Definition at line 523 of file Breakpoint.h.
References m_resolver_sp.
void Breakpoint::GetResolverDescription | ( | Stream * | s | ) |
Definition at line 956 of file Breakpoint.cpp.
References m_resolver_sp.
Referenced by GetDescription().
|
inline |
Get the time it took to resolve all locations in this breakpoint.
Definition at line 594 of file Breakpoint.h.
References m_resolve_time.
Referenced by lldb_private::TargetStats::ToJSON().
|
inline |
Definition at line 525 of file Breakpoint.h.
References m_filter_sp.
|
inlinestatic |
Definition at line 161 of file Breakpoint.h.
Referenced by lldb_private::Target::CreateBreakpointsFromFile(), CommandObjectBreakpointRead::CommandOptions::HandleOptionArgumentCompletion(), and SerializeToStructuredData().
json::Value Breakpoint::GetStatistics | ( | ) |
Get statistics associated with this breakpoint in JSON format.
Definition at line 1129 of file Breakpoint.cpp.
References lldb_private::StatsDuration::get(), GetHitCount(), lldb_private::Stoppoint::GetID(), GetNumLocations(), GetNumResolvedLocations(), IsInternal(), m_kind_description, m_resolve_time, SerializeToStructuredData(), and lldb_private::toString().
Referenced by lldb_private::TargetStats::ToJSON().
|
inline |
Accessor for the breakpoint Target.
Definition at line 464 of file Breakpoint.h.
References m_target.
Referenced by lldb_private::InstrumentationRuntimeASan::Activate(), lldb_private::InstrumentationRuntimeMainThreadChecker::Activate(), lldb_private::InstrumentationRuntimeTSan::Activate(), lldb_private::InstrumentationRuntimeUBSan::Activate(), lldb_private::BreakpointLocation::ClearBreakpointSite(), lldb_private::BreakpointLocation::Dump(), lldb_private::BreakpointLocationList::FindByAddress(), lldb_private::BreakpointLocation::GetDescription(), lldb_private::BreakpointLocation::GetLoadAddress(), lldb_private::BreakpointLocation::GetTarget(), lldb_private::BreakpointLocation::ResolveBreakpointSite(), lldb_private::BreakpointResolverAddress::SearchCallback(), lldb_private::BreakpointResolverName::SearchCallback(), SendBreakpointChangedEvent(), and lldb_private::BreakpointLocation::SendBreakpointLocationChangedEvent().
|
inline |
Definition at line 466 of file Breakpoint.h.
References m_target.
const lldb::TargetSP Breakpoint::GetTargetSP | ( | ) |
Definition at line 255 of file Breakpoint.cpp.
References m_target.
lldb::tid_t Breakpoint::GetThreadID | ( | ) | const |
Return the current stop thread value.
Definition at line 354 of file Breakpoint.cpp.
References lldb_private::BreakpointOptions::GetThreadSpecNoCreate(), lldb_private::ThreadSpec::GetTID(), LLDB_INVALID_THREAD_ID, and m_options.
uint32_t Breakpoint::GetThreadIndex | ( | ) | const |
Definition at line 369 of file Breakpoint.cpp.
References lldb_private::ThreadSpec::GetIndex(), lldb_private::BreakpointOptions::GetThreadSpecNoCreate(), and m_options.
const char * Breakpoint::GetThreadName | ( | ) | const |
Definition at line 385 of file Breakpoint.cpp.
References lldb_private::ThreadSpec::GetName(), lldb_private::BreakpointOptions::GetThreadSpecNoCreate(), and m_options.
bool Breakpoint::HasResolvedLocations | ( | ) | const |
Return whether this breakpoint has any resolved locations.
Definition at line 843 of file Breakpoint.cpp.
References GetNumResolvedLocations().
Referenced by lldb_private::ThreadPlanRunToAddress::SetInitialBreakpoints(), lldb_private::ThreadPlanStepOut::ThreadPlanStepOut(), lldb_private::ThreadPlanStepThrough::ThreadPlanStepThrough(), and lldb_private::ThreadPlanStepUntil::ThreadPlanStepUntil().
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.
[in] | context | Described the breakpoint event. |
[in] | bp_loc_id | Which breakpoint location hit this breakpoint. |
Definition at line 438 of file Breakpoint.cpp.
References lldb_private::Stoppoint::GetID(), lldb_private::BreakpointOptions::InvokeCallback(), and m_options.
Referenced by lldb_private::BreakpointLocation::InvokeCallback().
bool Breakpoint::IsAutoContinue | ( | ) | const |
Check the AutoContinue state.
Definition at line 340 of file Breakpoint.cpp.
References lldb_private::BreakpointOptions::IsAutoContinue(), and m_options.
Referenced by lldb_private::BreakpointLocation::IsAutoContinue().
|
overridevirtual |
Check the Enable/Disable state.
Implements lldb_private::Stoppoint.
Definition at line 309 of file Breakpoint.cpp.
References lldb_private::BreakpointOptions::IsEnabled(), and m_options.
Referenced by lldb_private::BreakpointLocation::Dump(), and lldb_private::BreakpointLocation::IsEnabled().
|
inline |
Definition at line 521 of file Breakpoint.h.
References m_hardware.
Referenced by lldb_private::BreakpointLocationList::Create(), lldb_private::BreakpointLocation::ResolveBreakpointSite(), lldb_private::ThreadPlanRunToAddress::SetInitialBreakpoints(), lldb_private::ThreadPlanStepOut::ThreadPlanStepOut(), lldb_private::ThreadPlanStepThrough::ThreadPlanStepThrough(), and lldb_private::ThreadPlanStepUntil::ThreadPlanStepUntil().
bool Breakpoint::IsInternal | ( | ) | const |
Tell whether this breakpoint is an "internal" breakpoint.
Definition at line 259 of file Breakpoint.cpp.
References LLDB_BREAK_ID_IS_INTERNAL, and lldb_private::Stoppoint::m_bid.
Referenced by CommandObjectProcessContinue::DoExecute(), lldb_private::ThreadPlanCallFunction::DoPlanExplainsStop(), GetStatistics(), ModuleReplaced(), ModulesChanged(), lldb_private::StackFrameList::ResetCurrentInlinedDepth(), ResolveBreakpointInModules(), lldb_private::BreakpointResolverAddress::SearchCallback(), lldb_private::BreakpointResolverName::SearchCallback(), SendBreakpointChangedEvent(), lldb_private::BreakpointLocation::SendBreakpointLocationChangedEvent(), and lldb_private::StopInfoBreakpoint::StoreBPInfo().
bool Breakpoint::IsOneShot | ( | ) | const |
Check the OneShot state.
Definition at line 336 of file Breakpoint.cpp.
References lldb_private::BreakpointOptions::IsOneShot(), and m_options.
Referenced by lldb_private::StopInfoBreakpoint::StoreBPInfo().
|
inline |
Definition at line 537 of file Breakpoint.h.
References m_name_list.
void Breakpoint::ModuleReplaced | ( | lldb::ModuleSP | old_module_sp, |
lldb::ModuleSP | new_module_sp | ||
) |
Tells the breakpoint the old module old_module_sp has been replaced by new_module_sp (usually because the underlying file has been rebuilt, and the old version is gone.)
[in] | old_module_sp | The old module that is going away. |
[in] | new_module_sp | The new module that is replacing it. |
Definition at line 653 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationCollection::Add(), lldb_private::ModuleList::Append(), lldb_private::BreakpointLocationCollection::BreakpointLocations(), lldb_private::BreakpointLocationList::BreakpointLocations(), lldb_private::Breakpoints, lldb_private::BreakpointLocationList::Compact(), lldb_private::BreakpointLocationCollection::FindByIDPair(), lldb_private::Breakpoint::BreakpointEventData::GetBreakpointLocationCollection(), lldb_private::BreakpointLocationCollection::GetByIndex(), lldb_private::Stoppoint::GetID(), lldb_private::GetLog(), lldb_private::BreakpointLocationCollection::GetSize(), IsInternal(), LLDB_LOGF, m_locations, lldb_private::BreakpointLocationList::RemoveLocation(), ResolveBreakpointInModules(), SendBreakpointChangedEvent(), lldb_private::BreakpointLocationList::SwapLocation(), and SymbolContextsMightBeEquivalent().
void Breakpoint::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.
[in] | changed_modules | The list of modules to look in for new locations. |
[in] | load_event | If true then the modules were loaded, if false, unloaded. |
[in] | delete_locations | If true then the modules were unloaded delete any locations in the changed modules. |
Definition at line 494 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationCollection::Add(), lldb_private::ModuleList::AppendIfNeeded(), lldb_private::BreakpointLocationList::BreakpointLocations(), lldb_private::Breakpoints, lldb_private::Breakpoint::BreakpointEventData::GetBreakpointLocationCollection(), lldb_private::BreakpointLocationCollection::GetByIndex(), lldb_private::BreakpointLocationList::GetByIndex(), lldb_private::Stoppoint::GetID(), lldb_private::GetLog(), lldb_private::Address::GetSection(), lldb_private::BreakpointLocationCollection::GetSize(), lldb_private::BreakpointLocationList::GetSize(), lldb_private::ModuleList::GetSize(), IsInternal(), LLDB_LOGF, m_filter_sp, m_locations, lldb_private::ModuleList::Modules(), lldb_private::BreakpointLocationList::RemoveLocation(), ResolveBreakpointInModules(), lldb_private::Address::SectionWasDeleted(), and SendBreakpointChangedEvent().
|
privatedelete |
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.
[in] | arch | If valid, check the module in each breakpoint to make sure they are compatible, otherwise, ignore architecture. |
Definition at line 283 of file Breakpoint.cpp.
References m_locations, and lldb_private::BreakpointLocationList::RemoveInvalidLocations().
|
inlineprivate |
Definition at line 531 of file Breakpoint.h.
References m_name_list.
void Breakpoint::ResetHitCount | ( | ) |
Resets the current hit count for all locations.
Definition at line 331 of file Breakpoint.cpp.
References m_hit_counter, m_locations, lldb_private::StoppointHitCounter::Reset(), and lldb_private::BreakpointLocationList::ResetHitCount().
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 447 of file Breakpoint.cpp.
References elapsed(), m_filter_sp, m_resolve_time, and m_resolver_sp.
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.
[in] | module_list | The list of modules to look in for new locations. |
[in] | send_event | If true, send a breakpoint location added event for non-internal breakpoints. |
Definition at line 464 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, ResolveBreakpointInModules(), and SendBreakpointChangedEvent().
Referenced by ModuleReplaced(), ModulesChanged(), and ResolveBreakpointInModules().
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.
[in] | module_list | The list of modules to look in for new locations. |
[in] | new_locations | Fills new_locations with the new locations that were made. |
Definition at line 454 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().
|
private |
Definition at line 1007 of file Breakpoint.cpp.
References lldb_private::Broadcaster::BroadcastEvent(), lldb_private::Target::eBroadcastBitBreakpointChanged, GetTarget(), IsInternal(), and m_being_created.
|
private |
Definition at line 995 of file Breakpoint.cpp.
References lldb_private::Broadcaster::BroadcastEvent(), lldb_private::Target::eBroadcastBitBreakpointChanged, GetTarget(), IsInternal(), and m_being_created.
Referenced by ModuleReplaced(), ModulesChanged(), ResolveBreakpointInModules(), SetCallback(), SetCondition(), SetEnabled(), SetIgnoreCount(), SetQueueName(), SetThreadID(), SetThreadIndex(), and SetThreadName().
|
static |
Definition at line 223 of file Breakpoint.cpp.
References lldb_private::StructuredData::Object::GetAsDictionary(), lldb_private::StructuredData::Array::GetItemAtIndexAsString(), GetKey(), lldb_private::StructuredData::Array::GetSize(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsArray(), and Names.
Referenced by lldb_private::Target::CreateBreakpointsFromFile().
|
virtual |
Definition at line 82 of file Breakpoint.cpp.
References GetKey(), GetSerializationKey(), lldb_private::BreakpointOptions::GetSerializationKey(), lldb_private::BreakpointResolver::GetSerializationKey(), lldb_private::SearchFilter::GetSerializationKey(), Hardware, m_filter_sp, m_hardware, m_name_list, m_options, m_resolver_sp, Names, and lldb_private::BreakpointOptions::SerializeToStructuredData().
Referenced by GetStatistics(), and lldb_private::Target::SerializeBreakpointsToFile().
void Breakpoint::SetAutoContinue | ( | bool | auto_continue | ) |
If auto_continue is true, breakpoint will auto-continue when on hit.
Definition at line 342 of file Breakpoint.cpp.
References m_options, and lldb_private::BreakpointOptions::SetAutoContinue().
|
inline |
Set the "kind" description for a breakpoint.
If the breakpoint is hit the stop info will show this "kind" description instead of the breakpoint number. Mostly useful for internal breakpoints, where the breakpoint number doesn't have meaning to the user.
[in] | kind | New "kind" description. |
Definition at line 453 of file Breakpoint.h.
References m_kind_description.
Referenced by lldb_private::InstrumentationRuntimeASan::Activate(), lldb_private::InstrumentationRuntimeMainThreadChecker::Activate(), lldb_private::InstrumentationRuntimeTSan::Activate(), lldb_private::InstrumentationRuntimeUBSan::Activate(), DynamicLoaderPOSIXDYLD::ProbeEntry(), lldb_private::ThreadPlanRunToAddress::SetInitialBreakpoints(), JITLoaderGDB::SetJITBreakpoint(), DynamicLoaderMacOS::SetNotificationBreakpoint(), DynamicLoaderMacOSXDYLD::SetNotificationBreakpoint(), DynamicLoaderHexagonDYLD::SetRendezvousBreakpoint(), lldb_private::ThreadPlanStepOut::ThreadPlanStepOut(), lldb_private::ThreadPlanStepThrough::ThreadPlanStepThrough(), and lldb_private::ThreadPlanStepUntil::ThreadPlanStepUntil().
void lldb_private::Breakpoint::SetCallback | ( | BreakpointHitCallback | callback, |
const lldb::BatonSP & | callback_baton_sp, | ||
bool | is_synchronous = false |
||
) |
void Breakpoint::SetCallback | ( | BreakpointHitCallback | callback, |
void * | baton, | ||
bool | is_synchronous = false |
||
) |
Set the callback action invoked when the breakpoint is hit.
[in] | callback | The method that will get called when the breakpoint is hit. |
[in] | baton | A void * pointer that will get passed back to the callback function. |
[in] | is_synchronous | If true the callback will be run on the private event thread before the stop event gets reported. If false, the callback will get handled on the public event thread while the stop event is being pulled off the event queue. Note: synchronous callbacks cannot cause the target to run, in particular, they should not try to run the expression evaluator. |
Definition at line 418 of file Breakpoint.cpp.
References m_options, SendBreakpointChangedEvent(), and lldb_private::BreakpointOptions::SetCallback().
Referenced by lldb_private::InstrumentationRuntimeASan::Activate(), lldb_private::InstrumentationRuntimeMainThreadChecker::Activate(), lldb_private::InstrumentationRuntimeTSan::Activate(), lldb_private::InstrumentationRuntimeUBSan::Activate(), DynamicLoaderPOSIXDYLD::ProbeEntry(), JITLoaderGDB::SetJITBreakpoint(), DynamicLoaderMacOS::SetNotificationBreakpoint(), DynamicLoaderMacOSXDYLD::SetNotificationBreakpoint(), DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded(), and DynamicLoaderHexagonDYLD::SetRendezvousBreakpoint().
void Breakpoint::SetCondition | ( | const char * | condition | ) |
Set the breakpoint's condition.
[in] | condition | The condition expression to evaluate when the breakpoint is hit. Pass in nullptr to clear the condition. |
Definition at line 408 of file Breakpoint.cpp.
References m_options, SendBreakpointChangedEvent(), and lldb_private::BreakpointOptions::SetCondition().
|
overridevirtual |
If enable is true, enable the breakpoint, if false disable it.
Implements lldb_private::Stoppoint.
Definition at line 295 of file Breakpoint.cpp.
References lldb_private::BreakpointLocationList::ClearAllBreakpointSites(), lldb_private::BreakpointOptions::IsEnabled(), m_locations, m_options, lldb_private::BreakpointLocationList::ResolveAllBreakpointSites(), SendBreakpointChangedEvent(), and lldb_private::BreakpointOptions::SetEnabled().
Referenced by CommandObjectBreakpointEnable::DoExecute(), lldb_private::ThreadPlanStepOut::DoWillResume(), lldb_private::ThreadPlanStepUntil::DoWillResume(), lldb_private::ThreadPlanStepOut::WillStop(), and lldb_private::ThreadPlanStepUntil::WillStop().
void Breakpoint::SetIgnoreCount | ( | uint32_t | count | ) |
Set the breakpoint to ignore the next count breakpoint hits.
[in] | count | The number of breakpoint hits to ignore. |
Definition at line 311 of file Breakpoint.cpp.
References lldb_private::BreakpointOptions::GetIgnoreCount(), m_options, SendBreakpointChangedEvent(), and lldb_private::BreakpointOptions::SetIgnoreCount().
Referenced by CommandObjectProcessContinue::DoExecute().
void Breakpoint::SetOneShot | ( | bool | one_shot | ) |
If one_shot is true, breakpoint will be deleted on first hit.
Definition at line 338 of file Breakpoint.cpp.
References m_options, and lldb_private::BreakpointOptions::SetOneShot().
Referenced by DynamicLoaderPOSIXDYLD::ProbeEntry().
|
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 558 of file Breakpoint.h.
References m_precondition_sp.
void Breakpoint::SetQueueName | ( | const char * | queue_name | ) |
Definition at line 392 of file Breakpoint.cpp.
References lldb_private::ThreadSpec::GetQueueName(), lldb_private::BreakpointOptions::GetThreadSpec(), m_options, SendBreakpointChangedEvent(), and lldb_private::ThreadSpec::SetQueueName().
void Breakpoint::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 346 of file Breakpoint.cpp.
References lldb_private::BreakpointOptions::GetThreadSpec(), lldb_private::ThreadSpec::GetTID(), m_options, SendBreakpointChangedEvent(), and lldb_private::ThreadSpec::SetTID().
Referenced by lldb_private::ThreadPlanRunToAddress::SetInitialBreakpoints(), lldb_private::ThreadPlanStepOut::ThreadPlanStepOut(), lldb_private::ThreadPlanStepThrough::ThreadPlanStepThrough(), and lldb_private::ThreadPlanStepUntil::ThreadPlanStepUntil().
void Breakpoint::SetThreadIndex | ( | uint32_t | index | ) |
Definition at line 361 of file Breakpoint.cpp.
References lldb_private::ThreadSpec::GetIndex(), lldb_private::BreakpointOptions::GetThreadSpec(), m_options, SendBreakpointChangedEvent(), and lldb_private::ThreadSpec::SetIndex().
void Breakpoint::SetThreadName | ( | const char * | thread_name | ) |
Definition at line 376 of file Breakpoint.cpp.
References lldb_private::ThreadSpec::GetName(), lldb_private::BreakpointOptions::GetThreadSpec(), m_options, SendBreakpointChangedEvent(), and lldb_private::ThreadSpec::SetName().
|
friend |
Definition at line 632 of file Breakpoint.h.
|
friend |
Definition at line 597 of file Breakpoint.h.
|
staticprivate |
Definition at line 95 of file Breakpoint.h.
Referenced by GetKey().
|
private |
Definition at line 642 of file Breakpoint.h.
Referenced by SendBreakpointChangedEvent().
|
private |
Definition at line 651 of file Breakpoint.h.
Referenced by CopyFromBreakpoint(), GetFilterDescription(), GetSearchFilter(), ModulesChanged(), ResolveBreakpoint(), ResolveBreakpointInModules(), and SerializeToStructuredData().
|
private |
Definition at line 644 of file Breakpoint.h.
Referenced by IsHardware(), and SerializeToStructuredData().
|
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 669 of file Breakpoint.h.
Referenced by lldb_private::BreakpointLocation::BumpHitCount(), GetHitCount(), ResetHitCount(), and lldb_private::BreakpointLocation::UndoBumpHitCount().
|
private |
Definition at line 663 of file Breakpoint.h.
Referenced by GetBreakpointKind(), GetDescription(), GetStatistics(), and SetBreakpointKind().
|
private |
Definition at line 662 of file Breakpoint.h.
Referenced by AddLocation(), ClearAllBreakpointSites(), FindLocationByAddress(), FindLocationByID(), FindLocationIDByAddress(), GetLocationAtIndex(), GetNumLocations(), GetNumResolvedLocations(), ModuleReplaced(), ModulesChanged(), RemoveInvalidLocations(), ResetHitCount(), ResolveBreakpointInModules(), and SetEnabled().
|
private |
Definition at line 646 of file Breakpoint.h.
Referenced by AddName(), GetDescription(), GetNames(), MatchesName(), RemoveName(), and SerializeToStructuredData().
|
private |
Definition at line 660 of file Breakpoint.h.
Referenced by ClearCallback(), DecrementIgnoreCount(), GetConditionText(), GetDescription(), GetIgnoreCount(), GetOptions(), GetQueueName(), GetThreadID(), GetThreadIndex(), GetThreadName(), InvokeCallback(), IsAutoContinue(), IsEnabled(), IsOneShot(), SerializeToStructuredData(), SetAutoContinue(), SetCallback(), SetCondition(), SetEnabled(), SetIgnoreCount(), SetOneShot(), SetQueueName(), SetThreadID(), SetThreadIndex(), and SetThreadName().
|
private |
Definition at line 671 of file Breakpoint.h.
Referenced by GetPermissions().
|
private |
Definition at line 654 of file Breakpoint.h.
Referenced by EvaluatePrecondition(), GetDescription(), GetPrecondition(), and SetPrecondition().
|
private |
Definition at line 664 of file Breakpoint.h.
Referenced by AddLocation().
|
private |
Definition at line 673 of file Breakpoint.h.
Referenced by GetResolveTime(), GetStatistics(), ResolveBreakpoint(), and ResolveBreakpointInModules().
|
private |
Definition at line 653 of file Breakpoint.h.
Referenced by CopyFromBreakpoint(), GetDescription(), GetMatchingFileLine(), GetResolver(), GetResolverDescription(), ResolveBreakpoint(), ResolveBreakpointInModules(), and SerializeToStructuredData().
|
private |
Definition at line 645 of file Breakpoint.h.
Referenced by GetTarget(), and GetTargetSP().