LLDB  mainline
Classes | Public Member Functions | Static Public Member Functions | List of all members
lldb_private::WatchpointOptions Class Reference

"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. More...
 
 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. More...
 
virtual ~WatchpointOptions ()
 
const WatchpointOptionsoperator= (const WatchpointOptions &rhs)
 
void SetCallback (WatchpointHitCallback callback, const lldb::BatonSP &baton_sp, bool synchronous=false)
 Adds a callback to the watchpoint option set. More...
 
void ClearCallback ()
 Remove the callback from this option set. More...
 
bool InvokeCallback (StoppointCallbackContext *context, lldb::user_id_t watch_id)
 Use this function to invoke the callback for a specific stop. More...
 
bool IsCallbackSynchronous ()
 Used in InvokeCallback to tell whether it is the right time to run this kind of callback. More...
 
BatonGetBaton ()
 Fetch the baton from the callback. More...
 
const BatonGetBaton () const
 Fetch a const version of the baton from the callback. More...
 
const ThreadSpecGetThreadSpecNoCreate () const
 Return the current thread spec for this option. More...
 
ThreadSpecGetThreadSpec ()
 Returns a pointer to the ThreadSpec for this option, creating it. More...
 
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. More...
 
bool HasCallback ()
 Returns true if the watchpoint option has a callback set. More...
 

Static Public Member Functions

static WatchpointOptionsCopyOptionsNoCallback (WatchpointOptions &rhs)
 
static bool NullCallback (void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id)
 This is the default empty callback. More...
 

Detailed Description

"lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a watchpoint.

Definition at line 25 of file WatchpointOptions.h.

Constructor & Destructor Documentation

◆ WatchpointOptions() [1/3]

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() [2/3]

WatchpointOptions::WatchpointOptions ( const WatchpointOptions rhs)

Definition at line 34 of file WatchpointOptions.cpp.

References operator=().

◆ WatchpointOptions() [3/3]

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.

Parameters
[in]callbackThis is the plugin for some code that gets run, returns true if we are to stop.
[in]batonClient data that will get passed to the callback.
[in]thread_idOnly stop if thread_id hits the watchpoint.

◆ ~WatchpointOptions()

WatchpointOptions::~WatchpointOptions ( )
virtualdefault

Referenced by CopyOptionsNoCallback().

Member Function Documentation

◆ ClearCallback()

void WatchpointOptions::ClearCallback ( )

Remove the callback from this option set.

Definition at line 79 of file WatchpointOptions.cpp.

References NullCallback().

Referenced by lldb_private::Watchpoint::ClearCallback(), and CopyOptionsNoCallback().

◆ CopyOptionsNoCallback()

WatchpointOptions * WatchpointOptions::CopyOptionsNoCallback ( WatchpointOptions rhs)
static

◆ GetBaton() [1/2]

Baton * WatchpointOptions::GetBaton ( )

Fetch the baton from the callback.

Returns
The baton.

Definition at line 85 of file WatchpointOptions.cpp.

Referenced by CommandObjectWatchpointCommandList::DoExecute(), and IsCallbackSynchronous().

◆ GetBaton() [2/2]

const Baton * WatchpointOptions::GetBaton ( ) const

Fetch a const version of the baton from the callback.

Returns
The baton.

Definition at line 87 of file WatchpointOptions.cpp.

◆ GetCallbackDescription()

void WatchpointOptions::GetCallbackDescription ( Stream s,
lldb::DescriptionLevel  level 
) const

Get description for callback only.

Definition at line 120 of file WatchpointOptions.cpp.

References lldb_private::Stream::EOL().

Referenced by lldb_private::Watchpoint::DumpWithLevel(), GetDescription(), and IsCallbackSynchronous().

◆ GetDescription()

void WatchpointOptions::GetDescription ( Stream s,
lldb::DescriptionLevel  level 
) const

◆ GetThreadSpec()

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 option.

Definition at line 109 of file WatchpointOptions.cpp.

Referenced by IsCallbackSynchronous(), and SetThreadID().

◆ GetThreadSpecNoCreate()

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 Option yet.

Returns
The thread specification pointer for this option, or nullptr if none has been set yet.

Definition at line 105 of file WatchpointOptions.cpp.

Referenced by GetDescription(), and IsCallbackSynchronous().

◆ HasCallback()

bool WatchpointOptions::HasCallback ( )

Returns true if the watchpoint option has a callback set.

Definition at line 101 of file WatchpointOptions.cpp.

References NullCallback().

Referenced by IsCallbackSynchronous().

◆ InvokeCallback()

bool WatchpointOptions::InvokeCallback ( StoppointCallbackContext context,
lldb::user_id_t  watch_id 
)

Use this function to invoke the callback for a specific stop.

Parameters
[in]contextThe 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_idThe watchpoint ID that owns this option set.
Returns
The callback return value.

Definition at line 91 of file WatchpointOptions.cpp.

References lldb_private::StoppointCallbackContext::is_synchronous, and IsCallbackSynchronous().

Referenced by lldb_private::Watchpoint::InvokeCallback().

◆ IsCallbackSynchronous()

bool lldb_private::WatchpointOptions::IsCallbackSynchronous ( )
inline

Used in InvokeCallback to tell whether it is the right time to run this kind of callback.

Returns
The synchronicity of our callback.

Definition at line 124 of file WatchpointOptions.h.

References GetBaton(), GetCallbackDescription(), GetDescription(), GetThreadSpec(), GetThreadSpecNoCreate(), HasCallback(), NullCallback(), and SetThreadID().

Referenced by InvokeCallback().

◆ NullCallback()

bool WatchpointOptions::NullCallback ( void *  baton,
StoppointCallbackContext context,
lldb::user_id_t  watch_id 
)
static

This is the default empty callback.

Returns
The thread id for which the watchpoint hit will stop, LLDB_INVALID_THREAD_ID for all threads.

Definition at line 22 of file WatchpointOptions.cpp.

Referenced by ClearCallback(), HasCallback(), and IsCallbackSynchronous().

◆ operator=()

const WatchpointOptions & WatchpointOptions::operator= ( const WatchpointOptions rhs)

Definition at line 44 of file WatchpointOptions.cpp.

Referenced by WatchpointOptions().

◆ SetCallback()

void WatchpointOptions::SetCallback ( WatchpointHitCallback  callback,
const lldb::BatonSP &  baton_sp,
bool  synchronous = false 
)

Adds a callback to the watchpoint option set.

Parameters
[in]callbackThe function to be called when the watchpoint gets hit.
[in]baton_spA baton which will get passed back to the callback when it is invoked.
[in]synchronousWhether this is a synchronous or asynchronous callback. See discussion above.

Definition at line 71 of file WatchpointOptions.cpp.

Referenced by CopyOptionsNoCallback(), CommandObjectWatchpointCommandAdd::IOHandlerInputComplete(), lldb_private::ScriptInterpreterPythonImpl::IOHandlerInputComplete(), lldb_private::Watchpoint::SetCallback(), CommandObjectWatchpointCommandAdd::SetWatchpointCommandCallback(), and lldb_private::ScriptInterpreterPythonImpl::SetWatchpointCommandCallback().

◆ SetThreadID()

void WatchpointOptions::SetThreadID ( lldb::tid_t  thread_id)

Definition at line 116 of file WatchpointOptions.cpp.

References GetThreadSpec(), and lldb_private::ThreadSpec::SetTID().

Referenced by IsCallbackSynchronous().


The documentation for this class was generated from the following files: