LLDB  mainline
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
lldb_private::Watchpoint Class Reference

#include <Watchpoint.h>

Inheritance diagram for lldb_private::Watchpoint:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::Watchpoint:
Collaboration graph
[legend]

Classes

class  WatchpointEventData
 

Public Member Functions

 Watchpoint (Target &target, lldb::addr_t addr, uint32_t size, const CompilerType *type, bool hardware=true)
 
 ~Watchpoint () override
 
void IncrementFalseAlarmsAndReviseHitCount ()
 
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
 
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 IsWatchVariable () const
 
void SetWatchVariable (bool val)
 
bool CaptureWatchedValue (const ExecutionContext &exe_ctx)
 
void GetDescription (Stream *s, lldb::DescriptionLevel level)
 
void Dump (Stream *s) const override
 
void 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. More...
 
void SetCallback (WatchpointHitCallback callback, void *callback_baton, bool is_synchronous=false)
 Set the callback action invoked when the watchpoint is hit. More...
 
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. More...
 
void SetCondition (const char *condition)
 Set the watchpoint's condition. More...
 
const char * GetConditionText () const
 Return a pointer to the text of the condition expression. More...
 
void TurnOnEphemeralMode ()
 
void TurnOffEphemeralMode ()
 
bool IsDisabledDuringEphemeralMode ()
 
const CompilerTypeGetCompilerType ()
 
- Public Member Functions inherited from lldb_private::StoppointLocation
 StoppointLocation (lldb::break_id_t bid, lldb::addr_t m_addr, bool hardware)
 
 StoppointLocation (lldb::break_id_t bid, lldb::addr_t m_addr, uint32_t byte_size, bool hardware)
 
virtual ~StoppointLocation ()
 
virtual lldb::addr_t GetLoadAddress () const
 
virtual void SetLoadAddress (lldb::addr_t addr)
 
uint32_t GetByteSize () const
 
uint32_t GetHitCount () const
 
uint32_t GetHardwareIndex () const
 
bool HardwareRequired () const
 
virtual void SetHardwareIndex (uint32_t index)
 
lldb::break_id_t GetID () const
 

Private Member Functions

void ResetHitCount ()
 
void ResetHistoricValues ()
 
void SetID (lldb::watch_id_t id)
 
void SendWatchpointChangedEvent (lldb::WatchpointEventType eventKind)
 
void SendWatchpointChangedEvent (WatchpointEventData *data)
 
 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_was_read: 1
 
uint32_t m_watch_was_written: 1
 
uint32_t m_ignore_count
 
uint32_t m_false_alarms
 
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
 
bool m_being_created
 
std::unique_ptr< UserExpressionm_condition_up
 

Friends

class Target
 
class WatchpointList
 

Additional Inherited Members

- Protected Member Functions inherited from lldb_private::StoppointLocation
void IncrementHitCount ()
 
void DecrementHitCount ()
 
- Protected Attributes inherited from lldb_private::StoppointLocation
lldb::break_id_t m_loc_id
 
lldb::addr_t m_addr
 
bool m_hardware
 
uint32_t m_hardware_index
 
uint32_t m_byte_size
 
uint32_t m_hit_count
 

Detailed Description

Definition at line 24 of file Watchpoint.h.

Constructor & Destructor Documentation

◆ Watchpoint() [1/2]

Watchpoint::Watchpoint ( Target target,
lldb::addr_t  addr,
uint32_t  size,
const CompilerType type,
bool  hardware = true 
)

◆ ~Watchpoint()

Watchpoint::~Watchpoint ( )
overridedefault

Referenced by Watchpoint().

◆ Watchpoint() [2/2]

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

Member Function Documentation

◆ CaptureWatchedValue()

bool Watchpoint::CaptureWatchedValue ( const ExecutionContext exe_ctx)

◆ ClearCallback()

void Watchpoint::ClearCallback ( )

◆ Dump()

void Watchpoint::Dump ( Stream s) const
overridevirtual

Reimplemented from lldb_private::StoppointLocation.

Definition at line 149 of file Watchpoint.cpp.

References DumpWithLevel(), and lldb::eDescriptionLevelBrief.

◆ DumpSnapshots()

void Watchpoint::DumpSnapshots ( Stream s,
const char *  prefix = nullptr 
) const

◆ DumpWithLevel()

void Watchpoint::DumpWithLevel ( Stream s,
lldb::DescriptionLevel  description_level 
) const

