9#ifndef LLDB_BREAKPOINT_BREAKPOINTOPTIONS_H
10#define LLDB_BREAKPOINT_BREAKPOINTOPTIONS_H
58 static std::unique_ptr<CommandData>
91 unsigned indentation)
const override;
117 int32_t ignore = 0,
bool one_shot =
false,
118 bool auto_continue =
false);
127 static std::unique_ptr<BreakpointOptions>
190 bool synchronous =
false);
372 void SetThreadSpec(std::unique_ptr<ThreadSpec> &thread_spec_up);
static llvm::raw_ostream & error(Stream &strm)
A class designed to wrap callback batons so they can cleanup any acquired resources.
CommandBaton(std::unique_ptr< CommandData > Data)
void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const override
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
bool IsCallbackSynchronous() const
Used in InvokeCallback to tell whether it is the right time to run this kind of callback.
bool InvokeCallback(StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
Use this function to invoke the callback for a specific stop.
void ClearCallback()
Remove the callback from this option set.
Flags m_set_flags
Which options are set at this level.
bool IsOptionSet(OptionKind kind)
void SetIgnoreCount(uint32_t n)
Set the breakpoint to ignore the next count breakpoint hits.
void SetCondition(StopCondition condition)
Set the breakpoint stop condition.
void SetEnabled(bool enabled)
If enable is true, enable the breakpoint, if false disable it.
const StopCondition & GetCondition() const
Return the breakpoint condition.
bool GetCommandLineCallbacks(StringList &command_list)
Returns the command line commands for the callback on this breakpoint.
std::shared_ptr< CommandBaton > CommandBatonSP
static const char * GetKey(OptionNames enum_value)
friend class BreakpointLocation
Baton * GetBaton()
Fetch the baton from the callback.
friend class BreakpointName
static bool BreakpointOptionsCallbackFunction(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
bool IsOneShot() const
Check the One-shot state.
bool IsEnabled() const
Check the Enable/Disable state.
virtual StructuredData::ObjectSP SerializeToStructuredData()
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
bool m_one_shot
If set, the breakpoint delete itself after being hit once.
static const char * g_option_names[(size_t) OptionNames::LastOptionName]
bool m_callback_is_synchronous
uint32_t GetIgnoreCount() const
Return the current Ignore Count.
bool IsAutoContinue() const
Check the auto-continue state.
bool m_baton_is_command_baton
lldb::BatonSP m_callback_baton_sp
This is the client data for the callback.
ThreadSpec * GetThreadSpec()
Returns a pointer to the ThreadSpec for this option, creating it.
StopCondition m_condition
The condition to test.
void SetOneShot(bool one_shot)
If enable is true, enable the breakpoint, if false disable it.
const ThreadSpec * GetThreadSpecNoCreate() const
Return the current thread spec for this option.
std::unique_ptr< ThreadSpec > m_thread_spec_up
Thread for which this breakpoint will stop.
void SetAutoContinue(bool auto_continue)
Set the auto-continue state.
BreakpointHitCallback m_callback
For BreakpointOptions only.
bool m_inject_condition
If set, inject breakpoint condition into process.
bool m_auto_continue
If set, auto-continue from breakpoint.
static std::unique_ptr< BreakpointOptions > CreateFromStructuredData(Target &target, const StructuredData::Dictionary &data_dict, Status &error)
virtual ~BreakpointOptions()
uint32_t m_ignore_count
Number of times to ignore this breakpoint.
void SetThreadID(lldb::tid_t thread_id)
void CopyOverSetOptions(const BreakpointOptions &rhs)
Copy over only the options set in the incoming BreakpointOptions.
BreakpointOptions(const char *condition, bool enabled=true, int32_t ignore=0, bool one_shot=false, bool auto_continue=false)
This constructor allows you to specify all the breakpoint options except the callback.
bool HasCallback() const
Check if the breakpoint option has a callback set.
static const char * GetSerializationKey()
const BreakpointOptions & operator=(const BreakpointOptions &rhs)
void SetCommandDataCallback(std::unique_ptr< CommandData > &cmd_data)
Set a callback based on BreakpointOptions::CommandData.
static bool NullCallback(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
This is the default empty callback.
void SetThreadSpec(std::unique_ptr< ThreadSpec > &thread_spec_up)
void SetCallback(BreakpointHitCallback callback, const lldb::BatonSP &baton_sp, bool synchronous=false)
Adds a callback to the breakpoint option set.
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
TypedBaton(std::unique_ptr< CommandData > Item)
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
ScriptLanguage
Script interpreter types.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::Baton > BatonSP
enum lldb::ScriptLanguage interpreter
std::string script_source
static std::unique_ptr< CommandData > CreateFromStructuredData(const StructuredData::Dictionary &options_dict, Status &error)
static const char * GetSerializationKey()
StructuredData::ObjectSP SerializeToStructuredData()
virtual ~CommandData()=default
CommandData(const StringList &user_source, lldb::ScriptLanguage interp)
static const char * GetKey(OptionNames enum_value)
static const char * g_option_names[static_cast< uint32_t >(OptionNames::LastOptionName)]