Go to the documentation of this file.
9 #ifndef LLDB_BREAKPOINT_BREAKPOINT_H
10 #define LLDB_BREAKPOINT_BREAKPOINT_H
14 #include <unordered_set>
80 class Breakpoint :
public std::enable_shared_from_this<Breakpoint>,
105 const lldb::BreakpointSP &new_breakpoint_sp);
125 static lldb::BreakpointEventType
128 static lldb::BreakpointSP
131 static lldb::BreakpointLocationSP
157 std::vector<std::string> &names);
199 bool send_event =
true);
224 bool delete_locations =
false);
235 lldb::ModuleSP new_module_sp);
251 bool *new_location =
nullptr);
389 void SetCallback(BreakpointHitCallback callback,
void *baton,
390 bool is_synchronous =
false);
393 const lldb::BatonSP &callback_baton_sp,
394 bool is_synchronous =
false);
444 bool show_locations =
false);
529 bool AddName(llvm::StringRef new_name);
544 names.push_back(name);
629 lldb::BreakpointResolverSP &resolver_sp,
bool hardware,
630 bool resolve_indirect_symbols =
true);
652 lldb::BreakpointResolverSP
685 #endif // LLDB_BREAKPOINT_BREAKPOINT_H
BreakpointOptions & GetOptions()
Returns the BreakpointOptions structure set at the breakpoint level.
static ConstString GetEventIdentifier()
lldb::BreakpointPreconditionSP m_precondition_sp
bool HasResolvedLocations() const
Return whether this breakpoint has any resolved locations.
std::string m_kind_description
llvm::json::Value GetStatistics()
Get statistics associated with this breakpoint in JSON format.
void ClearAllBreakpointSites()
Tell this breakpoint to clear all its breakpoint sites.
BreakpointName::Permissions & GetPermissions()
const char * GetConditionText() const
Return a pointer to the text of the condition expression.
void SendBreakpointChangedEvent(lldb::BreakpointEventType eventKind)
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
bool GetMatchingFileLine(ConstString filename, uint32_t line_number, BreakpointLocationCollection &loc_coll)
Find breakpoint locations which match the (filename, line_number) description.
void SetOneShot(bool one_shot)
If one_shot is true, breakpoint will be deleted on first hit.
~Breakpoint() override
Destructor.
static const char * GetKey(OptionNames enum_value)
const Breakpoint & operator=(const Breakpoint &)=delete
uint32_t GetIgnoreCount() const
Return the current ignore count/.
lldb::BreakpointSP GetBreakpoint() const
bool IsOneShot() const
Check the OneShot state.
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.
void SetAutoContinue(bool auto_continue)
If auto_continue is true, breakpoint will auto-continue when on hit.
const char * GetThreadName() const
std::chrono::duration< double > Duration
bool GetAllowDelete() const
void GetResolverDescription(Stream *s)
void SetCondition(const char *condition)
Set the breakpoint's condition.
lldb::break_id_t FindLocationIDByAddress(const Address &addr)
Find a breakpoint location ID by Address.
lldb::BreakpointResolverSP m_resolver_sp
void SetPrecondition(lldb::BreakpointPreconditionSP precondition_sp)
Set a pre-condition filter that overrides all user provided filters/callbacks etc.
bool m_resolve_indirect_symbols
static lldb::BreakpointEventType GetBreakpointEventTypeFromEvent(const lldb::EventSP &event_sp)
lldb::BreakpointEventType GetBreakpointEventType() const
void GetFilterDescription(Stream *s)
bool EvaluatePrecondition(StoppointCallbackContext &context)
BreakpointLocationCollection & GetBreakpointLocationCollection()
virtual StructuredData::ObjectSP SerializeToStructuredData()
static const BreakpointEventData * GetEventDataFromEvent(const Event *event_sp)
static ConstString GetFlavorString()
General Outline: A breakpoint location is defined by the breakpoint that produces it,...
void Dump(Stream *s) const override
BreakpointName::Permissions m_permissions
static size_t GetNumBreakpointLocationsFromEvent(const lldb::EventSP &event_sp)
void SetQueueName(const char *queue_name)
std::unordered_set< std::string > m_name_list
bool AllowDisable() const
static llvm::raw_ostream & error(Stream &strm)
const Target & GetTarget() const
BreakpointLocationList m_locations
~BreakpointEventData() override
bool MatchesName(const char *name)
lldb::BreakpointSP m_new_breakpoint_sp
Log * GetLogChannel() override
lldb::SearchFilterSP m_filter_sp
lldb::BreakpointLocationSP GetLocationAtIndex(size_t index)
Get breakpoint locations by index.
bool IsInternal() const
Tell whether this breakpoint is an "internal" breakpoint.
MatchType
An enum specifying the match style for breakpoint settings.
const char * GetBreakpointKind() const
Return the "kind" description for a breakpoint.
std::shared_ptr< Object > ObjectSP
const char * GetQueueName() const
void SetIgnoreCount(uint32_t count)
Set the breakpoint to ignore the next count breakpoint hits.
bool GetAllowList() const
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 lifesp...
bool InvokeCallback(StoppointCallbackContext *context, lldb::break_id_t bp_loc_id)
Invoke the callback action when the breakpoint is hit.
lldb::BreakpointResolverSP GetResolver()
ConstString GetFlavor() const override
string(SUBSTRING ${p} 10 -1 pStripped) if($
size_t GetNumResolvedLocations() const
Return the number of breakpoint locations that have resolved to actual breakpoint sites.
uint32_t GetThreadIndex() const
lldb::BreakpointEventType m_breakpoint_event
BreakpointOptions m_options
void SetThreadID(lldb::tid_t thread_id)
Set the valid thread to be checked when the breakpoint is hit.
void SetThreadIndex(uint32_t index)
void RemoveInvalidLocations(const ArchSpec &arch)
Removes all invalid breakpoint locations.
lldb::tid_t GetThreadID() const
Return the current stop thread value.
StatsDuration::Duration GetResolveTime() const
Get the time it took to resolve all locations in this breakpoint.
static lldb::BreakpointSP CopyFromBreakpoint(lldb::TargetSP new_target, const Breakpoint &bp_to_copy_from)
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 loc...
void SetEnabled(bool enable) override
If enable is true, enable the breakpoint, if false disable it.
static const char * BreakpointEventTypeAsCString(lldb::BreakpointEventType type)
static const char * g_option_names[static_cast< uint32_t >(OptionNames::LastOptionName)]
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...
lldb::BreakpointLocationSP AddLocation(const Address &addr, bool *new_location=nullptr)
Add a location to the breakpoint's location list.
static lldb::BreakpointLocationSP GetBreakpointLocationAtIndexFromEvent(const lldb::EventSP &event_sp, uint32_t loc_idx)
void SetCallback(BreakpointHitCallback callback, void *baton, bool is_synchronous=false)
Set the callback action invoked when the breakpoint is hit.
const BreakpointEventData & operator=(const BreakpointEventData &)=delete
lldb::BreakpointPreconditionSP GetPrecondition()
lldb::SearchFilterSP GetSearchFilter()
bool AddName(llvm::StringRef new_name)
void Dump(Stream *s) override
Standard "Dump" method. At present it does nothing.
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 breakpo...
StatsDuration m_resolve_time
static bool SerializedBreakpointMatchesNames(StructuredData::ObjectSP &bkpt_object_sp, std::vector< std::string > &names)
void ResolveBreakpoint()
Tell this breakpoint to scan it's target's module list and resolve any new locations that match the b...
A class that represents a running process on the host machine.
BreakpointLocationCollection m_locations
lldb::BreakpointLocationSP FindLocationByAddress(const Address &addr)
Find a breakpoint location by Address.
static lldb::BreakpointSP GetBreakpointFromEvent(const lldb::EventSP &event_sp)
StoppointHitCounter m_hit_counter
Number of times this breakpoint has been hit.
Target & GetTarget()
Accessor for the breakpoint Target.
size_t GetNumLocations() const
Return the number of breakpoint locations.
void RemoveName(const char *name_to_remove)
const lldb::TargetSP GetTargetSP()
void DecrementIgnoreCount()
bool GetAllowDisable() const
BreakpointEventData(lldb::BreakpointEventType sub_type, const lldb::BreakpointSP &new_breakpoint_sp)
static const char * GetSerializationKey()
bool IsEnabled() override
Check the Enable/Disable state.
static lldb::BreakpointSP CreateFromStructuredData(lldb::TargetSP target_sp, StructuredData::ObjectSP &data_object_sp, Status &error)
const BreakpointName::Permissions & GetPermissions() const
void GetNames(std::vector< std::string > &names)
lldb::BreakpointLocationSP FindLocationByID(lldb::break_id_t bp_loc_id)
Find a breakpoint location for a given breakpoint location ID.
bool IsAutoContinue() const
Check the AutoContinue state.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
uint32_t GetHitCount() const
Return the current hit count for all locations.
void ResetHitCount()
Resets the current hit count for all locations.
void SetThreadName(const char *thread_name)