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