LLDB mainline
lldb_private::Watchpoint Class Reference

#include <Watchpoint.h>

Inheritance diagram for lldb_private::Watchpoint:
[legend]

Classes

class  WatchpointEventData
class  WatchpointVariableBaton
struct  WatchpointVariableContext
 Represents the context of a watchpoint variable. More...

Public Member Functions

 Watchpoint (Target &target, lldb::addr_t addr, uint32_t size, const CompilerType *type, bool hardware=true)
 ~Watchpoint () override
bool IsEnabled () const
void SetEnabled (bool enabled, bool notify=true)
bool IsHardware () const override
bool ShouldStop (StoppointCallbackContext *context) override
bool WatchpointRead () const
bool WatchpointWrite () const
bool WatchpointModify () const
uint32_t GetIgnoreCount () const
void SetIgnoreCount (uint32_t n)
void SetWatchpointType (uint32_t type, bool notify=true)
void SetDeclInfo (const std::string &str)
std::string GetWatchSpec ()
void SetWatchSpec (const std::string &str)
bool WatchedValueReportable (const ExecutionContext &exe_ctx)
bool IsWatchVariable () const
void SetWatchVariable (bool val)
bool CaptureWatchedValue (const ExecutionContext &exe_ctx)
bool SetupVariableWatchpointDisabler (lldb::StackFrameSP frame_sp) const
void GetDescription (Stream *s, lldb::DescriptionLevel level)
void Dump (Stream *s) const override
bool DumpSnapshots (Stream *s, const char *prefix=nullptr) const
void DumpWithLevel (Stream *s, lldb::DescriptionLevel description_level) const
TargetGetTarget ()
const StatusGetError ()
WatchpointOptionsGetOptions ()
 Returns the WatchpointOptions structure set for this watchpoint.
void SetCallback (WatchpointHitCallback callback, void *callback_baton, bool is_synchronous=false)
 Set the callback action invoked when the watchpoint is hit.
void SetCallback (WatchpointHitCallback callback, const lldb::BatonSP &callback_baton_sp, bool is_synchronous=false)
void ClearCallback ()
bool InvokeCallback (StoppointCallbackContext *context)
 Invoke the callback action when the watchpoint is hit.
void SetCondition (const char *condition)
 Set the watchpoint's condition.
const char * GetConditionText () const
 Return a pointer to the text of the condition expression.
void TurnOnEphemeralMode ()
void TurnOffEphemeralMode ()
bool IsDisabledDuringEphemeralMode ()
const CompilerTypeGetCompilerType ()
Public Member Functions inherited from lldb_private::StoppointSite
 StoppointSite (lldb::break_id_t bid, lldb::addr_t m_addr, bool hardware)
 StoppointSite (lldb::break_id_t bid, lldb::addr_t m_addr, uint32_t byte_size, bool hardware)
virtual ~StoppointSite ()=default
virtual lldb::addr_t GetLoadAddress () const
virtual void SetLoadAddress (lldb::addr_t addr)
uint32_t GetByteSize () const
uint32_t GetHitCount () const
void ResetHitCount ()
bool HardwareRequired () const
lldb::break_id_t GetID () const

Static Public Member Functions

