34 : m_callback(rhs.m_callback), m_callback_baton_sp(rhs.m_callback_baton_sp),
35 m_callback_is_synchronous(rhs.m_callback_is_synchronous) {
60 orig.
SetCallback(orig_callback, orig_callback_baton_sp, orig_is_sync);
70 const BatonSP &callback_baton_sp,
71 bool callback_is_synchronous) {
159 unsigned indentation)
const {
163 s <<
", commands = %s"
164 << ((
data &&
data->user_source.GetSize() > 0) ?
"yes" :
"no");
169 s.indent(indentation);
170 s <<
"watchpoint commands:\n";
173 if (
data &&
data->user_source.GetSize() > 0) {
174 for (
const std::string &line :
data->user_source) {
175 s.indent(indentation);
179 s <<
"No commands.\n";
A class designed to wrap callback batons so they can cleanup any acquired resources.
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.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
size_t EOL()
Output and End of Line character to the stream.
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
void IndentMore(unsigned amount=2)
Increment the current indentation level.
unsigned GetIndentLevel() const
Get the current indentation level.
void SetTID(lldb::tid_t tid)
void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const override
"lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a watchpoint.
virtual ~WatchpointOptions()
const WatchpointOptions & operator=(const WatchpointOptions &rhs)
static WatchpointOptions * CopyOptionsNoCallback(WatchpointOptions &rhs)
void SetThreadID(lldb::tid_t thread_id)
void ClearCallback()
Remove the callback from this option set.
bool HasCallback()
Returns true if the watchpoint option has a callback set.
std::unique_ptr< ThreadSpec > m_thread_spec_up
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
static bool NullCallback(void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id)
This is the default empty callback.
bool InvokeCallback(StoppointCallbackContext *context, lldb::user_id_t watch_id)
Use this function to invoke the callback for a specific stop.
void SetCallback(WatchpointHitCallback callback, const lldb::BatonSP &baton_sp, bool synchronous=false)
Adds a callback to the watchpoint option set.
bool m_callback_is_synchronous
WatchpointHitCallback m_callback
void GetCallbackDescription(Stream *s, lldb::DescriptionLevel level) const
Get description for callback only.
lldb::BatonSP m_callback_baton_sp
WatchpointOptions()
Default constructor.
const ThreadSpec * GetThreadSpecNoCreate() const
Return the current thread spec for this option.
bool IsCallbackSynchronous()
Used in InvokeCallback to tell whether it is the right time to run this kind of callback.
Baton * GetBaton()
Fetch the baton from the callback.
ThreadSpec * GetThreadSpec()
Returns a pointer to the ThreadSpec for this option, creating it if it hasn't been created already.
A class that represents a running process on the host machine.
bool(* WatchpointHitCallback)(void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id)
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelVerbose
std::shared_ptr< lldb_private::Baton > BatonSP