LLDB mainline
|
#include <Watchpoint.h>
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 |
void | DumpSnapshots (Stream *s, const char *prefix=nullptr) const |
void | DumpWithLevel (Stream *s, lldb::DescriptionLevel description_level) const |
Target & | GetTarget () |
const Status & | GetError () |
WatchpointOptions * | GetOptions () |
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 CompilerType & | GetCompilerType () |
![]() | |
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 |
virtual bool | IsHardware () const =0 |
uint32_t | GetHardwareIndex () const |
void | SetHardwareIndex (uint32_t index) |
virtual bool | ShouldStop (StoppointCallbackContext *context)=0 |
virtual void | Dump (Stream *stream) const =0 |
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) |
void | SendWatchpointChangedEvent (WatchpointEventData *data) |
Watchpoint (const Watchpoint &)=delete | |
const Watchpoint & | operator= (const Watchpoint &)=delete |
Private Attributes | |
Target & | m_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 |
bool | m_being_created |
std::unique_ptr< UserExpression > | m_condition_up |
Friends | |
class | Target |
class | WatchpointList |
class | StopInfoWatchpoint |
Additional Inherited Members | |
![]() | |
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_hardware_index |
The hardware resource index for this breakpoint/watchpoint. | |
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. | |
Definition at line 24 of file Watchpoint.h.
Watchpoint::Watchpoint | ( | Target & | target, |
lldb::addr_t | addr, | ||
uint32_t | size, | ||
const CompilerType * | type, | ||
bool | hardware = true |
||
) |
Definition at line 27 of file Watchpoint.cpp.
References CaptureWatchedValue(), lldb::eEncodingUint, lldb::eLanguageTypeC, lldb_private::GetLog(), lldb_private::Target::GetProcessSP(), lldb_private::Target::GetScratchTypeSystemForLanguage(), lldb_private::CompilerType::IsValid(), LLDB_LOG_ERROR, m_being_created, m_target, m_type, and lldb_private::Watchpoints.
|
overridedefault |
|
privatedelete |
bool Watchpoint::CaptureWatchedValue | ( | const ExecutionContext & | exe_ctx | ) |
Definition at line 196 of file Watchpoint.cpp.
References lldb_private::ValueObjectMemory::Create(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::StoppointSite::GetLoadAddress(), lldb_private::ConstString::GetStringRef(), lldb_private::CompilerType::IsValid(), m_new_value_sp, m_old_value_sp, and m_type.
Referenced by Watchpoint().
void Watchpoint::ClearCallback | ( | ) |
Definition at line 174 of file Watchpoint.cpp.
References lldb_private::WatchpointOptions::ClearCallback(), m_options, and SendWatchpointChangedEvent().
Referenced by CommandObjectWatchpointCommandDelete::DoExecute().
|
overridevirtual |
Implements lldb_private::StoppointSite.
Definition at line 263 of file Watchpoint.cpp.
References DumpWithLevel(), and lldb::eDescriptionLevelBrief.
void Watchpoint::DumpSnapshots | ( | Stream * | s, |
const char * | prefix = nullptr |
||
) | const |
Definition at line 269 of file Watchpoint.cpp.
References lldb_private::StoppointSite::GetID(), m_new_value_sp, m_old_value_sp, and lldb_private::Stream::Printf().
Referenced by DumpWithLevel().
void Watchpoint::DumpWithLevel | ( | Stream * | s, |
lldb::DescriptionLevel | description_level | ||
) | const |
Definition at line 298 of file Watchpoint.cpp.
References DumpSnapshots(), lldb::eDescriptionLevelBrief, lldb::eDescriptionLevelFull, lldb::eDescriptionLevelVerbose, lldb_private::WatchpointOptions::GetCallbackDescription(), GetConditionText(), lldb_private::StoppointSite::GetHardwareIndex(), lldb_private::StoppointSite::GetHitCount(), lldb_private::StoppointSite::GetID(), GetIgnoreCount(), lldb_private::StoppointSite::GetLoadAddress(), IsEnabled(), lldb_private::StoppointSite::m_byte_size, m_decl_str, m_options, m_watch_modify, m_watch_read, m_watch_spec_str, m_watch_write, and lldb_private::Stream::Printf().
Referenced by Dump(), and GetDescription().
|
inline |
Definition at line 189 of file Watchpoint.h.
References m_type.
const char * Watchpoint::GetConditionText | ( | ) | const |
Return a pointer to the text of the condition expression.
Definition at line 420 of file Watchpoint.cpp.
References m_condition_up.
Referenced by DumpWithLevel().
void Watchpoint::GetDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level | ||
) |
Definition at line 259 of file Watchpoint.cpp.
References DumpWithLevel().
Referenced by AddWatchpointDescription().
|
inline |
Definition at line 132 of file Watchpoint.h.
References m_error.
uint32_t Watchpoint::GetIgnoreCount | ( | ) | const |
Definition at line 388 of file Watchpoint.cpp.
References m_ignore_count.
Referenced by DumpWithLevel().
|
inline |
Returns the WatchpointOptions structure set for this watchpoint.
Definition at line 138 of file Watchpoint.h.
References m_options.
Referenced by CommandObjectWatchpointCommandList::DoExecute().
|
inline |
Definition at line 131 of file Watchpoint.h.
References m_target.
Referenced by SendWatchpointChangedEvent().
std::string Watchpoint::GetWatchSpec | ( | ) |
Definition at line 181 of file Watchpoint.cpp.
References m_watch_spec_str.
bool Watchpoint::InvokeCallback | ( | StoppointCallbackContext * | context | ) |
Invoke the callback action when the watchpoint is hit.
[in] | context | Described the watchpoint event. |
Definition at line 397 of file Watchpoint.cpp.
References lldb_private::StoppointSite::GetID(), lldb_private::WatchpointOptions::InvokeCallback(), and m_options.
bool Watchpoint::IsDisabledDuringEphemeralMode | ( | ) |
Definition at line 347 of file Watchpoint.cpp.
References m_disabled_count, and m_is_ephemeral.
bool Watchpoint::IsEnabled | ( | ) | const |
Definition at line 332 of file Watchpoint.cpp.
References m_enabled.
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DisableWatchpoint(), lldb_private::ProcessWindows::DisableWatchpoint(), DumpWithLevel(), lldb_private::process_gdb_remote::ProcessGDBRemote::EnableWatchpoint(), lldb_private::ProcessWindows::EnableWatchpoint(), and ShouldStop().
|
overridevirtual |
Implements lldb_private::StoppointSite.
Definition at line 187 of file Watchpoint.cpp.
References lldb_private::StoppointSite::HardwareRequired(), lldbassert, and m_is_hardware.
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DisableWatchpoint().
bool Watchpoint::IsWatchVariable | ( | ) | const |
Definition at line 192 of file Watchpoint.cpp.
References m_is_watch_variable.
|
privatedelete |
|
inlineprivate |
Definition at line 196 of file Watchpoint.h.
References m_new_value_sp, and m_old_value_sp.
|
private |
Definition at line 427 of file Watchpoint.cpp.
References lldb_private::Broadcaster::BroadcastEvent(), lldb_private::Target::eBroadcastBitWatchpointChanged, GetTarget(), and m_being_created.
Referenced by ClearCallback(), SetCallback(), SetCondition(), SetEnabled(), SetIgnoreCount(), and SetWatchpointType().
|
private |
Definition at line 438 of file Watchpoint.cpp.
References lldb_private::Broadcaster::BroadcastEvent(), lldb_private::Target::eBroadcastBitWatchpointChanged, GetTarget(), and m_being_created.
void Watchpoint::SetCallback | ( | WatchpointHitCallback | callback, |
const lldb::BatonSP & | callback_baton_sp, | ||
bool | is_synchronous = false |
||
) |
Definition at line 79 of file Watchpoint.cpp.
References m_options, SendWatchpointChangedEvent(), and lldb_private::WatchpointOptions::SetCallback().
void Watchpoint::SetCallback | ( | WatchpointHitCallback | callback, |
void * | callback_baton, | ||
bool | is_synchronous = false |
||
) |
Set the callback action invoked when the watchpoint is hit.
[in] | callback | The method that will get called when the watchpoint is hit. |
[in] | callback_baton | A void * pointer that will get passed back to the callback function. |
[in] | is_synchronous | If 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 67 of file Watchpoint.cpp.
References m_options, SendWatchpointChangedEvent(), and lldb_private::WatchpointOptions::SetCallback().
void Watchpoint::SetCondition | ( | const char * | condition | ) |
Set the watchpoint's condition.
[in] | condition | The condition expression to evaluate when the watchpoint is hit. Pass in nullptr to clear the condition. |
Definition at line 401 of file Watchpoint.cpp.
References lldb::eLanguageTypeUnknown, lldb_private::Expression::eResultTypeAny, error(), lldb_private::Target::GetUserExpressionForLanguage(), m_condition_up, m_target, and SendWatchpointChangedEvent().
void Watchpoint::SetDeclInfo | ( | const std::string & | str | ) |
Definition at line 179 of file Watchpoint.cpp.
References m_decl_str.
void Watchpoint::SetEnabled | ( | bool | enabled, |
bool | notify = true |
||
) |
Definition at line 351 of file Watchpoint.cpp.
References LLDB_INVALID_INDEX32, m_disabled_count, m_enabled, m_is_ephemeral, SendWatchpointChangedEvent(), and lldb_private::StoppointSite::SetHardwareIndex().
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DisableWatchpoint(), lldb_private::ProcessWindows::DisableWatchpoint(), lldb_private::process_gdb_remote::ProcessGDBRemote::EnableWatchpoint(), and lldb_private::ProcessWindows::EnableWatchpoint().
|
inlineprivate |
Definition at line 234 of file Watchpoint.h.
References lldb_private::StoppointSite::m_id.
void Watchpoint::SetIgnoreCount | ( | uint32_t | n | ) |
Definition at line 390 of file Watchpoint.cpp.
References m_ignore_count, and SendWatchpointChangedEvent().
bool Watchpoint::SetupVariableWatchpointDisabler | ( | lldb::StackFrameSP | frame_sp | ) | const |
Definition at line 86 of file Watchpoint.cpp.
References DoNoSelectMostRelevantFrame, lldb_private::StoppointSite::GetID(), lldb_private::Address::GetLoadAddress(), lldb_private::ExecutionContext::GetTargetSP(), LLDB_INVALID_ADDRESS, LLDB_INVALID_FRAME_ID, and VariableWatchpointDisabler().
void Watchpoint::SetWatchpointType | ( | uint32_t | type, |
bool | notify = true |
||
) |
Definition at line 369 of file Watchpoint.cpp.
References LLDB_WATCH_TYPE_MODIFY, LLDB_WATCH_TYPE_READ, LLDB_WATCH_TYPE_WRITE, m_watch_modify, m_watch_read, m_watch_write, and SendWatchpointChangedEvent().
void Watchpoint::SetWatchSpec | ( | const std::string & | str | ) |
Definition at line 183 of file Watchpoint.cpp.
References m_watch_spec_str.
void Watchpoint::SetWatchVariable | ( | bool | val | ) |
Definition at line 194 of file Watchpoint.cpp.
References m_is_watch_variable.
|
overridevirtual |
Implements lldb_private::StoppointSite.
Definition at line 253 of file Watchpoint.cpp.
References lldb_private::StoppointHitCounter::Increment(), IsEnabled(), and lldb_private::StoppointSite::m_hit_counter.
void Watchpoint::TurnOffEphemeralMode | ( | ) |
Definition at line 341 of file Watchpoint.cpp.
References m_disabled_count, and m_is_ephemeral.
void Watchpoint::TurnOnEphemeralMode | ( | ) |
Definition at line 339 of file Watchpoint.cpp.
References m_is_ephemeral.
|
inlineprivate |
Definition at line 201 of file Watchpoint.h.
References lldb_private::StoppointHitCounter::Decrement(), and lldb_private::StoppointSite::m_hit_counter.
|
static |
Callback routine to disable the watchpoint set on a local variable when it goes out of scope.
Definition at line 127 of file Watchpoint.cpp.
References lldb_private::Watchpoint::WatchpointVariableContext::exe_ctx, lldb_private::StoppointCallbackContext::exe_ctx_ref, lldb_private::GetLog(), lldb_private::ExecutionContextRef::GetTargetSP(), LLDB_INVALID_WATCH_ID, LLDB_LOGF, lldb_private::Watchpoint::WatchpointVariableContext::watch_id, and lldb_private::Watchpoints.
Referenced by SetupVariableWatchpointDisabler().
bool Watchpoint::WatchedValueReportable | ( | const ExecutionContext & | exe_ctx | ) |
Definition at line 215 of file Watchpoint.cpp.
References lldb_private::ValueObjectMemory::Create(), error(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::DataExtractor::GetByteSize(), lldb_private::DataExtractor::GetData(), lldb_private::DataExtractor::GetDataStart(), lldb_private::StoppointSite::GetLoadAddress(), lldb_private::ConstString::GetStringRef(), lldb_private::CompilerType::IsValid(), m_new_value_sp, m_type, m_watch_modify, and m_watch_read.
bool Watchpoint::WatchpointModify | ( | ) | const |
Definition at line 386 of file Watchpoint.cpp.
References m_watch_modify.
Referenced by GetGDBStoppointType().
bool Watchpoint::WatchpointRead | ( | ) | const |
Definition at line 382 of file Watchpoint.cpp.
References m_watch_read.
Referenced by lldb_private::ProcessWindows::EnableWatchpoint(), and GetGDBStoppointType().
bool Watchpoint::WatchpointWrite | ( | ) | const |
Definition at line 384 of file Watchpoint.cpp.
References m_watch_write.
Referenced by lldb_private::ProcessWindows::EnableWatchpoint(), and GetGDBStoppointType().
|
friend |
Definition at line 194 of file Watchpoint.h.
|
friend |
Definition at line 192 of file Watchpoint.h.
|
friend |
Definition at line 193 of file Watchpoint.h.
|
private |
Definition at line 230 of file Watchpoint.h.
Referenced by SendWatchpointChangedEvent(), and Watchpoint().
|
private |
Definition at line 232 of file Watchpoint.h.
Referenced by GetConditionText(), and SetCondition().
|
private |
Definition at line 220 of file Watchpoint.h.
Referenced by DumpWithLevel(), and SetDeclInfo().
|
private |
Definition at line 211 of file Watchpoint.h.
Referenced by IsDisabledDuringEphemeralMode(), SetEnabled(), and TurnOffEphemeralMode().
|
private |
Definition at line 204 of file Watchpoint.h.
Referenced by IsEnabled(), and SetEnabled().
|
private |
Definition at line 225 of file Watchpoint.h.
Referenced by GetError().
|
private |
Definition at line 219 of file Watchpoint.h.
Referenced by GetIgnoreCount(), and SetIgnoreCount().
|
private |
Definition at line 207 of file Watchpoint.h.
Referenced by IsDisabledDuringEphemeralMode(), SetEnabled(), TurnOffEphemeralMode(), and TurnOnEphemeralMode().
|
private |
Definition at line 205 of file Watchpoint.h.
Referenced by IsHardware().
|
private |
Definition at line 206 of file Watchpoint.h.
Referenced by IsWatchVariable(), and SetWatchVariable().
|
private |
Definition at line 223 of file Watchpoint.h.
Referenced by CaptureWatchedValue(), DumpSnapshots(), ResetHistoricValues(), and WatchedValueReportable().
|
private |
Definition at line 222 of file Watchpoint.h.
Referenced by CaptureWatchedValue(), DumpSnapshots(), and ResetHistoricValues().
|
private |
Definition at line 228 of file Watchpoint.h.
Referenced by ClearCallback(), DumpWithLevel(), GetOptions(), InvokeCallback(), and SetCallback().
|
private |
Definition at line 203 of file Watchpoint.h.
Referenced by GetTarget(), SetCondition(), and Watchpoint().
|
private |
Definition at line 224 of file Watchpoint.h.
Referenced by CaptureWatchedValue(), GetCompilerType(), WatchedValueReportable(), and Watchpoint().
|
private |
Definition at line 218 of file Watchpoint.h.
Referenced by DumpWithLevel(), SetWatchpointType(), WatchedValueReportable(), and WatchpointModify().
|
private |
Definition at line 216 of file Watchpoint.h.
Referenced by DumpWithLevel(), SetWatchpointType(), WatchedValueReportable(), and WatchpointRead().
|
private |
Definition at line 221 of file Watchpoint.h.
Referenced by DumpWithLevel(), GetWatchSpec(), and SetWatchSpec().
|
private |
Definition at line 217 of file Watchpoint.h.
Referenced by DumpWithLevel(), SetWatchpointType(), and WatchpointWrite().