static bool VariableWatchpointDisabler (void *baton, lldb_private::StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
 Callback routine to disable the watchpoint set on a local variable when it goes out of scope.

Private Member Functions

void ResetHistoricValues ()
void UndoHitCount ()
void SetID (lldb::watch_id_t id)
void SendWatchpointChangedEvent (lldb::WatchpointEventType eventKind)
 Watchpoint (const Watchpoint &)=delete
const Watchpointoperator= (const Watchpoint &)=delete

Private Attributes

Targetm_target
bool m_enabled
bool m_is_hardware
bool m_is_watch_variable
bool m_is_ephemeral
uint32_t m_disabled_count
uint32_t m_watch_read: 1
uint32_t m_watch_write: 1
uint32_t m_watch_modify: 1
uint32_t m_ignore_count
std::string m_decl_str
std::string m_watch_spec_str
lldb::ValueObjectSP m_old_value_sp
lldb::ValueObjectSP m_new_value_sp
CompilerType m_type
Status m_error
WatchpointOptions m_options
std::unique_ptr< UserExpressionm_condition_up

Friends

class Target
class WatchpointList
class StopInfoWatchpoint

Additional Inherited Members

Protected Attributes inherited from lldb_private::StoppointSite
lldb::break_id_t m_id
 Stoppoint site ID.
lldb::addr_t m_addr
 The load address of this stop point.
bool m_is_hardware_required
 True if this point is required to use hardware (which may fail due to the lack of resources).
uint32_t m_byte_size
 The size in bytes of stoppoint, e.g.
StoppointHitCounter m_hit_counter
 Number of times this breakpoint/watchpoint has been hit.

Detailed Description

Definition at line 24 of file Watchpoint.h.

Constructor & Destructor Documentation

◆ Watchpoint() [1/2]

◆ ~Watchpoint()

Watchpoint::~Watchpoint ( )
overridedefault

◆ Watchpoint() [2/2]

lldb_private::Watchpoint::Watchpoint ( const Watchpoint & )
privatedelete

References Watchpoint().

Member Function Documentation

◆ CaptureWatchedValue()

◆ ClearCallback()

void Watchpoint::ClearCallback ( )

◆ Dump()

void Watchpoint::Dump ( Stream * s) const
overridevirtual

Implements lldb_private::StoppointSite.

Definition at line 269 of file Watchpoint.cpp.

References DumpWithLevel(), and lldb::eDescriptionLevelBrief.

◆ DumpSnapshots()

◆ DumpWithLevel()

◆ GetCompilerType()

const CompilerType & lldb_private::Watchpoint::GetCompilerType ( )
inline

Definition at line 189 of file Watchpoint.h.

References m_type.

◆ GetConditionText()

const char * Watchpoint::GetConditionText ( ) const

Return a pointer to the text of the condition expression.

Returns
A pointer to the condition expression text, or nullptr if no

Definition at line 477 of file Watchpoint.cpp.

References m_condition_up.

Referenced by DumpWithLevel().

◆ GetDescription()

void Watchpoint::GetDescription ( Stream * s,
lldb::DescriptionLevel level )

Definition at line 265 of file Watchpoint.cpp.

References DumpWithLevel().

Referenced by AddWatchpointDescription().

◆ GetError()

const Status & lldb_private::Watchpoint::GetError ( )
inline

Definition at line 132 of file Watchpoint.h.

References m_error.

◆ GetIgnoreCount()

uint32_t Watchpoint::GetIgnoreCount ( ) const

Definition at line 446 of file Watchpoint.cpp.

References m_ignore_count.

Referenced by DumpWithLevel().

◆ GetOptions()

WatchpointOptions * lldb_private::Watchpoint::GetOptions ( )
inline

Returns the WatchpointOptions structure set for this watchpoint.

Returns
A pointer to this watchpoint's WatchpointOptions.

Definition at line 138 of file Watchpoint.h.

References m_options.

Referenced by CommandObjectWatchpointCommandList::DoExecute().

◆ GetTarget()

Target & lldb_private::Watchpoint::GetTarget ( )
inline

Definition at line 131 of file Watchpoint.h.

References m_target, and Target.

Referenced by SendWatchpointChangedEvent().

◆ GetWatchSpec()

std::string Watchpoint::GetWatchSpec ( )

Definition at line 187 of file Watchpoint.cpp.

References m_watch_spec_str.

◆ InvokeCallback()

bool Watchpoint::InvokeCallback ( StoppointCallbackContext * context)

Invoke the callback action when the watchpoint is hit.

Parameters
[in]contextDescribed the watchpoint event.
Returns
true if the target should stop at this watchpoint and false not.

Definition at line 455 of file Watchpoint.cpp.

References lldb_private::StoppointSite::GetID(), and m_options.

◆ IsDisabledDuringEphemeralMode()

bool Watchpoint::IsDisabledDuringEphemeralMode ( )

Definition at line 407 of file Watchpoint.cpp.

References m_disabled_count, and m_is_ephemeral.

◆ IsEnabled()

bool Watchpoint::IsEnabled ( ) const

Definition at line 392 of file Watchpoint.cpp.

References m_enabled.

Referenced by DumpWithLevel(), and ShouldStop().

◆ IsHardware()

bool Watchpoint::IsHardware ( ) const
overridevirtual

◆ IsWatchVariable()

bool Watchpoint::IsWatchVariable ( ) const

Definition at line 198 of file Watchpoint.cpp.

References m_is_watch_variable.

◆ operator=()

const Watchpoint & lldb_private::Watchpoint::operator= ( const Watchpoint & )
privatedelete

References Watchpoint().

◆ ResetHistoricValues()

void lldb_private::Watchpoint::ResetHistoricValues ( )
inlineprivate

Definition at line 196 of file Watchpoint.h.

References m_new_value_sp, and m_old_value_sp.

◆ SendWatchpointChangedEvent()

void Watchpoint::SendWatchpointChangedEvent ( lldb::WatchpointEventType eventKind)
private

◆ SetCallback() [1/2]

void Watchpoint::SetCallback ( WatchpointHitCallback callback,
const lldb::BatonSP & callback_baton_sp,
bool is_synchronous = false )

Definition at line 85 of file Watchpoint.cpp.

References m_options, and SendWatchpointChangedEvent().

◆ SetCallback() [2/2]

void Watchpoint::SetCallback ( WatchpointHitCallback callback,
void * callback_baton,
bool is_synchronous = false )

Set the callback action invoked when the watchpoint is hit.

Parameters
[in]callbackThe method that will get called when the watchpoint is hit.
[in]callback_batonA void * pointer that will get passed back to the callback function.
[in]is_synchronousIf true the callback will be run on the private event thread before the stop event gets reported. If false, the callback will get handled on the public event thread after the stop has been posted.

Definition at line 73 of file Watchpoint.cpp.

References m_options, and SendWatchpointChangedEvent().

◆ SetCondition()

void Watchpoint::SetCondition ( const char * condition)

Set the watchpoint's condition.

Parameters
[in]conditionThe condition expression to evaluate when the watchpoint is hit. Pass in nullptr to clear the condition.

Definition at line 459 of file Watchpoint.cpp.

References lldb_private::Expression::eResultTypeAny, error(), m_condition_up, m_target, and SendWatchpointChangedEvent().

◆ SetDeclInfo()

void Watchpoint::SetDeclInfo ( const std::string & str)

Definition at line 185 of file Watchpoint.cpp.

References m_decl_str.

◆ SetEnabled()

void Watchpoint::SetEnabled ( bool enabled,
bool notify = true )

◆ SetID()

void lldb_private::Watchpoint::SetID ( lldb::watch_id_t id)
inlineprivate

Definition at line 231 of file Watchpoint.h.

References lldb_private::StoppointSite::m_id.

◆ SetIgnoreCount()

void Watchpoint::SetIgnoreCount ( uint32_t n)

Definition at line 448 of file Watchpoint.cpp.

References m_ignore_count, and SendWatchpointChangedEvent().

◆ SetupVariableWatchpointDisabler()

◆ SetWatchpointType()

void Watchpoint::SetWatchpointType ( uint32_t type,
bool notify = true )

◆ SetWatchSpec()

void Watchpoint::SetWatchSpec ( const std::string & str)

Definition at line 189 of file Watchpoint.cpp.

References m_watch_spec_str.

◆ SetWatchVariable()

void Watchpoint::SetWatchVariable ( bool val)

Definition at line 200 of file Watchpoint.cpp.

References m_is_watch_variable.

◆ ShouldStop()

bool Watchpoint::ShouldStop ( StoppointCallbackContext * context)
overridevirtual

◆ TurnOffEphemeralMode()

void Watchpoint::TurnOffEphemeralMode ( )

Definition at line 401 of file Watchpoint.cpp.

References m_disabled_count, and m_is_ephemeral.

◆ TurnOnEphemeralMode()

void Watchpoint::TurnOnEphemeralMode ( )

Definition at line 399 of file Watchpoint.cpp.

References m_is_ephemeral.

◆ UndoHitCount()

void lldb_private::Watchpoint::UndoHitCount ( )
inlineprivate

Definition at line 201 of file Watchpoint.h.

References lldb_private::StoppointSite::m_hit_counter.

◆ VariableWatchpointDisabler()

◆ WatchedValueReportable()

◆ WatchpointModify()

bool Watchpoint::WatchpointModify ( ) const

Definition at line 444 of file Watchpoint.cpp.

References m_watch_modify.

◆ WatchpointRead()

bool Watchpoint::WatchpointRead ( ) const

Definition at line 440 of file Watchpoint.cpp.

References m_watch_read.

◆ WatchpointWrite()

bool Watchpoint::WatchpointWrite ( ) const

Definition at line 442 of file Watchpoint.cpp.

References m_watch_write.

◆ StopInfoWatchpoint

friend class StopInfoWatchpoint
friend

Definition at line 194 of file Watchpoint.h.

References StopInfoWatchpoint.

Referenced by StopInfoWatchpoint.

◆ Target

friend class Target
friend

Definition at line 192 of file Watchpoint.h.

References Target.

Referenced by GetTarget(), Target, and Watchpoint().

◆ WatchpointList

friend class WatchpointList
friend

Definition at line 193 of file Watchpoint.h.

References WatchpointList.

Referenced by WatchpointList.

Member Data Documentation

◆ m_condition_up

std::unique_ptr<UserExpression> lldb_private::Watchpoint::m_condition_up
private

Definition at line 229 of file Watchpoint.h.

Referenced by GetConditionText(), and SetCondition().

◆ m_decl_str

std::string lldb_private::Watchpoint::m_decl_str
private

Definition at line 220 of file Watchpoint.h.

Referenced by DumpWithLevel(), and SetDeclInfo().

◆ m_disabled_count

uint32_t lldb_private::Watchpoint::m_disabled_count
private

◆ m_enabled

bool lldb_private::Watchpoint::m_enabled
private

Definition at line 204 of file Watchpoint.h.

Referenced by IsEnabled(), SetEnabled(), and Watchpoint().

◆ m_error

Status lldb_private::Watchpoint::m_error
private

Definition at line 225 of file Watchpoint.h.

Referenced by GetError().

◆ m_ignore_count

uint32_t lldb_private::Watchpoint::m_ignore_count
private

Definition at line 219 of file Watchpoint.h.

Referenced by GetIgnoreCount(), SetIgnoreCount(), and Watchpoint().

◆ m_is_ephemeral

bool lldb_private::Watchpoint::m_is_ephemeral
private

◆ m_is_hardware

bool lldb_private::Watchpoint::m_is_hardware
private

Definition at line 205 of file Watchpoint.h.

Referenced by IsHardware(), and Watchpoint().

◆ m_is_watch_variable

bool lldb_private::Watchpoint::m_is_watch_variable
private

Definition at line 206 of file Watchpoint.h.

Referenced by IsWatchVariable(), SetWatchVariable(), and Watchpoint().

◆ m_new_value_sp

lldb::ValueObjectSP lldb_private::Watchpoint::m_new_value_sp
private

◆ m_old_value_sp

lldb::ValueObjectSP lldb_private::Watchpoint::m_old_value_sp
private

Definition at line 222 of file Watchpoint.h.

Referenced by CaptureWatchedValue(), DumpSnapshots(), and ResetHistoricValues().

◆ m_options

WatchpointOptions lldb_private::Watchpoint::m_options
private

◆ m_target

Target& lldb_private::Watchpoint::m_target
private

Definition at line 203 of file Watchpoint.h.

Referenced by DumpWithLevel(), GetTarget(), SetCondition(), and Watchpoint().

◆ m_type

CompilerType lldb_private::Watchpoint::m_type
private

◆ m_watch_modify

uint32_t lldb_private::Watchpoint::m_watch_modify
private

◆ m_watch_read

uint32_t lldb_private::Watchpoint::m_watch_read
private

◆ m_watch_spec_str

std::string lldb_private::Watchpoint::m_watch_spec_str
private

Definition at line 221 of file Watchpoint.h.

Referenced by DumpWithLevel(), GetWatchSpec(), and SetWatchSpec().

◆ m_watch_write

uint32_t lldb_private::Watchpoint::m_watch_write
private

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