◆ GetCompilerType()

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

Definition at line 155 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 301 of file Watchpoint.cpp.

References m_condition_up.

Referenced by DumpWithLevel(), and GetOptions().

◆ GetDescription()

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

◆ GetError()

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

Definition at line 98 of file Watchpoint.h.

References m_error.

◆ GetIgnoreCount()

uint32_t Watchpoint::GetIgnoreCount ( ) const

Definition at line 269 of file Watchpoint.cpp.

References m_ignore_count.

Referenced by DumpWithLevel().

◆ GetOptions()

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

◆ GetTarget()

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

Definition at line 97 of file Watchpoint.h.

References m_target.

Referenced by SendWatchpointChangedEvent().

◆ GetWatchSpec()

std::string Watchpoint::GetWatchSpec ( )

Definition at line 90 of file Watchpoint.cpp.

References m_watch_spec_str.

◆ IncrementFalseAlarmsAndReviseHitCount()

void Watchpoint::IncrementFalseAlarmsAndReviseHitCount ( )

Definition at line 123 of file Watchpoint.cpp.

References m_false_alarms, and lldb_private::StoppointLocation::m_hit_count.

◆ 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 278 of file Watchpoint.cpp.

References lldb_private::StoppointLocation::GetID(), lldb_private::WatchpointOptions::InvokeCallback(), and m_options.

Referenced by GetOptions().

◆ IsDisabledDuringEphemeralMode()

bool Watchpoint::IsDisabledDuringEphemeralMode ( )

Definition at line 233 of file Watchpoint.cpp.

References m_disabled_count, and m_is_ephemeral.

Referenced by GetOptions().

◆ IsEnabled()

bool Watchpoint::IsEnabled ( ) const

◆ IsHardware()

bool Watchpoint::IsHardware ( ) const
overridevirtual

◆ IsWatchVariable()

bool Watchpoint::IsWatchVariable ( ) const

Definition at line 100 of file Watchpoint.cpp.

References m_is_watch_variable.

◆ operator=()

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

◆ ResetHistoricValues()

void lldb_private::Watchpoint::ResetHistoricValues ( )
inlineprivate

Definition at line 163 of file Watchpoint.h.

References m_new_value_sp, and m_old_value_sp.

◆ ResetHitCount()

void lldb_private::Watchpoint::ResetHitCount ( )
inlineprivate

Definition at line 161 of file Watchpoint.h.

References lldb_private::StoppointLocation::m_hit_count.

◆ SendWatchpointChangedEvent() [1/2]

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

◆ SendWatchpointChangedEvent() [2/2]

void Watchpoint::SendWatchpointChangedEvent ( WatchpointEventData data)
private

