9#ifndef LLDB_BREAKPOINT_BREAKPOINTOPTIONS_H
10#define LLDB_BREAKPOINT_BREAKPOINTOPTIONS_H
57 static std::unique_ptr<CommandData>
90 unsigned indentation)
const override;
116 int32_t ignore = 0,
bool one_shot =
false,
117 bool auto_continue =
false);
126 static std::unique_ptr<BreakpointOptions>
189 bool synchronous =
false);
374 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.
General Outline: A breakpoint location is defined by the breakpoint that produces it,...
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 SetEnabled(bool enabled)
If enable is true, enable the breakpoint, if false disable it.
void SetCondition(const char *condition)
Set the breakpoint option's 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)
Baton * GetBaton()
Fetch the baton from the callback.
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.
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.
std::string m_condition_text
The condition to test.
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.
size_t m_condition_text_hash
Its hash, so that locations know when the condition is updated.
const char * GetConditionText(size_t *hash=nullptr) const
Return a pointer to the text of the condition expression.
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: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
bool Test(ValueType bit) const
Test a single flag bit.
bool AnySet(ValueType mask) const
Test one or more flags.
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
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
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)]