LLDB  mainline
Classes | Public Member Functions | 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
 
void SetHardwareIndex (uint32_t index)
 
lldb::break_id_t GetID () const
 

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()

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

◆ ~Watchpoint()

Watchpoint::~Watchpoint ( )
overridedefault

Referenced by Watchpoint().

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 140 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 159 of file Watchpoint.h.

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

References lldb_private::Broadcaster::BroadcastEvent(), lldb_private::Target::eBroadcastBitWatchpointChanged, and GetTarget().

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.

◆ GetIgnoreCount()

uint32_t Watchpoint::GetIgnoreCount ( ) const

Definition at line 260 of file Watchpoint.cpp.

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.

Referenced by GetConditionText().

◆ GetWatchSpec()

std::string Watchpoint::GetWatchSpec ( )

Definition at line 81 of file Watchpoint.cpp.

◆ IncrementFalseAlarmsAndReviseHitCount()

void Watchpoint::IncrementFalseAlarmsAndReviseHitCount ( )

Definition at line 114 of file Watchpoint.cpp.

References 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 269 of file Watchpoint.cpp.

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

Referenced by GetOptions().

◆ IsDisabledDuringEphemeralMode()

bool Watchpoint::IsDisabledDuringEphemeralMode ( )

Definition at line 224 of file Watchpoint.cpp.

Referenced by GetOptions().

◆ IsEnabled()

bool Watchpoint::IsEnabled ( ) const

◆ IsHardware()

bool Watchpoint::IsHardware ( ) const
overridevirtual

◆ IsWatchVariable()

bool Watchpoint::IsWatchVariable ( ) const

Definition at line 91 of file Watchpoint.cpp.

◆ 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.
Returns
true if the process should stop when you hit the watchpoint. false if it should continue.

Definition at line 55 of file Watchpoint.cpp.

References 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 273 of file Watchpoint.cpp.

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

Referenced by GetOptions().

◆ SetDeclInfo()

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

Definition at line 79 of file Watchpoint.cpp.

Referenced by CommandObjectWatchpointSetVariable::DoExecute().

◆ SetEnabled()

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

◆ SetIgnoreCount()

void Watchpoint::SetIgnoreCount ( uint32_t  n)

Definition at line 262 of file Watchpoint.cpp.

◆ SetWatchpointType()

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

Definition at line 246 of file Watchpoint.cpp.

References LLDB_WATCH_TYPE_READ, and LLDB_WATCH_TYPE_WRITE.

◆ SetWatchSpec()

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

Definition at line 83 of file Watchpoint.cpp.

Referenced by CommandObjectWatchpointSetVariable::DoExecute().

◆ SetWatchVariable()

void Watchpoint::SetWatchVariable ( bool  val)

Definition at line 93 of file Watchpoint.cpp.

Referenced by CommandObjectWatchpointSetVariable::DoExecute().

◆ ShouldStop()

bool Watchpoint::ShouldStop ( StoppointCallbackContext context)
overridevirtual

◆ TurnOffEphemeralMode()

void Watchpoint::TurnOffEphemeralMode ( )

Definition at line 218 of file Watchpoint.cpp.

Referenced by GetOptions().

◆ TurnOnEphemeralMode()

void Watchpoint::TurnOnEphemeralMode ( )

Definition at line 216 of file Watchpoint.cpp.

Referenced by GetOptions().

◆ WatchpointRead()

bool Watchpoint::WatchpointRead ( ) const

Definition at line 256 of file Watchpoint.cpp.

Referenced by FreeBSDThread::EnableHardwareWatchpoint(), and GetGDBStoppointType().

◆ WatchpointWrite()

bool Watchpoint::WatchpointWrite ( ) const

Definition at line 258 of file Watchpoint.cpp.

Referenced by FreeBSDThread::EnableHardwareWatchpoint(), and GetGDBStoppointType().

Friends And Related Function Documentation

◆ Target

friend class Target
friend

Definition at line 162 of file Watchpoint.h.

◆ WatchpointList

friend class WatchpointList
friend

Definition at line 163 of file Watchpoint.h.


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