LLDB mainline
|
"lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a watchpoint. More...
#include <WatchpointOptions.h>
Classes | |
class | CommandBaton |
struct | CommandData |
Public Member Functions | |
WatchpointOptions () | |
Default constructor. | |
WatchpointOptions (const WatchpointOptions &rhs) | |
WatchpointOptions (WatchpointHitCallback callback, void *baton, lldb::tid_t thread_id=LLDB_INVALID_THREAD_ID) | |
This constructor allows you to specify all the watchpoint options. | |
virtual | ~WatchpointOptions () |
const WatchpointOptions & | operator= (const WatchpointOptions &rhs) |
void | SetCallback (WatchpointHitCallback callback, const lldb::BatonSP &baton_sp, bool synchronous=false) |
Adds a callback to the watchpoint option set. | |
void | ClearCallback () |
Remove the callback from this option set. | |
bool | InvokeCallback (StoppointCallbackContext *context, lldb::user_id_t watch_id) |
Use this function to invoke the callback for a specific stop. | |
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. | |
const Baton * | GetBaton () const |
Fetch a const version of the baton from the callback. | |
const ThreadSpec * | GetThreadSpecNoCreate () const |
Return the current thread spec for this option. | |
ThreadSpec * | GetThreadSpec () |
Returns a pointer to the ThreadSpec for this option, creating it if it hasn't been created already. | |
void | SetThreadID (lldb::tid_t thread_id) |
void | GetDescription (Stream *s, lldb::DescriptionLevel level) const |
void | GetCallbackDescription (Stream *s, lldb::DescriptionLevel level) const |
Get description for callback only. | |
bool | HasCallback () |
Returns true if the watchpoint option has a callback set. | |
Static Public Member Functions | |
static WatchpointOptions * | CopyOptionsNoCallback (WatchpointOptions &rhs) |
static bool | NullCallback (void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id) |
This is the default empty callback. | |
Private Attributes | |
WatchpointHitCallback | m_callback |
lldb::BatonSP | m_callback_baton_sp |
bool | m_callback_is_synchronous = false |
std::unique_ptr< ThreadSpec > | m_thread_spec_up |
"lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a watchpoint.
Definition at line 25 of file WatchpointOptions.h.
WatchpointOptions::WatchpointOptions | ( | ) |
Default constructor.
The watchpoint is enabled, and has no condition, callback, ignore count, etc...
Definition at line 29 of file WatchpointOptions.cpp.
Referenced by CopyOptionsNoCallback().
WatchpointOptions::WatchpointOptions | ( | const WatchpointOptions & | rhs | ) |
Definition at line 33 of file WatchpointOptions.cpp.
References m_thread_spec_up.
lldb_private::WatchpointOptions::WatchpointOptions | ( | WatchpointHitCallback | callback, |
void * | baton, | ||
lldb::tid_t | thread_id = LLDB_INVALID_THREAD_ID |
||
) |
This constructor allows you to specify all the watchpoint options.
[in] | callback | This is the plugin for some code that gets run, returns true if we are to stop. |
[in] | baton | Client data that will get passed to the callback. |
[in] | thread_id | Only stop if thread_id hits the watchpoint. |
|
virtualdefault |
void WatchpointOptions::ClearCallback | ( | ) |
Remove the callback from this option set.
Definition at line 77 of file WatchpointOptions.cpp.
References m_callback, m_callback_baton_sp, m_callback_is_synchronous, and NullCallback().
Referenced by lldb_private::Watchpoint::ClearCallback(), and CopyOptionsNoCallback().
|
static |
Definition at line 52 of file WatchpointOptions.cpp.
References ClearCallback(), m_callback, m_callback_baton_sp, m_callback_is_synchronous, SetCallback(), and WatchpointOptions().
Baton * WatchpointOptions::GetBaton | ( | ) |
Fetch the baton from the callback.
Definition at line 83 of file WatchpointOptions.cpp.
References m_callback_baton_sp.
Referenced by CommandObjectWatchpointCommandList::DoExecute().
const Baton * WatchpointOptions::GetBaton | ( | ) | const |
Fetch a const version of the baton from the callback.
Definition at line 85 of file WatchpointOptions.cpp.
References m_callback_baton_sp.
void WatchpointOptions::GetCallbackDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level | ||
) | const |
Get description for callback only.
Definition at line 118 of file WatchpointOptions.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::Stream::EOL(), lldb_private::Stream::GetIndentLevel(), and m_callback_baton_sp.
Referenced by lldb_private::Watchpoint::DumpWithLevel(), and GetDescription().
void WatchpointOptions::GetDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level | ||
) | const |
Definition at line 127 of file WatchpointOptions.cpp.
References lldb::eDescriptionLevelBrief, lldb::eDescriptionLevelFull, lldb::eDescriptionLevelVerbose, lldb_private::Stream::EOL(), GetCallbackDescription(), GetThreadSpecNoCreate(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_thread_spec_up, and lldb_private::Stream::PutCString().
ThreadSpec * WatchpointOptions::GetThreadSpec | ( | ) |
Returns a pointer to the ThreadSpec for this option, creating it if it hasn't been created already.
This API is used for setting the ThreadSpec items for this WatchpointOptions.
Definition at line 107 of file WatchpointOptions.cpp.
References m_thread_spec_up.
Referenced by SetThreadID().
const ThreadSpec * WatchpointOptions::GetThreadSpecNoCreate | ( | ) | const |
Return the current thread spec for this option.
This will return nullptr if the no thread specifications have been set for this WatchpointOptions yet.
Definition at line 103 of file WatchpointOptions.cpp.
References m_thread_spec_up.
Referenced by GetDescription().
bool WatchpointOptions::HasCallback | ( | ) |
Returns true if the watchpoint option has a callback set.
Definition at line 99 of file WatchpointOptions.cpp.
References m_callback, and NullCallback().
bool WatchpointOptions::InvokeCallback | ( | StoppointCallbackContext * | context, |
lldb::user_id_t | watch_id | ||
) |
Use this function to invoke the callback for a specific stop.
[in] | context | The context in which the callback is to be invoked. This includes the stop event, the execution context of the stop (since you might hit the same watchpoint on multiple threads) and whether we are currently executing synchronous or asynchronous callbacks. |
[in] | watch_id | The watchpoint ID that owns this option set. |
Definition at line 89 of file WatchpointOptions.cpp.
References lldb_private::StoppointCallbackContext::is_synchronous, IsCallbackSynchronous(), m_callback, and m_callback_baton_sp.
Referenced by lldb_private::Watchpoint::InvokeCallback().
|
inline |
Used in InvokeCallback to tell whether it is the right time to run this kind of callback.
Definition at line 118 of file WatchpointOptions.h.
References m_callback_is_synchronous.
Referenced by InvokeCallback().
|
static |
This is the default empty callback.
Definition at line 22 of file WatchpointOptions.cpp.
Referenced by ClearCallback(), and HasCallback().
const WatchpointOptions & WatchpointOptions::operator= | ( | const WatchpointOptions & | rhs | ) |
Definition at line 41 of file WatchpointOptions.cpp.
References m_callback, m_callback_baton_sp, m_callback_is_synchronous, and m_thread_spec_up.
void WatchpointOptions::SetCallback | ( | WatchpointHitCallback | callback, |
const lldb::BatonSP & | baton_sp, | ||
bool | synchronous = false |
||
) |
Adds a callback to the watchpoint option set.
[in] | callback | The function to be called when the watchpoint gets hit. |
[in] | baton_sp | A baton which will get passed back to the callback when it is invoked. |
[in] | synchronous | Whether this is a synchronous or asynchronous callback. See discussion above. |
Definition at line 69 of file WatchpointOptions.cpp.
References m_callback, m_callback_baton_sp, and m_callback_is_synchronous.
Referenced by CopyOptionsNoCallback(), lldb_private::ScriptInterpreterLua::RegisterWatchpointCallback(), and lldb_private::Watchpoint::SetCallback().
void WatchpointOptions::SetThreadID | ( | lldb::tid_t | thread_id | ) |
Definition at line 114 of file WatchpointOptions.cpp.
References GetThreadSpec(), and lldb_private::ThreadSpec::SetTID().
|
private |
Definition at line 183 of file WatchpointOptions.h.
Referenced by ClearCallback(), CopyOptionsNoCallback(), HasCallback(), InvokeCallback(), operator=(), and SetCallback().
|
private |
Definition at line 184 of file WatchpointOptions.h.
Referenced by ClearCallback(), CopyOptionsNoCallback(), GetBaton(), GetCallbackDescription(), InvokeCallback(), operator=(), and SetCallback().
|
private |
Definition at line 185 of file WatchpointOptions.h.
Referenced by ClearCallback(), CopyOptionsNoCallback(), IsCallbackSynchronous(), operator=(), and SetCallback().
|
private |
Definition at line 187 of file WatchpointOptions.h.
Referenced by GetDescription(), GetThreadSpec(), GetThreadSpecNoCreate(), operator=(), and WatchpointOptions().