LLDB mainline
Watchpoint.cpp
Go to the documentation of this file.
1//===-- Watchpoint.cpp ----------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
13#include "lldb/Core/Value.h"
19#include "lldb/Target/Process.h"
20#include "lldb/Target/Target.h"
23#include "lldb/Utility/Log.h"
24#include "lldb/Utility/Stream.h"
25
26using namespace lldb;
27using namespace lldb_private;
28
29Watchpoint::Watchpoint(Target &target, lldb::addr_t addr, uint32_t size,
30 const CompilerType *type, bool hardware)
31 : StoppointSite(0, addr, size, hardware), m_target(target),
32 m_enabled(false), m_is_hardware(hardware), m_is_watch_variable(false),
33 m_is_ephemeral(false), m_disabled_count(0), m_watch_read(0),
34 m_watch_write(0), m_watch_modify(0), m_ignore_count(0) {
35
36 if (type && type->IsValid())
37 m_type = *type;
38 else {
39 // If we don't have a known type, then we force it to unsigned int of the
40 // right size.
41 auto type_system_or_err =
43 if (auto err = type_system_or_err.takeError()) {
45 "Failed to set type: {0}");
46 } else {
47 if (auto ts = *type_system_or_err) {
48 if (size <= target.GetArchitecture().GetAddressByteSize()) {
49 m_type =
50 ts->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 8 * size);
51 } else {
52 CompilerType clang_uint8_type =
53 ts->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 8);
54 m_type = clang_uint8_type.GetArrayType(size);
55 }
56 } else
58 "Failed to set type: Typesystem is no longer live: {0}");
59 }
60 }
61
62 // Set the initial value of the watched variable:
63 if (m_target.GetProcessSP()) {
64 ExecutionContext exe_ctx;
65 m_target.GetProcessSP()->CalculateExecutionContext(exe_ctx);
66 CaptureWatchedValue(exe_ctx);
67 }
68}
69
70Watchpoint::~Watchpoint() = default;
71
72// This function is used when "baton" doesn't need to be freed
74 bool is_synchronous) {
75 // The default "Baton" class will keep a copy of "baton" and won't free or
76 // delete it when it goes out of scope.
77 m_options.SetCallback(callback, std::make_shared<UntypedBaton>(baton),
78 is_synchronous);
79
80 SendWatchpointChangedEvent(eWatchpointEventTypeCommandChanged);
81}
82
83// This function is used when a baton needs to be freed and therefore is
84// contained in a "Baton" subclass.
86 const BatonSP &callback_baton_sp,
87 bool is_synchronous) {
88 m_options.SetCallback(callback, callback_baton_sp, is_synchronous);
89 SendWatchpointChangedEvent(eWatchpointEventTypeCommandChanged);
90}
91
93 if (!frame_sp)
94 return false;
95
96 ThreadSP thread_sp = frame_sp->GetThread();
97 if (!thread_sp)
98 return false;
99
100 uint32_t return_frame_index =
101 thread_sp->GetSelectedFrameIndex(DoNoSelectMostRelevantFrame) + 1;
102 if (return_frame_index >= LLDB_INVALID_FRAME_ID)
103 return false;
104
105 StackFrameSP return_frame_sp(
106 thread_sp->GetStackFrameAtIndex(return_frame_index));
107 if (!return_frame_sp)
108 return false;
109
110 ExecutionContext exe_ctx(return_frame_sp);
111 TargetSP target_sp = exe_ctx.GetTargetSP();
112 if (!target_sp)
113 return false;
114
115 Address return_address(return_frame_sp->GetFrameCodeAddress());
116 lldb::addr_t return_addr = return_address.GetLoadAddress(target_sp.get());
117 if (return_addr == LLDB_INVALID_ADDRESS)
118 return false;
119
120 BreakpointSP bp_sp = target_sp->CreateBreakpoint(
121 return_addr, /*internal=*/true, /*request_hardware=*/false);
122 if (!bp_sp || !bp_sp->HasResolvedLocations())
123 return false;
124
125 auto wvc_up = std::make_unique<WatchpointVariableContext>(GetID(), exe_ctx);
126 auto baton_sp = std::make_shared<WatchpointVariableBaton>(std::move(wvc_up));
127 bp_sp->SetCallback(VariableWatchpointDisabler, baton_sp);
128 bp_sp->SetOneShot(true);
129 bp_sp->SetBreakpointKind("variable watchpoint disabler");
130 return true;
131}
132
135 user_id_t break_id,
136 user_id_t break_loc_id) {
137 assert(baton && "null baton");
138 if (!baton || !context)
139 return false;
140
142
144 static_cast<WatchpointVariableContext *>(baton);
145
146 LLDB_LOGF(log, "called by breakpoint %" PRIu64 ".%" PRIu64, break_id,
147 break_loc_id);
148
150 return false;
151
152 TargetSP target_sp = context->exe_ctx_ref.GetTargetSP();
153 if (!target_sp)
154 return false;
155
156 ProcessSP process_sp = target_sp->GetProcessSP();
157 if (!process_sp)
158 return false;
159
160 WatchpointSP watch_sp =
161 target_sp->GetWatchpointList().FindByID(wvc->watch_id);
162 if (!watch_sp)
163 return false;
164
165 if (wvc->exe_ctx == context->exe_ctx_ref) {
166 LLDB_LOGF(log,
167 "callback for watchpoint %" PRId32
168 " matched internal breakpoint execution context",
169 watch_sp->GetID());
170 process_sp->DisableWatchpoint(watch_sp);
171 return false;
172 }
173 LLDB_LOGF(log,
174 "callback for watchpoint %" PRId32
175 " didn't match internal breakpoint execution context",
176 watch_sp->GetID());
177 return false;
178}
179
182 SendWatchpointChangedEvent(eWatchpointEventTypeCommandChanged);
183}
184
185void Watchpoint::SetDeclInfo(const std::string &str) { m_decl_str = str; }
186
188
189void Watchpoint::SetWatchSpec(const std::string &str) {
190 m_watch_spec_str = str;
191}
192
195 return m_is_hardware;
196}
197
199
201
203 ConstString g_watch_name("$__lldb__watch_value");
205 Address watch_address(GetLoadAddress());
206 if (!m_type.IsValid()) {
207 // Don't know how to report new & old values, since we couldn't make a
208 // scalar type for this watchpoint. This works around an assert in
209 // ValueObjectMemory::Create.
210 // FIXME: This should not happen, but if it does in some case we care about,
211 // we can go grab the value raw and print it as unsigned.
212 return false;
213 }
215 exe_ctx.GetBestExecutionContextScope(), g_watch_name.GetStringRef(),
216 watch_address, m_type);
217 m_new_value_sp = m_new_value_sp->CreateConstantValue(g_watch_name);
218 return (m_new_value_sp && m_new_value_sp->GetError().Success());
219}
220
223 return true;
224 if (!m_type.IsValid())
225 return true;
226
227 ConstString g_watch_name("$__lldb__watch_value");
228 Address watch_address(GetLoadAddress());
229 ValueObjectSP newest_valueobj_sp = ValueObjectMemory::Create(
230 exe_ctx.GetBestExecutionContextScope(), g_watch_name.GetStringRef(),
231 watch_address, m_type);
232 newest_valueobj_sp = newest_valueobj_sp->CreateConstantValue(g_watch_name);
234
235 DataExtractor new_data;
236 DataExtractor old_data;
237
238 newest_valueobj_sp->GetData(new_data, error);
239 if (error.Fail())
240 return true;
241 m_new_value_sp->GetData(old_data, error);
242 if (error.Fail())
243 return true;
244
245 if (new_data.GetByteSize() != old_data.GetByteSize() ||
246 new_data.GetByteSize() == 0)
247 return true;
248
249 if (memcmp(new_data.GetDataStart(), old_data.GetDataStart(),
250 old_data.GetByteSize()) == 0)
251 return false; // Value has not changed, user requested modify watchpoint
252
253 return true;
254}
255
256// RETURNS - true if we should stop at this breakpoint, false if we
257// should continue.
258
261
262 return IsEnabled();
263}
264
266 DumpWithLevel(s, level);
267}
268
269void Watchpoint::Dump(Stream *s) const {
271}
272
273// If prefix is nullptr, we display the watch id and ignore the prefix
274// altogether.
275bool Watchpoint::DumpSnapshots(Stream *s, const char *prefix) const {
276 bool printed_anything = false;
277
278 // For read watchpoints, don't display any before/after value changes.
280 return printed_anything;
281
282 s->Printf("\n");
283 s->Printf("Watchpoint %u hit:\n", GetID());
284
285 StreamString values_ss;
286 if (prefix)
287 values_ss.Indent(prefix);
288
289 if (m_old_value_sp) {
290 if (auto *old_value_cstr = m_old_value_sp->GetValueAsCString()) {
291 values_ss.Printf("old value: %s", old_value_cstr);
292 } else {
293 if (auto *old_summary_cstr = m_old_value_sp->GetSummaryAsCString())
294 values_ss.Printf("old value: %s", old_summary_cstr);
295 else {
296 StreamString strm;
299 .SetHideRootType(true)
300 .SetHideRootName(true)
301 .SetHideName(true);
302 m_old_value_sp->Dump(strm, options);
303 if (strm.GetData())
304 values_ss.Printf("old value: %s", strm.GetData());
305 }
306 }
307 }
308
309 if (m_new_value_sp) {
310 if (values_ss.GetSize())
311 values_ss.Printf("\n");
312
313 if (auto *new_value_cstr = m_new_value_sp->GetValueAsCString())
314 values_ss.Printf("new value: %s", new_value_cstr);
315 else {
316 if (auto *new_summary_cstr = m_new_value_sp->GetSummaryAsCString())
317 values_ss.Printf("new value: %s", new_summary_cstr);
318 else {
319 StreamString strm;
322 .SetHideRootType(true)
323 .SetHideRootName(true)
324 .SetHideName(true);
325 m_new_value_sp->Dump(strm, options);
326 if (strm.GetData())
327 values_ss.Printf("new value: %s", strm.GetData());
328 }
329 }
330 }
331
332 if (values_ss.GetSize()) {
333 s->Printf("%s", values_ss.GetData());
334 printed_anything = true;
335 }
336
337 return printed_anything;
338}
339
341 lldb::DescriptionLevel description_level) const {
342 if (s == nullptr)
343 return;
344
345 assert(description_level >= lldb::eDescriptionLevelBrief &&
346 description_level <= lldb::eDescriptionLevelVerbose);
347
348 s->Printf("Watchpoint %u: addr = 0x%8.8" PRIx64
349 " size = %u state = %s type = %s%s%s",
351 IsEnabled() ? "enabled" : "disabled", m_watch_read ? "r" : "",
352 m_watch_write ? "w" : "", m_watch_modify ? "m" : "");
353
354 if (description_level >= lldb::eDescriptionLevelFull) {
355 if (!m_decl_str.empty())
356 s->Printf("\n declare @ '%s'", m_decl_str.c_str());
357 if (!m_watch_spec_str.empty())
358 s->Printf("\n watchpoint spec = '%s'", m_watch_spec_str.c_str());
359 if (IsEnabled()) {
360 if (ProcessSP process_sp = m_target.GetProcessSP()) {
361 auto &resourcelist = process_sp->GetWatchpointResourceList();
362 size_t idx = 0;
363 s->Printf("\n watchpoint resources:");
364 for (WatchpointResourceSP &wpres : resourcelist.Sites()) {
365 if (wpres->ConstituentsContains(this)) {
366 s->Printf("\n #%zu: ", idx);
367 wpres->Dump(s);
368 }
369 idx++;
370 }
371 }
372 }
373
374 // Dump the snapshots we have taken.
375 DumpSnapshots(s, " ");
376
377 if (GetConditionText())
378 s->Printf("\n condition = '%s'", GetConditionText());
379 m_options.GetCallbackDescription(s, description_level);
380 }
381
382 if (description_level >= lldb::eDescriptionLevelVerbose) {
383 s->Printf("\n hit_count = %-4u ignore_count = %-4u", GetHitCount(),
385 }
386}
387
388bool Watchpoint::IsEnabled() const { return m_enabled; }
389
390// Within StopInfo.cpp, we purposely turn on the ephemeral mode right before
391// temporarily disable the watchpoint in order to perform possible watchpoint
392// actions without triggering further watchpoint events. After the temporary
393// disabled watchpoint is enabled, we then turn off the ephemeral mode.
394
396
398 m_is_ephemeral = false;
399 // Leaving ephemeral mode, reset the m_disabled_count!
401}
402
404 return m_disabled_count > 1 && m_is_ephemeral;
405}
406
407void Watchpoint::SetEnabled(bool enabled, bool notify) {
408 if (!enabled) {
409 if (m_is_ephemeral)
411
412 // Don't clear the snapshots for now.
413 // Within StopInfo.cpp, we purposely do disable/enable watchpoint while
414 // performing watchpoint actions.
415 }
416 bool changed = enabled != m_enabled;
417 m_enabled = enabled;
418 if (notify && !m_is_ephemeral && changed)
419 SendWatchpointChangedEvent(enabled ? eWatchpointEventTypeEnabled
420 : eWatchpointEventTypeDisabled);
421}
422
423void Watchpoint::SetWatchpointType(uint32_t type, bool notify) {
424 int old_watch_read = m_watch_read;
425 int old_watch_write = m_watch_write;
426 int old_watch_modify = m_watch_modify;
427 m_watch_read = (type & LLDB_WATCH_TYPE_READ) != 0;
428 m_watch_write = (type & LLDB_WATCH_TYPE_WRITE) != 0;
430 if (notify &&
431 (old_watch_read != m_watch_read || old_watch_write != m_watch_write ||
432 old_watch_modify != m_watch_modify))
433 SendWatchpointChangedEvent(eWatchpointEventTypeTypeChanged);
434}
435
436bool Watchpoint::WatchpointRead() const { return m_watch_read != 0; }
437
438bool Watchpoint::WatchpointWrite() const { return m_watch_write != 0; }
439
440bool Watchpoint::WatchpointModify() const { return m_watch_modify != 0; }
441
442uint32_t Watchpoint::GetIgnoreCount() const { return m_ignore_count; }
443
445 bool changed = m_ignore_count != n;
446 m_ignore_count = n;
447 if (changed)
448 SendWatchpointChangedEvent(eWatchpointEventTypeIgnoreChanged);
449}
450
452 return m_options.InvokeCallback(context, GetID());
453}
454
455void Watchpoint::SetCondition(const char *condition) {
456 if (condition == nullptr || condition[0] == '\0') {
457 if (m_condition_up)
458 m_condition_up.reset();
459 } else {
460 // Pass nullptr for expr_prefix (no translation-unit level definitions).
463 condition, {}, {}, UserExpression::eResultTypeAny,
464 EvaluateExpressionOptions(), nullptr, error));
465 if (error.Fail()) {
466 // FIXME: Log something...
467 m_condition_up.reset();
468 }
469 }
470 SendWatchpointChangedEvent(eWatchpointEventTypeConditionChanged);
471}
472
473const char *Watchpoint::GetConditionText() const {
474 if (m_condition_up)
475 return m_condition_up->GetUserText();
476 else
477 return nullptr;
478}
479
481 lldb::WatchpointEventType eventKind) {
482 if (GetTarget().EventTypeHasListeners(
484 auto data_sp =
485 std::make_shared<WatchpointEventData>(eventKind, shared_from_this());
487 }
488}
489
491 WatchpointEventType sub_type, const WatchpointSP &new_watchpoint_sp)
492 : m_watchpoint_event(sub_type), m_new_watchpoint_sp(new_watchpoint_sp) {}
493
495
497 return "Watchpoint::WatchpointEventData";
498}
499
502}
503
505 return m_new_watchpoint_sp;
506}
507
508WatchpointEventType
510 return m_watchpoint_event;
511}
512
514
517 if (event) {
518 const EventData *event_data = event->GetData();
519 if (event_data &&
521 return static_cast<const WatchpointEventData *>(event->GetData());
522 }
523 return nullptr;
524}
525
526WatchpointEventType
528 const EventSP &event_sp) {
529 const WatchpointEventData *data = GetEventDataFromEvent(event_sp.get());
530
531 if (data == nullptr)
532 return eWatchpointEventTypeInvalidType;
533 else
534 return data->GetWatchpointEventType();
535}
536
538 const EventSP &event_sp) {
539 WatchpointSP wp_sp;
540
541 const WatchpointEventData *data = GetEventDataFromEvent(event_sp.get());
542 if (data)
543 wp_sp = data->m_new_watchpoint_sp;
544
545 return wp_sp;
546}
static llvm::raw_ostream & error(Stream &strm)
#define lldbassert(x)
Definition: LLDBAssert.h:15
#define LLDB_LOGF(log,...)
Definition: Log.h:366
#define LLDB_LOG_ERROR(log, error,...)
Definition: Log.h:382
A section + offset based address class.
Definition: Address.h:62
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition: Address.cpp:313
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
Definition: ArchSpec.cpp:691
void BroadcastEvent(lldb::EventSP &event_sp)
Broadcast an event which has no associated data.
Definition: Broadcaster.h:167
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
CompilerType GetArrayType(uint64_t size) const
A uniqued constant string class.
Definition: ConstString.h:40
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
Definition: ConstString.h:197
An data extractor class.
Definition: DataExtractor.h:48
const void * GetData(lldb::offset_t *offset_ptr, lldb::offset_t length) const
Extract length bytes from *offset_ptr.
uint64_t GetByteSize() const
Get the number of bytes contained in this object.
const uint8_t * GetDataStart() const
Get the data start pointer.
DumpValueObjectOptions & SetHideName(bool hide_name=false)
DumpValueObjectOptions & SetHideRootType(bool hide_root_type=false)
DumpValueObjectOptions & SetHideRootName(bool hide_root_name)
DumpValueObjectOptions & SetUseDynamicType(lldb::DynamicValueType dyn=lldb::eNoDynamicValues)
virtual llvm::StringRef GetFlavor() const =0
lldb::TargetSP GetTargetSP() const
Get accessor that creates a strong reference from the weak target reference contained in this object.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
ExecutionContextScope * GetBestExecutionContextScope() const
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
An error handling class.
Definition: Status.h:44
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
void Increment(uint32_t difference=1)
lldb::break_id_t GetID() const
Definition: StoppointSite.h:45
uint32_t GetHitCount() const
Definition: StoppointSite.h:33
StoppointHitCounter m_hit_counter
Number of times this breakpoint/watchpoint has been hit.
Definition: StoppointSite.h:64
virtual lldb::addr_t GetLoadAddress() const
Definition: StoppointSite.h:27
uint32_t m_byte_size
The size in bytes of stoppoint, e.g.
Definition: StoppointSite.h:61
const char * GetData() const
Definition: StreamString.h:43
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition: Stream.cpp:157
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:134
const lldb::ProcessSP & GetProcessSP() const
Definition: Target.cpp:221
llvm::Expected< lldb::TypeSystemSP > GetScratchTypeSystemForLanguage(lldb::LanguageType language, bool create_on_demand=true)
Definition: Target.cpp:2414
@ eBroadcastBitWatchpointChanged
Definition: Target.h:504
const ArchSpec & GetArchitecture() const
Definition: Target.h:1023
UserExpression * GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix, SourceLanguage language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj, Status &error)
Definition: Target.cpp:2504
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)
Definition: Watchpoint.cpp:537
lldb::WatchpointEventType GetWatchpointEventType() const
Definition: Watchpoint.cpp:509
llvm::StringRef GetFlavor() const override
Definition: Watchpoint.cpp:500
static lldb::WatchpointEventType GetWatchpointEventTypeFromEvent(const lldb::EventSP &event_sp)
Definition: Watchpoint.cpp:527
void Dump(Stream *s) const override
Definition: Watchpoint.cpp:513
static const WatchpointEventData * GetEventDataFromEvent(const Event *event_sp)
Definition: Watchpoint.cpp:516
WatchpointEventData(lldb::WatchpointEventType sub_type, const lldb::WatchpointSP &new_watchpoint_sp)
bool IsWatchVariable() const
Definition: Watchpoint.cpp:198
void SetCallback(WatchpointHitCallback callback, void *callback_baton, bool is_synchronous=false)
Set the callback action invoked when the watchpoint is hit.
Definition: Watchpoint.cpp:73
Watchpoint(Target &target, lldb::addr_t addr, uint32_t size, const CompilerType *type, bool hardware=true)
Definition: Watchpoint.cpp:29
bool CaptureWatchedValue(const ExecutionContext &exe_ctx)
Definition: Watchpoint.cpp:202
uint32_t GetIgnoreCount() const
Definition: Watchpoint.cpp:442
bool InvokeCallback(StoppointCallbackContext *context)
Invoke the callback action when the watchpoint is hit.
Definition: Watchpoint.cpp:451
void SetIgnoreCount(uint32_t n)
Definition: Watchpoint.cpp:444
std::unique_ptr< UserExpression > m_condition_up
Definition: Watchpoint.h:229
void SetEnabled(bool enabled, bool notify=true)
Definition: Watchpoint.cpp:407
bool IsHardware() const override
Definition: Watchpoint.cpp:193
void Dump(Stream *s) const override
Definition: Watchpoint.cpp:269
bool WatchedValueReportable(const ExecutionContext &exe_ctx)
Definition: Watchpoint.cpp:221
void SendWatchpointChangedEvent(lldb::WatchpointEventType eventKind)
Definition: Watchpoint.cpp:480
std::string GetWatchSpec()
Definition: Watchpoint.cpp:187
lldb::ValueObjectSP m_new_value_sp
Definition: Watchpoint.h:223
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.
Definition: Watchpoint.cpp:133
bool DumpSnapshots(Stream *s, const char *prefix=nullptr) const
Definition: Watchpoint.cpp:275
lldb::ValueObjectSP m_old_value_sp
Definition: Watchpoint.h:222
bool ShouldStop(StoppointCallbackContext *context) override
Definition: Watchpoint.cpp:259
void SetWatchSpec(const std::string &str)
Definition: Watchpoint.cpp:189
void SetWatchVariable(bool val)
Definition: Watchpoint.cpp:200
const char * GetConditionText() const
Return a pointer to the text of the condition expression.
Definition: Watchpoint.cpp:473
void GetDescription(Stream *s, lldb::DescriptionLevel level)
Definition: Watchpoint.cpp:265
WatchpointOptions m_options
Definition: Watchpoint.h:227
bool WatchpointRead() const
Definition: Watchpoint.cpp:436
std::string m_watch_spec_str
Definition: Watchpoint.h:221
bool SetupVariableWatchpointDisabler(lldb::StackFrameSP frame_sp) const
Definition: Watchpoint.cpp:92
bool WatchpointModify() const
Definition: Watchpoint.cpp:440
void SetCondition(const char *condition)
Set the watchpoint's condition.
Definition: Watchpoint.cpp:455
void SetWatchpointType(uint32_t type, bool notify=true)
Definition: Watchpoint.cpp:423
void SetDeclInfo(const std::string &str)
Definition: Watchpoint.cpp:185
bool WatchpointWrite() const
Definition: Watchpoint.cpp:438
void DumpWithLevel(Stream *s, lldb::DescriptionLevel description_level) const
Definition: Watchpoint.cpp:340
#define LLDB_WATCH_TYPE_WRITE
Definition: lldb-defines.h:46
#define LLDB_INVALID_WATCH_ID
Definition: lldb-defines.h:43
#define LLDB_WATCH_TYPE_MODIFY
Definition: lldb-defines.h:47
#define LLDB_WATCH_TYPE_READ
Definition: lldb-defines.h:45
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:82
#define LLDB_INVALID_FRAME_ID
Definition: lldb-defines.h:91
@ DoNoSelectMostRelevantFrame
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.
Definition: Log.h:331
bool(* WatchpointHitCallback)(void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id)
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
Definition: lldb-forward.h:415
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelBrief
@ eDescriptionLevelFull
@ eDescriptionLevelVerbose
std::shared_ptr< lldb_private::Thread > ThreadSP
Definition: lldb-forward.h:441
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:475
@ eLanguageTypeC
Non-standardized C, such as K&R.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
Definition: lldb-forward.h:316
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:384
std::shared_ptr< lldb_private::Baton > BatonSP
Definition: lldb-forward.h:314
@ eEncodingUint
unsigned integer
std::shared_ptr< lldb_private::Event > EventSP
Definition: lldb-forward.h:340
std::shared_ptr< lldb_private::Watchpoint > WatchpointSP
Definition: lldb-forward.h:480
std::shared_ptr< lldb_private::WatchpointResource > WatchpointResourceSP
Definition: lldb-forward.h:481
uint64_t user_id_t
Definition: lldb-types.h:82
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::Target > TargetSP
Definition: lldb-forward.h:439
@ eNoDynamicValues
Represents the context of a watchpoint variable.
Definition: Watchpoint.h:100
ExecutionContext exe_ctx
The execution context associated with the watchpoint.
Definition: Watchpoint.h:110
lldb::watch_id_t watch_id
The ID of the watchpoint.
Definition: Watchpoint.h:108