30 m_enabled(false), m_is_hardware(hardware), m_is_watch_variable(false),
31 m_is_ephemeral(false), m_disabled_count(0), m_watch_read(0),
32 m_watch_write(0), m_watch_was_read(0), m_watch_was_written(0),
33 m_ignore_count(0), m_false_alarms(0), m_being_created(true) {
40 auto type_system_or_err =
42 if (
auto err = type_system_or_err.takeError()) {
44 "Failed to set type.");
46 if (
auto ts = *type_system_or_err)
48 ts->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 8 * size);
51 "Failed to set type. Typesystem is no longer live.");
68 bool is_synchronous) {
80 const BatonSP &callback_baton_sp,
81 bool is_synchronous) {
167 if (old_value_cstr && old_value_cstr[0])
168 s->
Printf(
"\n%sold value: %s", prefix, old_value_cstr);
170 const char *old_summary_cstr =
m_old_value_sp->GetSummaryAsCString();
171 if (old_summary_cstr && old_summary_cstr[0])
172 s->
Printf(
"\n%sold value: %s", prefix, old_summary_cstr);
178 if (new_value_cstr && new_value_cstr[0])
179 s->
Printf(
"\n%snew value: %s", prefix, new_value_cstr);
181 const char *new_summary_cstr =
m_new_value_sp->GetSummaryAsCString();
182 if (new_summary_cstr && new_summary_cstr[0])
183 s->
Printf(
"\n%snew value: %s", prefix, new_summary_cstr);
196 s->
Printf(
"Watchpoint %u: addr = 0x%8.8" PRIx64
197 " size = %u state = %s type = %s%s",
217 s->
Printf(
"\n hw_index = %i hit_count = %-4u ignore_count = %-4u",
256 : eWatchpointEventTypeDisabled);
287 if (condition ==
nullptr || condition[0] ==
'\0') {
313 lldb::WatchpointEventType eventKind) {
335 WatchpointEventType sub_type,
const WatchpointSP &new_watchpoint_sp)
336 : m_watchpoint_event(sub_type), m_new_watchpoint_sp(new_watchpoint_sp) {}
341 static ConstString g_flavor(
"Watchpoint::WatchpointEventData");
350 return m_new_watchpoint_sp;
355 return m_watchpoint_event;
363 const EventData *event_data =
event->GetData();
373 const EventSP &event_sp) {
377 return eWatchpointEventTypeInvalidType;
383 const EventSP &event_sp) {
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG_ERROR(log, error,...)
A section + offset based address class.
void BroadcastEvent(lldb::EventSP &event_sp)
Broadcast an event which has no associated data.
Generic representation of a type in a programming language.
A uniqued constant string class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
virtual ConstString GetFlavor() const =0
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
ExecutionContextScope * GetBestExecutionContextScope() const
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
uint32_t GetValue() const
void Decrement(uint32_t difference=1)
void Increment(uint32_t difference=1)
uint32_t GetHardwareIndex() const
lldb::break_id_t GetID() const
uint32_t GetHitCount() const
void SetHardwareIndex(uint32_t index)
StoppointHitCounter m_hit_counter
Number of times this breakpoint/watchpoint has been hit.
virtual lldb::addr_t GetLoadAddress() const
uint32_t m_byte_size
The size in bytes of stoppoint, e.g.
bool HardwareRequired() const
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
UserExpression * GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj, Status &error)
const lldb::ProcessSP & GetProcessSP() const
@ eBroadcastBitWatchpointChanged
llvm::Expected< lldb::TypeSystemSP > GetScratchTypeSystemForLanguage(lldb::LanguageType language, bool create_on_demand=true)
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, llvm::StringRef name, const Address &address, lldb::TypeSP &type_sp)
void ClearCallback()
Remove the callback from this option set.
bool InvokeCallback(StoppointCallbackContext *context, lldb::user_id_t watch_id)
Use this function to invoke the callback for a specific stop.
void SetCallback(WatchpointHitCallback callback, const lldb::BatonSP &baton_sp, bool synchronous=false)
Adds a callback to the watchpoint option set.
void GetCallbackDescription(Stream *s, lldb::DescriptionLevel level) const
Get description for callback only.
static lldb::WatchpointSP GetWatchpointFromEvent(const lldb::EventSP &event_sp)
lldb::WatchpointSP & GetWatchpoint()
lldb::WatchpointEventType GetWatchpointEventType() const
ConstString GetFlavor() const override
static ConstString GetFlavorString()
lldb::WatchpointSP m_new_watchpoint_sp
static lldb::WatchpointEventType GetWatchpointEventTypeFromEvent(const lldb::EventSP &event_sp)
void Dump(Stream *s) const override
static const WatchpointEventData * GetEventDataFromEvent(const Event *event_sp)
~WatchpointEventData() override
WatchpointEventData(lldb::WatchpointEventType sub_type, const lldb::WatchpointSP &new_watchpoint_sp)
bool IsWatchVariable() const
void SetCallback(WatchpointHitCallback callback, void *callback_baton, bool is_synchronous=false)
Set the callback action invoked when the watchpoint is hit.
Watchpoint(Target &target, lldb::addr_t addr, uint32_t size, const CompilerType *type, bool hardware=true)
bool CaptureWatchedValue(const ExecutionContext &exe_ctx)
void DumpSnapshots(Stream *s, const char *prefix=nullptr) const
uint32_t GetIgnoreCount() const
bool InvokeCallback(StoppointCallbackContext *context)
Invoke the callback action when the watchpoint is hit.
void SetIgnoreCount(uint32_t n)
std::unique_ptr< UserExpression > m_condition_up
void SetEnabled(bool enabled, bool notify=true)
bool IsHardware() const override
void Dump(Stream *s) const override
void SendWatchpointChangedEvent(lldb::WatchpointEventType eventKind)
std::string GetWatchSpec()
lldb::ValueObjectSP m_new_value_sp
bool IsDisabledDuringEphemeralMode()
lldb::ValueObjectSP m_old_value_sp
uint32_t m_disabled_count
bool ShouldStop(StoppointCallbackContext *context) override
void SetWatchSpec(const std::string &str)
void SetWatchVariable(bool val)
void TurnOffEphemeralMode()
const char * GetConditionText() const
Return a pointer to the text of the condition expression.
void GetDescription(Stream *s, lldb::DescriptionLevel level)
WatchpointOptions m_options
bool WatchpointRead() const
std::string m_watch_spec_str
void SetCondition(const char *condition)
Set the watchpoint's condition.
void SetWatchpointType(uint32_t type, bool notify=true)
void SetDeclInfo(const std::string &str)
bool WatchpointWrite() const
void DumpWithLevel(Stream *s, lldb::DescriptionLevel description_level) const
void IncrementFalseAlarmsAndReviseHitCount()
void TurnOnEphemeralMode()
#define LLDB_WATCH_TYPE_WRITE
#define LLDB_INVALID_INDEX32
#define LLDB_WATCH_TYPE_READ
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelVerbose
@ eLanguageTypeUnknown
Unknown or invalid language value.
@ eLanguageTypeC
Non-standardized C, such as K&R.
@ eEncodingUint
unsigned integer