◆ SetCallback() [1/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 64 of file Watchpoint.cpp.

References m_options, SendWatchpointChangedEvent(), and lldb_private::WatchpointOptions::SetCallback().

Referenced by GetOptions().

◆ SetCallback() [2/2]

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

◆ 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 282 of file Watchpoint.cpp.

References lldb::eLanguageTypeUnknown, lldb_private::Expression::eResultTypeAny, error(), lldb_private::Status::Fail(), lldb_private::Target::GetUserExpressionForLanguage(), m_condition_up, m_target, and SendWatchpointChangedEvent().

Referenced by GetOptions().

◆ SetDeclInfo()

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

Definition at line 88 of file Watchpoint.cpp.

References m_decl_str.

Referenced by CommandObjectWatchpointSetVariable::DoExecute().

◆ SetEnabled()

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

◆ SetID()

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

◆ SetIgnoreCount()

void Watchpoint::SetIgnoreCount ( uint32_t  n)

Definition at line 271 of file Watchpoint.cpp.

References m_ignore_count, and SendWatchpointChangedEvent().

◆ SetWatchpointType()

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

◆ SetWatchSpec()

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

Definition at line 92 of file Watchpoint.cpp.

References m_watch_spec_str.

Referenced by CommandObjectWatchpointSetVariable::DoExecute().

◆ SetWatchVariable()

void Watchpoint::SetWatchVariable ( bool  val)

Definition at line 102 of file Watchpoint.cpp.

References m_is_watch_variable.

Referenced by CommandObjectWatchpointSetVariable::DoExecute().

◆ ShouldStop()

bool Watchpoint::ShouldStop ( StoppointCallbackContext context)
overridevirtual

◆ TurnOffEphemeralMode()

void Watchpoint::TurnOffEphemeralMode ( )

Definition at line 227 of file Watchpoint.cpp.

References m_disabled_count, and m_is_ephemeral.

Referenced by GetOptions().

◆ TurnOnEphemeralMode()

void Watchpoint::TurnOnEphemeralMode ( )

Definition at line 225 of file Watchpoint.cpp.

References m_is_ephemeral.

Referenced by GetOptions().

◆ WatchpointRead()

bool Watchpoint::WatchpointRead ( ) const

◆ WatchpointWrite()

bool Watchpoint::WatchpointWrite ( ) const

Friends And Related Function Documentation

◆ Target

friend class Target
friend

Definition at line 158 of file Watchpoint.h.

◆ WatchpointList

friend class WatchpointList
friend

Definition at line 159 of file Watchpoint.h.

Member Data Documentation

◆ m_being_created

bool lldb_private::Watchpoint::m_being_created
private

Definition at line 198 of file Watchpoint.h.

Referenced by SendWatchpointChangedEvent(), and Watchpoint().

◆ m_condition_up

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

Definition at line 200 of file Watchpoint.h.

Referenced by GetConditionText(), and SetCondition().

◆ m_decl_str

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

Definition at line 188 of file Watchpoint.h.

Referenced by DumpWithLevel(), and SetDeclInfo().

◆ m_disabled_count

uint32_t lldb_private::Watchpoint::m_disabled_count
private

Definition at line 176 of file Watchpoint.h.

Referenced by IsDisabledDuringEphemeralMode(), SetEnabled(), and TurnOffEphemeralMode().

◆ m_enabled

bool lldb_private::Watchpoint::m_enabled
private

Definition at line 169 of file Watchpoint.h.

Referenced by IsEnabled(), and SetEnabled().

◆ m_error

Status lldb_private::Watchpoint::m_error
private

Definition at line 193 of file Watchpoint.h.

Referenced by GetError().

◆ m_false_alarms

uint32_t lldb_private::Watchpoint::m_false_alarms
private

Definition at line 187 of file Watchpoint.h.

Referenced by IncrementFalseAlarmsAndReviseHitCount().

◆ m_ignore_count

uint32_t lldb_private::Watchpoint::m_ignore_count
private

Definition at line 186 of file Watchpoint.h.

Referenced by GetIgnoreCount(), and SetIgnoreCount().

◆ 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 170 of file Watchpoint.h.

Referenced by IsHardware().

◆ m_is_watch_variable

bool lldb_private::Watchpoint::m_is_watch_variable
private

Definition at line 171 of file Watchpoint.h.

Referenced by IsWatchVariable(), and SetWatchVariable().

◆ m_new_value_sp

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

Definition at line 191 of file Watchpoint.h.

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

◆ m_old_value_sp

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

Definition at line 190 of file Watchpoint.h.

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

◆ m_options

WatchpointOptions lldb_private::Watchpoint::m_options
private

Definition at line 196 of file Watchpoint.h.

Referenced by ClearCallback(), DumpWithLevel(), GetOptions(), InvokeCallback(), and SetCallback().

◆ m_target

Target& lldb_private::Watchpoint::m_target
private

Definition at line 168 of file Watchpoint.h.

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

◆ m_type

CompilerType lldb_private::Watchpoint::m_type
private

Definition at line 192 of file Watchpoint.h.

Referenced by CaptureWatchedValue(), GetCompilerType(), and Watchpoint().

◆ m_watch_read

uint32_t lldb_private::Watchpoint::m_watch_read
private

Definition at line 181 of file Watchpoint.h.

Referenced by DumpWithLevel(), SetWatchpointType(), and WatchpointRead().

◆ m_watch_spec_str

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

Definition at line 189 of file Watchpoint.h.

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

◆ m_watch_was_read

uint32_t lldb_private::Watchpoint::m_watch_was_read
private

Definition at line 181 of file Watchpoint.h.

◆ m_watch_was_written

uint32_t lldb_private::Watchpoint::m_watch_was_written
private

Definition at line 181 of file Watchpoint.h.

◆ m_watch_write

uint32_t lldb_private::Watchpoint::m_watch_write
private

Definition at line 181 of file Watchpoint.h.

Referenced by DumpWithLevel(), SetWatchpointType(), and WatchpointWrite().


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