LLDB mainline
CommandObjectWatchpoint.cpp
Go to the documentation of this file.
1//===-- CommandObjectWatchpoint.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
11
12#include <memory>
13#include <vector>
14
15#include "llvm/ADT/StringRef.h"
16
28#include "lldb/Target/Target.h"
30
31using namespace lldb;
32using namespace lldb_private;
33
36 s.IndentMore();
37 wp.GetDescription(&s, level);
38 s.IndentLess();
39 s.EOL();
40}
41
43 CommandReturnObject &result) {
44 bool process_is_valid =
45 target->GetProcessSP() && target->GetProcessSP()->IsAlive();
46 if (!process_is_valid) {
47 result.AppendError("There's no process or it is not alive.");
48 return false;
49 }
50 // Target passes our checks, return true.
51 return true;
52}
53
54// Equivalent class: {"-", "to", "To", "TO"} of range specifier array.
55static const char *RSA[4] = {"-", "to", "To", "TO"};
56
57// Return the index to RSA if found; otherwise -1 is returned.
58static int32_t WithRSAIndex(llvm::StringRef Arg) {
59
60 uint32_t i;
61 for (i = 0; i < 4; ++i)
62 if (Arg.contains(RSA[i]))
63 return i;
64 return -1;
65}
66
67// Return true if wp_ids is successfully populated with the watch ids. False
68// otherwise.
70 Target *target, Args &args, std::vector<uint32_t> &wp_ids) {
71 // Pre-condition: args.GetArgumentCount() > 0.
72 if (args.GetArgumentCount() == 0) {
73 if (target == nullptr)
74 return false;
75 WatchpointSP watch_sp = target->GetLastCreatedWatchpoint();
76 if (watch_sp) {
77 wp_ids.push_back(watch_sp->GetID());
78 return true;
79 } else
80 return false;
81 }
82
83 llvm::StringRef Minus("-");
84 std::vector<llvm::StringRef> StrRefArgs;
85 llvm::StringRef first;
86 llvm::StringRef second;
87 size_t i;
88 int32_t idx;
89 // Go through the arguments and make a canonical form of arg list containing
90 // only numbers with possible "-" in between.
91 for (auto &entry : args.entries()) {
92 if ((idx = WithRSAIndex(entry.ref())) == -1) {
93 StrRefArgs.push_back(entry.ref());
94 continue;
95 }
96 // The Arg contains the range specifier, split it, then.
97 std::tie(first, second) = entry.ref().split(RSA[idx]);
98 if (!first.empty())
99 StrRefArgs.push_back(first);
100 StrRefArgs.push_back(Minus);
101 if (!second.empty())
102 StrRefArgs.push_back(second);
103 }
104 // Now process the canonical list and fill in the vector of uint32_t's. If
105 // there is any error, return false and the client should ignore wp_ids.
106 uint32_t beg, end, id;
107 size_t size = StrRefArgs.size();
108 bool in_range = false;
109 for (i = 0; i < size; ++i) {
110 llvm::StringRef Arg = StrRefArgs[i];
111 if (in_range) {
112 // Look for the 'end' of the range. Note StringRef::getAsInteger()
113 // returns true to signify error while parsing.
114 if (Arg.getAsInteger(0, end))
115 return false;
116 // Found a range! Now append the elements.
117 for (id = beg; id <= end; ++id)
118 wp_ids.push_back(id);
119 in_range = false;
120 continue;
121 }
122 if (i < (size - 1) && StrRefArgs[i + 1] == Minus) {
123 if (Arg.getAsInteger(0, beg))
124 return false;
125 // Turn on the in_range flag, we are looking for end of range next.
126 ++i;
127 in_range = true;
128 continue;
129 }
130 // Otherwise, we have a simple ID. Just append it.
131 if (Arg.getAsInteger(0, beg))
132 return false;
133 wp_ids.push_back(beg);
134 }
135
136 // It is an error if after the loop, we're still in_range.
137 return !in_range;
138}
139
140// CommandObjectWatchpointList
141
142// CommandObjectWatchpointList::Options
143#pragma mark List::CommandOptions
144#define LLDB_OPTIONS_watchpoint_list
145#include "CommandOptions.inc"
146
147#pragma mark List
148
150public:
153 interpreter, "watchpoint list",
154 "List all watchpoints at configurable levels of detail.", nullptr,
155 eCommandRequiresTarget) {
159 // Add the entry for the first argument for this command to the object's
160 // arguments vector.
161 m_arguments.push_back(arg);
162 }
163
164 ~CommandObjectWatchpointList() override = default;
165
166 Options *GetOptions() override { return &m_options; }
167
168 class CommandOptions : public Options {
169 public:
170 CommandOptions() = default;
171
172 ~CommandOptions() override = default;
173
174 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
175 ExecutionContext *execution_context) override {
177 const int short_option = m_getopt_table[option_idx].val;
178
179 switch (short_option) {
180 case 'b':
182 break;
183 case 'f':
185 break;
186 case 'v':
188 break;
189 default:
190 llvm_unreachable("Unimplemented option");
191 }
192
193 return error;
194 }
195
196 void OptionParsingStarting(ExecutionContext *execution_context) override {
198 }
199
200 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
201 return llvm::ArrayRef(g_watchpoint_list_options);
202 }
203
204 // Instance variables to hold the values for command options.
205
207 };
208
209protected:
210 void DoExecute(Args &command, CommandReturnObject &result) override {
211 Target *target = &GetSelectedTarget();
212
213 if (target->GetProcessSP() && target->GetProcessSP()->IsAlive()) {
214 std::optional<uint32_t> num_supported_hardware_watchpoints =
215 target->GetProcessSP()->GetWatchpointSlotCount();
216
217 if (num_supported_hardware_watchpoints)
219 "Number of supported hardware watchpoints: %u\n",
220 *num_supported_hardware_watchpoints);
221 }
222
223 const WatchpointList &watchpoints = target->GetWatchpointList();
224
225 std::unique_lock<std::recursive_mutex> lock;
226 target->GetWatchpointList().GetListMutex(lock);
227
228 size_t num_watchpoints = watchpoints.GetSize();
229
230 if (num_watchpoints == 0) {
231 result.AppendMessage("No watchpoints currently set.");
233 return;
234 }
235
236 Stream &output_stream = result.GetOutputStream();
237
238 if (command.GetArgumentCount() == 0) {
239 // No watchpoint selected; show info about all currently set watchpoints.
240 result.AppendMessage("Current watchpoints:");
241 for (size_t i = 0; i < num_watchpoints; ++i) {
242 WatchpointSP watch_sp = watchpoints.GetByIndex(i);
243 AddWatchpointDescription(output_stream, *watch_sp, m_options.m_level);
244 }
246 } else {
247 // Particular watchpoints selected; enable them.
248 std::vector<uint32_t> wp_ids;
250 target, command, wp_ids)) {
251 result.AppendError("Invalid watchpoints specification.");
252 return;
253 }
254
255 const size_t size = wp_ids.size();
256 for (size_t i = 0; i < size; ++i) {
257 WatchpointSP watch_sp = watchpoints.FindByID(wp_ids[i]);
258 if (watch_sp)
259 AddWatchpointDescription(output_stream, *watch_sp, m_options.m_level);
261 }
262 }
263 }
264
265private:
267};
268
269// CommandObjectWatchpointEnable
270#pragma mark Enable
271
273public:
275 : CommandObjectParsed(interpreter, "enable",
276 "Enable the specified disabled watchpoint(s). If "
277 "no watchpoints are specified, enable all of them.",
278 nullptr, eCommandRequiresTarget) {
282 // Add the entry for the first argument for this command to the object's
283 // arguments vector.
284 m_arguments.push_back(arg);
285 }
286
287 ~CommandObjectWatchpointEnable() override = default;
288
289 void
291 OptionElementVector &opt_element_vector) override {
293 GetCommandInterpreter(), lldb::eWatchpointIDCompletion, request,
294 nullptr);
295 }
296
297protected:
298 void DoExecute(Args &command, CommandReturnObject &result) override {
299 Target *target = &GetSelectedTarget();
300 if (!CheckTargetForWatchpointOperations(target, result))
301 return;
302
303 std::unique_lock<std::recursive_mutex> lock;
304 target->GetWatchpointList().GetListMutex(lock);
305
306 const WatchpointList &watchpoints = target->GetWatchpointList();
307
308 size_t num_watchpoints = watchpoints.GetSize();
309
310 if (num_watchpoints == 0) {
311 result.AppendError("No watchpoints exist to be enabled.");
312 return;
313 }
314
315 if (command.GetArgumentCount() == 0) {
316 // No watchpoint selected; enable all currently set watchpoints.
317 target->EnableAllWatchpoints();
318 result.AppendMessageWithFormat("All watchpoints enabled. (%" PRIu64
319 " watchpoints)\n",
320 (uint64_t)num_watchpoints);
322 } else {
323 // Particular watchpoints selected; enable them.
324 std::vector<uint32_t> wp_ids;
326 target, command, wp_ids)) {
327 result.AppendError("Invalid watchpoints specification.");
328 return;
329 }
330
331 int count = 0;
332 const size_t size = wp_ids.size();
333 for (size_t i = 0; i < size; ++i)
334 if (target->EnableWatchpointByID(wp_ids[i]))
335 ++count;
336 result.AppendMessageWithFormat("%d watchpoints enabled.\n", count);
338 }
339 }
340};
341
342// CommandObjectWatchpointDisable
343#pragma mark Disable
344
346public:
348 : CommandObjectParsed(interpreter, "watchpoint disable",
349 "Disable the specified watchpoint(s) without "
350 "removing it/them. If no watchpoints are "
351 "specified, disable them all.",
352 nullptr, eCommandRequiresTarget) {
356 // Add the entry for the first argument for this command to the object's
357 // arguments vector.
358 m_arguments.push_back(arg);
359 }
360
362
363 void
365 OptionElementVector &opt_element_vector) override {
367 GetCommandInterpreter(), lldb::eWatchpointIDCompletion, request,
368 nullptr);
369 }
370
371protected:
372 void DoExecute(Args &command, CommandReturnObject &result) override {
373 Target *target = &GetSelectedTarget();
374 if (!CheckTargetForWatchpointOperations(target, result))
375 return;
376
377 std::unique_lock<std::recursive_mutex> lock;
378 target->GetWatchpointList().GetListMutex(lock);
379
380 const WatchpointList &watchpoints = target->GetWatchpointList();
381 size_t num_watchpoints = watchpoints.GetSize();
382
383 if (num_watchpoints == 0) {
384 result.AppendError("No watchpoints exist to be disabled.");
385 return;
386 }
387
388 if (command.GetArgumentCount() == 0) {
389 // No watchpoint selected; disable all currently set watchpoints.
390 if (target->DisableAllWatchpoints()) {
391 result.AppendMessageWithFormat("All watchpoints disabled. (%" PRIu64
392 " watchpoints)\n",
393 (uint64_t)num_watchpoints);
395 } else {
396 result.AppendError("Disable all watchpoints failed\n");
397 }
398 } else {
399 // Particular watchpoints selected; disable them.
400 std::vector<uint32_t> wp_ids;
402 target, command, wp_ids)) {
403 result.AppendError("Invalid watchpoints specification.");
404 return;
405 }
406
407 int count = 0;
408 const size_t size = wp_ids.size();
409 for (size_t i = 0; i < size; ++i)
410 if (target->DisableWatchpointByID(wp_ids[i]))
411 ++count;
412 result.AppendMessageWithFormat("%d watchpoints disabled.\n", count);
414 }
415 }
416};
417
418// CommandObjectWatchpointDelete
419#define LLDB_OPTIONS_watchpoint_delete
420#include "CommandOptions.inc"
421
422// CommandObjectWatchpointDelete
423#pragma mark Delete
424
426public:
428 : CommandObjectParsed(interpreter, "watchpoint delete",
429 "Delete the specified watchpoint(s). If no "
430 "watchpoints are specified, delete them all.",
431 nullptr, eCommandRequiresTarget) {
435 // Add the entry for the first argument for this command to the object's
436 // arguments vector.
437 m_arguments.push_back(arg);
438 }
439
440 ~CommandObjectWatchpointDelete() override = default;
441
442 void
444 OptionElementVector &opt_element_vector) override {
446 GetCommandInterpreter(), lldb::eWatchpointIDCompletion, request,
447 nullptr);
448 }
449
450 Options *GetOptions() override { return &m_options; }
451
452 class CommandOptions : public Options {
453 public:
454 CommandOptions() = default;
455
456 ~CommandOptions() override = default;
457
458 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
459 ExecutionContext *execution_context) override {
460 const int short_option = m_getopt_table[option_idx].val;
461
462 switch (short_option) {
463 case 'f':
464 m_force = true;
465 break;
466 default:
467 llvm_unreachable("Unimplemented option");
468 }
469
470 return {};
471 }
472
473 void OptionParsingStarting(ExecutionContext *execution_context) override {
474 m_force = false;
475 }
476
477 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
478 return llvm::ArrayRef(g_watchpoint_delete_options);
479 }
480
481 // Instance variables to hold the values for command options.
482 bool m_force = false;
483 };
484
485protected:
486 void DoExecute(Args &command, CommandReturnObject &result) override {
487 Target *target = &GetSelectedTarget();
488 if (!CheckTargetForWatchpointOperations(target, result))
489 return;
490
491 std::unique_lock<std::recursive_mutex> lock;
492 target->GetWatchpointList().GetListMutex(lock);
493
494 const WatchpointList &watchpoints = target->GetWatchpointList();
495
496 size_t num_watchpoints = watchpoints.GetSize();
497
498 if (num_watchpoints == 0) {
499 result.AppendError("No watchpoints exist to be deleted.");
500 return;
501 }
502
503 if (command.empty()) {
504 if (!m_options.m_force &&
505 !m_interpreter.Confirm(
506 "About to delete all watchpoints, do you want to do that?",
507 true)) {
508 result.AppendMessage("Operation cancelled...");
509 } else {
510 target->RemoveAllWatchpoints();
511 result.AppendMessageWithFormat("All watchpoints removed. (%" PRIu64
512 " watchpoints)\n",
513 (uint64_t)num_watchpoints);
514 }
516 return;
517 }
518
519 // Particular watchpoints selected; delete them.
520 std::vector<uint32_t> wp_ids;
522 wp_ids)) {
523 result.AppendError("Invalid watchpoints specification.");
524 return;
525 }
526
527 int count = 0;
528 const size_t size = wp_ids.size();
529 for (size_t i = 0; i < size; ++i)
530 if (target->RemoveWatchpointByID(wp_ids[i]))
531 ++count;
532 result.AppendMessageWithFormat("%d watchpoints deleted.\n", count);
534 }
535
536private:
538};
539
540// CommandObjectWatchpointIgnore
541
542#pragma mark Ignore::CommandOptions
543#define LLDB_OPTIONS_watchpoint_ignore
544#include "CommandOptions.inc"
545
547public:
549 : CommandObjectParsed(interpreter, "watchpoint ignore",
550 "Set ignore count on the specified watchpoint(s). "
551 "If no watchpoints are specified, set them all.",
552 nullptr, eCommandRequiresTarget) {
556 // Add the entry for the first argument for this command to the object's
557 // arguments vector.
558 m_arguments.push_back(arg);
559 }
560
561 ~CommandObjectWatchpointIgnore() override = default;
562
563 void
565 OptionElementVector &opt_element_vector) override {
567 GetCommandInterpreter(), lldb::eWatchpointIDCompletion, request,
568 nullptr);
569 }
570
571 Options *GetOptions() override { return &m_options; }
572
573 class CommandOptions : public Options {
574 public:
575 CommandOptions() = default;
576
577 ~CommandOptions() override = default;
578
579 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
580 ExecutionContext *execution_context) override {
582 const int short_option = m_getopt_table[option_idx].val;
583
584 switch (short_option) {
585 case 'i':
586 if (option_arg.getAsInteger(0, m_ignore_count))
587 error.SetErrorStringWithFormat("invalid ignore count '%s'",
588 option_arg.str().c_str());
589 break;
590 default:
591 llvm_unreachable("Unimplemented option");
592 }
593
594 return error;
595 }
596
597 void OptionParsingStarting(ExecutionContext *execution_context) override {
598 m_ignore_count = 0;
599 }
600
601 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
602 return llvm::ArrayRef(g_watchpoint_ignore_options);
603 }
604
605 // Instance variables to hold the values for command options.
606
607 uint32_t m_ignore_count = 0;
608 };
609
610protected:
611 void DoExecute(Args &command, CommandReturnObject &result) override {
612 Target *target = &GetSelectedTarget();
613 if (!CheckTargetForWatchpointOperations(target, result))
614 return;
615
616 std::unique_lock<std::recursive_mutex> lock;
617 target->GetWatchpointList().GetListMutex(lock);
618
619 const WatchpointList &watchpoints = target->GetWatchpointList();
620
621 size_t num_watchpoints = watchpoints.GetSize();
622
623 if (num_watchpoints == 0) {
624 result.AppendError("No watchpoints exist to be ignored.");
625 return;
626 }
627
628 if (command.GetArgumentCount() == 0) {
629 target->IgnoreAllWatchpoints(m_options.m_ignore_count);
630 result.AppendMessageWithFormat("All watchpoints ignored. (%" PRIu64
631 " watchpoints)\n",
632 (uint64_t)num_watchpoints);
634 } else {
635 // Particular watchpoints selected; ignore them.
636 std::vector<uint32_t> wp_ids;
638 target, command, wp_ids)) {
639 result.AppendError("Invalid watchpoints specification.");
640 return;
641 }
642
643 int count = 0;
644 const size_t size = wp_ids.size();
645 for (size_t i = 0; i < size; ++i)
646 if (target->IgnoreWatchpointByID(wp_ids[i], m_options.m_ignore_count))
647 ++count;
648 result.AppendMessageWithFormat("%d watchpoints ignored.\n", count);
650 }
651 }
652
653private:
655};
656
657// CommandObjectWatchpointModify
658
659#pragma mark Modify::CommandOptions
660#define LLDB_OPTIONS_watchpoint_modify
661#include "CommandOptions.inc"
662
663#pragma mark Modify
664
666public:
669 interpreter, "watchpoint modify",
670 "Modify the options on a watchpoint or set of watchpoints in the "
671 "executable. "
672 "If no watchpoint is specified, act on the last created "
673 "watchpoint. "
674 "Passing an empty argument clears the modification.",
675 nullptr, eCommandRequiresTarget) {
679 // Add the entry for the first argument for this command to the object's
680 // arguments vector.
681 m_arguments.push_back(arg);
682 }
683
684 ~CommandObjectWatchpointModify() override = default;
685
686 void
688 OptionElementVector &opt_element_vector) override {
690 GetCommandInterpreter(), lldb::eWatchpointIDCompletion, request,
691 nullptr);
692 }
693
694 Options *GetOptions() override { return &m_options; }
695
696 class CommandOptions : public Options {
697 public:
698 CommandOptions() = default;
699
700 ~CommandOptions() override = default;
701
702 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
703 ExecutionContext *execution_context) override {
705 const int short_option = m_getopt_table[option_idx].val;
706
707 switch (short_option) {
708 case 'c':
709 m_condition = std::string(option_arg);
710 m_condition_passed = true;
711 break;
712 default:
713 llvm_unreachable("Unimplemented option");
714 }
715
716 return error;
717 }
718
719 void OptionParsingStarting(ExecutionContext *execution_context) override {
720 m_condition.clear();
721 m_condition_passed = false;
722 }
723
724 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
725 return llvm::ArrayRef(g_watchpoint_modify_options);
726 }
727
728 // Instance variables to hold the values for command options.
729
730 std::string m_condition;
731 bool m_condition_passed = false;
732 };
733
734protected:
735 void DoExecute(Args &command, CommandReturnObject &result) override {
736 Target *target = &GetSelectedTarget();
737 if (!CheckTargetForWatchpointOperations(target, result))
738 return;
739
740 std::unique_lock<std::recursive_mutex> lock;
741 target->GetWatchpointList().GetListMutex(lock);
742
743 const WatchpointList &watchpoints = target->GetWatchpointList();
744
745 size_t num_watchpoints = watchpoints.GetSize();
746
747 if (num_watchpoints == 0) {
748 result.AppendError("No watchpoints exist to be modified.");
749 return;
750 }
751
752 if (command.GetArgumentCount() == 0) {
753 WatchpointSP watch_sp = target->GetLastCreatedWatchpoint();
754 watch_sp->SetCondition(m_options.m_condition.c_str());
756 } else {
757 // Particular watchpoints selected; set condition on them.
758 std::vector<uint32_t> wp_ids;
760 target, command, wp_ids)) {
761 result.AppendError("Invalid watchpoints specification.");
762 return;
763 }
764
765 int count = 0;
766 const size_t size = wp_ids.size();
767 for (size_t i = 0; i < size; ++i) {
768 WatchpointSP watch_sp = watchpoints.FindByID(wp_ids[i]);
769 if (watch_sp) {
770 watch_sp->SetCondition(m_options.m_condition.c_str());
771 ++count;
772 }
773 }
774 result.AppendMessageWithFormat("%d watchpoints modified.\n", count);
776 }
777 }
778
779private:
781};
782
783// CommandObjectWatchpointSetVariable
784#pragma mark SetVariable
785
787public:
790 interpreter, "watchpoint set variable",
791 "Set a watchpoint on a variable. "
792 "Use the '-w' option to specify the type of watchpoint and "
793 "the '-s' option to specify the byte size to watch for. "
794 "If no '-w' option is specified, it defaults to modify. "
795 "If no '-s' option is specified, it defaults to the variable's "
796 "byte size. "
797 "Note that there are limited hardware resources for watchpoints. "
798 "If watchpoint setting fails, consider disable/delete existing "
799 "ones "
800 "to free up resources.",
801 nullptr,
802 eCommandRequiresFrame | eCommandTryTargetAPILock |
803 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
804 SetHelpLong(
805 R"(
806Examples:
807
808(lldb) watchpoint set variable -w read_write my_global_var
809
810)"
811 " Watches my_global_var for read/write access, with the region to watch \
812corresponding to the byte size of the data type.");
813
815 CommandArgumentData var_name_arg;
816
817 // Define the only variant of this arg.
818 var_name_arg.arg_type = eArgTypeVarName;
819 var_name_arg.arg_repetition = eArgRepeatPlain;
820
821 // Push the variant into the argument entry.
822 arg.push_back(var_name_arg);
823
824 // Push the data for the only argument into the m_arguments vector.
825 m_arguments.push_back(arg);
826
827 // Absorb the '-w' and '-s' options into our option group.
828 m_option_group.Append(&m_option_watchpoint, LLDB_OPT_SET_1, LLDB_OPT_SET_1);
829 m_option_group.Finalize();
830 }
831
833
834 Options *GetOptions() override { return &m_option_group; }
835
836protected:
837 static size_t GetVariableCallback(void *baton, const char *name,
838 VariableList &variable_list) {
839 size_t old_size = variable_list.GetSize();
840 Target *target = static_cast<Target *>(baton);
841 if (target)
843 variable_list);
844 return variable_list.GetSize() - old_size;
845 }
846
847 void DoExecute(Args &command, CommandReturnObject &result) override {
848 Target *target = GetDebugger().GetSelectedTarget().get();
849 StackFrame *frame = m_exe_ctx.GetFramePtr();
850
851 // If no argument is present, issue an error message. There's no way to
852 // set a watchpoint.
853 if (command.GetArgumentCount() <= 0) {
854 result.AppendError("required argument missing; "
855 "specify your program variable to watch for");
856 return;
857 }
858
859 // If no '-w' is specified, default to '-w modify'.
860 if (!m_option_watchpoint.watch_type_specified) {
861 m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchModify;
862 }
863
864 // We passed the sanity check for the command. Proceed to set the
865 // watchpoint now.
866 lldb::addr_t addr = 0;
867 size_t size = 0;
868
869 VariableSP var_sp;
870 ValueObjectSP valobj_sp;
871 Stream &output_stream = result.GetOutputStream();
872
873 // A simple watch variable gesture allows only one argument.
874 if (command.GetArgumentCount() != 1) {
875 result.AppendError("specify exactly one variable to watch for");
876 return;
877 }
878
879 // Things have checked out ok...
881 uint32_t expr_path_options =
884 valobj_sp = frame->GetValueForVariableExpressionPath(
885 command.GetArgumentAtIndex(0), eNoDynamicValues, expr_path_options,
886 var_sp, error);
887
888 if (!valobj_sp) {
889 // Not in the frame; let's check the globals.
890
891 VariableList variable_list;
892 ValueObjectList valobj_list;
893
895 command.GetArgumentAtIndex(0),
896 m_exe_ctx.GetBestExecutionContextScope(), GetVariableCallback, target,
897 variable_list, valobj_list));
898
899 if (valobj_list.GetSize())
900 valobj_sp = valobj_list.GetValueObjectAtIndex(0);
901 }
902
903 CompilerType compiler_type;
904
905 if (valobj_sp) {
906 AddressType addr_type;
907 addr = valobj_sp->GetAddressOf(false, &addr_type);
908 if (addr_type == eAddressTypeLoad) {
909 // We're in business.
910 // Find out the size of this variable.
911 size = m_option_watchpoint.watch_size.GetCurrentValue() == 0
912 ? valobj_sp->GetByteSize().value_or(0)
913 : m_option_watchpoint.watch_size.GetCurrentValue();
914 }
915 compiler_type = valobj_sp->GetCompilerType();
916 } else {
917 const char *error_cstr = error.AsCString(nullptr);
918 if (error_cstr)
919 result.AppendError(error_cstr);
920 else
921 result.AppendErrorWithFormat("unable to find any variable "
922 "expression path that matches '%s'",
923 command.GetArgumentAtIndex(0));
924 return;
925 }
926
927 // Now it's time to create the watchpoint.
928 uint32_t watch_type = 0;
929 switch (m_option_watchpoint.watch_type) {
931 watch_type |= LLDB_WATCH_TYPE_MODIFY;
932 break;
934 watch_type |= LLDB_WATCH_TYPE_READ;
935 break;
938 break;
940 watch_type |= LLDB_WATCH_TYPE_WRITE;
941 break;
943 break;
944 };
945
946 error.Clear();
947 WatchpointSP watch_sp =
948 target->CreateWatchpoint(addr, size, &compiler_type, watch_type, error);
949 if (!watch_sp) {
951 "Watchpoint creation failed (addr=0x%" PRIx64 ", size=%" PRIu64
952 ", variable expression='%s').\n",
953 addr, static_cast<uint64_t>(size), command.GetArgumentAtIndex(0));
954 if (const char *error_message = error.AsCString(nullptr))
955 result.AppendError(error_message);
956 return;
957 }
958
959 watch_sp->SetWatchSpec(command.GetArgumentAtIndex(0));
960 watch_sp->SetWatchVariable(true);
961 if (var_sp) {
962 if (var_sp->GetDeclaration().GetFile()) {
963 StreamString ss;
964 // True to show fullpath for declaration file.
965 var_sp->GetDeclaration().DumpStopContext(&ss, true);
966 watch_sp->SetDeclInfo(std::string(ss.GetString()));
967 }
968 if (var_sp->GetScope() == eValueTypeVariableLocal)
969 watch_sp->SetupVariableWatchpointDisabler(m_exe_ctx.GetFrameSP());
970 }
971 output_stream.Printf("Watchpoint created: ");
972 watch_sp->GetDescription(&output_stream, lldb::eDescriptionLevelFull);
973 output_stream.EOL();
975 }
976
977private:
978 OptionGroupOptions m_option_group;
979 OptionGroupWatchpoint m_option_watchpoint;
980};
981
982// CommandObjectWatchpointSetExpression
983#pragma mark Set
984
986public:
989 interpreter, "watchpoint set expression",
990 "Set a watchpoint on an address by supplying an expression. "
991 "Use the '-l' option to specify the language of the expression. "
992 "Use the '-w' option to specify the type of watchpoint and "
993 "the '-s' option to specify the byte size to watch for. "
994 "If no '-w' option is specified, it defaults to modify. "
995 "If no '-s' option is specified, it defaults to the target's "
996 "pointer byte size. "
997 "Note that there are limited hardware resources for watchpoints. "
998 "If watchpoint setting fails, consider disable/delete existing "
999 "ones "
1000 "to free up resources.",
1001 "",
1002 eCommandRequiresFrame | eCommandTryTargetAPILock |
1003 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
1004 SetHelpLong(
1005 R"(
1006Examples:
1007
1008(lldb) watchpoint set expression -w modify -s 1 -- foo + 32
1009
1010 Watches write access for the 1-byte region pointed to by the address 'foo + 32')");
1011
1013 CommandArgumentData expression_arg;
1014
1015 // Define the only variant of this arg.
1016 expression_arg.arg_type = eArgTypeExpression;
1017 expression_arg.arg_repetition = eArgRepeatPlain;
1018
1019 // Push the only variant into the argument entry.
1020 arg.push_back(expression_arg);
1021
1022 // Push the data for the only argument into the m_arguments vector.
1023 m_arguments.push_back(arg);
1024
1025 // Absorb the '-w' and '-s' options into our option group.
1026 m_option_group.Append(&m_option_watchpoint, LLDB_OPT_SET_ALL,
1028 m_option_group.Finalize();
1029 }
1031 ~CommandObjectWatchpointSetExpression() override = default;
1033 // Overrides base class's behavior where WantsCompletion =
1034 // !WantsRawCommandString.
1035 bool WantsCompletion() override { return true; }
1036
1037 Options *GetOptions() override { return &m_option_group; }
1038
1039protected:
1040 void DoExecute(llvm::StringRef raw_command,
1041 CommandReturnObject &result) override {
1042 auto exe_ctx = GetCommandInterpreter().GetExecutionContext();
1043 m_option_group.NotifyOptionParsingStarting(
1044 &exe_ctx); // This is a raw command, so notify the option group
1045
1046 Target *target = GetDebugger().GetSelectedTarget().get();
1047 StackFrame *frame = m_exe_ctx.GetFramePtr();
1048
1049 OptionsWithRaw args(raw_command);
1050
1051 llvm::StringRef expr = args.GetRawPart();
1052
1053 if (args.HasArgs())
1054 if (!ParseOptionsAndNotify(args.GetArgs(), result, m_option_group,
1055 exe_ctx))
1056 return;
1057
1058 // If no argument is present, issue an error message. There's no way to
1059 // set a watchpoint.
1060 if (raw_command.trim().empty()) {
1061 result.AppendError("required argument missing; specify an expression "
1062 "to evaluate into the address to watch for");
1063 return;
1064 }
1065
1066 // If no '-w' is specified, default to '-w write'.
1067 if (!m_option_watchpoint.watch_type_specified) {
1068 m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchModify;
1069 }
1070
1071 // We passed the sanity check for the command. Proceed to set the
1072 // watchpoint now.
1073 lldb::addr_t addr = 0;
1074 size_t size = 0;
1075
1076 ValueObjectSP valobj_sp;
1077
1078 // Use expression evaluation to arrive at the address to watch.
1080 options.SetCoerceToId(false);
1081 options.SetUnwindOnError(true);
1082 options.SetKeepInMemory(false);
1083 options.SetTryAllThreads(true);
1084 options.SetTimeout(std::nullopt);
1085 if (m_option_watchpoint.language_type != eLanguageTypeUnknown)
1086 options.SetLanguage(m_option_watchpoint.language_type);
1087
1088 ExpressionResults expr_result =
1089 target->EvaluateExpression(expr, frame, valobj_sp, options);
1090 if (expr_result != eExpressionCompleted) {
1091 result.AppendError("expression evaluation of address to watch failed");
1092 result.AppendErrorWithFormat("expression evaluated: \n%s", expr.data());
1093 if (valobj_sp && !valobj_sp->GetError().Success())
1094 result.AppendError(valobj_sp->GetError().AsCString());
1095 return;
1096 }
1097
1098 // Get the address to watch.
1099 bool success = false;
1100 addr = valobj_sp->GetValueAsUnsigned(0, &success);
1101 if (!success) {
1102 result.AppendError("expression did not evaluate to an address");
1103 return;
1104 }
1105
1106 if (m_option_watchpoint.watch_size.GetCurrentValue() != 0)
1107 size = m_option_watchpoint.watch_size.GetCurrentValue();
1108 else
1109 size = target->GetArchitecture().GetAddressByteSize();
1110
1111 // Now it's time to create the watchpoint.
1112 uint32_t watch_type;
1113 switch (m_option_watchpoint.watch_type) {
1115 watch_type = LLDB_WATCH_TYPE_READ;
1116 break;
1118 watch_type = LLDB_WATCH_TYPE_WRITE;
1119 break;
1121 watch_type = LLDB_WATCH_TYPE_MODIFY;
1122 break;
1125 break;
1126 default:
1127 watch_type = LLDB_WATCH_TYPE_MODIFY;
1128 }
1129
1130 // Fetch the type from the value object, the type of the watched object is
1131 // the pointee type
1132 /// of the expression, so convert to that if we found a valid type.
1133 CompilerType compiler_type(valobj_sp->GetCompilerType());
1134
1135 std::optional<uint64_t> valobj_size = valobj_sp->GetByteSize();
1136 // Set the type as a uint8_t array if the size being watched is
1137 // larger than the ValueObject's size (which is probably the size
1138 // of a pointer).
1139 if (valobj_size && size > *valobj_size) {
1140 auto type_system = compiler_type.GetTypeSystem();
1141 if (type_system) {
1142 CompilerType clang_uint8_type =
1143 type_system->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 8);
1144 compiler_type = clang_uint8_type.GetArrayType(size);
1145 }
1146 }
1147
1148 Status error;
1149 WatchpointSP watch_sp =
1150 target->CreateWatchpoint(addr, size, &compiler_type, watch_type, error);
1151 if (watch_sp) {
1152 watch_sp->SetWatchSpec(std::string(expr));
1153 Stream &output_stream = result.GetOutputStream();
1154 output_stream.Printf("Watchpoint created: ");
1155 watch_sp->GetDescription(&output_stream, lldb::eDescriptionLevelFull);
1156 output_stream.EOL();
1158 } else {
1159 result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64
1160 ", size=%" PRIu64 ").\n",
1161 addr, (uint64_t)size);
1162 if (error.AsCString(nullptr))
1163 result.AppendError(error.AsCString());
1165 }
1166
1167private:
1168 OptionGroupOptions m_option_group;
1169 OptionGroupWatchpoint m_option_watchpoint;
1170};
1171
1172// CommandObjectWatchpointSet
1173#pragma mark Set
1174
1176public:
1179 interpreter, "watchpoint set", "Commands for setting a watchpoint.",
1180 "watchpoint set <subcommand> [<subcommand-options>]") {
1181
1182 LoadSubCommand(
1183 "variable",
1185 LoadSubCommand(
1186 "expression",
1188 }
1189
1190 ~CommandObjectWatchpointSet() override = default;
1191};
1192
1193// CommandObjectMultiwordWatchpoint
1194#pragma mark MultiwordWatchpoint
1195
1197 CommandInterpreter &interpreter)
1198 : CommandObjectMultiword(interpreter, "watchpoint",
1199 "Commands for operating on watchpoints.",
1200 "watchpoint <subcommand> [<command-options>]") {
1201 CommandObjectSP list_command_object(
1202 new CommandObjectWatchpointList(interpreter));
1203 CommandObjectSP enable_command_object(
1204 new CommandObjectWatchpointEnable(interpreter));
1205 CommandObjectSP disable_command_object(
1206 new CommandObjectWatchpointDisable(interpreter));
1207 CommandObjectSP delete_command_object(
1208 new CommandObjectWatchpointDelete(interpreter));
1209 CommandObjectSP ignore_command_object(
1210 new CommandObjectWatchpointIgnore(interpreter));
1211 CommandObjectSP command_command_object(
1212 new CommandObjectWatchpointCommand(interpreter));
1213 CommandObjectSP modify_command_object(
1214 new CommandObjectWatchpointModify(interpreter));
1215 CommandObjectSP set_command_object(
1216 new CommandObjectWatchpointSet(interpreter));
1217
1218 list_command_object->SetCommandName("watchpoint list");
1219 enable_command_object->SetCommandName("watchpoint enable");
1220 disable_command_object->SetCommandName("watchpoint disable");
1221 delete_command_object->SetCommandName("watchpoint delete");
1222 ignore_command_object->SetCommandName("watchpoint ignore");
1223 command_command_object->SetCommandName("watchpoint command");
1224 modify_command_object->SetCommandName("watchpoint modify");
1225 set_command_object->SetCommandName("watchpoint set");
1226
1227 LoadSubCommand("list", list_command_object);
1228 LoadSubCommand("enable", enable_command_object);
1229 LoadSubCommand("disable", disable_command_object);
1230 LoadSubCommand("delete", delete_command_object);
1231 LoadSubCommand("ignore", ignore_command_object);
1232 LoadSubCommand("command", command_command_object);
1233 LoadSubCommand("modify", modify_command_object);
1234 LoadSubCommand("set", set_command_object);
1235}
1236
static bool CheckTargetForWatchpointOperations(Target *target, CommandReturnObject &result)
static void AddWatchpointDescription(Stream &s, Watchpoint &wp, lldb::DescriptionLevel level)
static int32_t WithRSAIndex(llvm::StringRef Arg)
static const char * RSA[4]
static llvm::raw_ostream & error(Stream &strm)
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void OptionParsingStarting(ExecutionContext *execution_context) override
CommandObjectWatchpointDelete(CommandInterpreter &interpreter)
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectWatchpointDelete() override=default
~CommandObjectWatchpointDisable() override=default
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
CommandObjectWatchpointDisable(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectWatchpointEnable(CommandInterpreter &interpreter)
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
~CommandObjectWatchpointEnable() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
void OptionParsingStarting(ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
CommandObjectWatchpointIgnore(CommandInterpreter &interpreter)
~CommandObjectWatchpointIgnore() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
CommandObjectWatchpointList(CommandInterpreter &interpreter)
~CommandObjectWatchpointList() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectWatchpointModify() override=default
CommandObjectWatchpointModify(CommandInterpreter &interpreter)
CommandObjectWatchpointSetExpression(CommandInterpreter &interpreter)
CommandObjectWatchpointSetVariable(CommandInterpreter &interpreter)
~CommandObjectWatchpointSet() override=default
CommandObjectWatchpointSet(CommandInterpreter &interpreter)
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
Definition: ArchSpec.cpp:691
A command line argument class.
Definition: Args.h:33
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
Definition: Args.h:116
llvm::ArrayRef< ArgEntry > entries() const
Definition: Args.h:128
const char * GetArgumentAtIndex(size_t idx) const
Gets the NULL terminated C string argument pointer for the argument at index idx.
Definition: Args.cpp:263
bool empty() const
Definition: Args.h:118
static bool InvokeCommonCompletionCallbacks(CommandInterpreter &interpreter, uint32_t completion_mask, lldb_private::CompletionRequest &request, SearchFilter *searcher)
CommandObjectMultiwordWatchpoint(CommandInterpreter &interpreter)
static bool VerifyWatchpointIDs(Target *target, Args &args, std::vector< uint32_t > &wp_ids)
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
std::vector< CommandArgumentData > CommandArgumentEntry
static void AddIDsArgumentData(CommandArgumentEntry &arg, lldb::CommandArgumentType ID, lldb::CommandArgumentType IDRange)
void AppendMessage(llvm::StringRef in_string)
void void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
TypeSystemSPWrapper GetTypeSystem() const
Accessors.
CompilerType GetArrayType(uint64_t size) const
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
"lldb/Utility/ArgCompletionRequest.h"
A uniqued constant string class.
Definition: ConstString.h:40
void SetLanguage(lldb::LanguageType language)
Definition: Target.h:313
void SetUnwindOnError(bool unwind=false)
Definition: Target.h:332
void SetKeepInMemory(bool keep=true)
Definition: Target.h:342
void SetCoerceToId(bool coerce=true)
Definition: Target.h:328
void SetTryAllThreads(bool try_others=true)
Definition: Target.h:365
void SetTimeout(const Timeout< std::micro > &timeout)
Definition: Target.h:353
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void FindGlobalVariables(ConstString name, size_t max_matches, VariableList &variable_list) const
Find global and static variables by name.
Definition: ModuleList.cpp:510
A pair of an option list with a 'raw' string as a suffix.
Definition: Args.h:315
A command line option parsing protocol class.
Definition: Options.h:58
void NotifyOptionParsingStarting(ExecutionContext *execution_context)
Definition: Options.cpp:33
This base class provides an interface to stack frames.
Definition: StackFrame.h:42
@ eExpressionPathOptionsAllowDirectIVarAccess
Definition: StackFrame.h:49
lldb::ValueObjectSP GetValueForVariableExpressionPath(llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, uint32_t options, lldb::VariableSP &var_sp, Status &error)
Create a ValueObject for a variable name / pathname, possibly including simple dereference/child sele...
Definition: StackFrame.cpp:508
An error handling class.
Definition: Status.h:44
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:134
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:155
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
Definition: Stream.cpp:198
void IndentMore(unsigned amount=2)
Increment the current indentation level.
Definition: Stream.cpp:195
lldb::WatchpointSP CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *type, uint32_t kind, Status &error)
Definition: Target.cpp:854
bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count)
Definition: Target.cpp:1405
bool EnableWatchpointByID(lldb::watch_id_t watch_id)
Definition: Target.cpp:1370
const lldb::ProcessSP & GetProcessSP() const
Definition: Target.cpp:220
bool RemoveAllWatchpoints(bool end_to_end=true)
Definition: Target.cpp:1223
bool RemoveWatchpointByID(lldb::watch_id_t watch_id)
Definition: Target.cpp:1389
bool DisableAllWatchpoints(bool end_to_end=true)
Definition: Target.cpp:1252
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:970
const ArchSpec & GetArchitecture() const
Definition: Target.h:1012
WatchpointList & GetWatchpointList()
Definition: Target.h:763
bool IgnoreAllWatchpoints(uint32_t ignore_count)
Definition: Target.cpp:1334
bool DisableWatchpointByID(lldb::watch_id_t watch_id)
Definition: Target.cpp:1351
lldb::WatchpointSP GetLastCreatedWatchpoint()
Definition: Target.h:759
bool EnableAllWatchpoints(bool end_to_end=true)
Definition: Target.cpp:1279
lldb::ExpressionResults EvaluateExpression(llvm::StringRef expression, ExecutionContextScope *exe_scope, lldb::ValueObjectSP &result_valobj_sp, const EvaluateExpressionOptions &options=EvaluateExpressionOptions(), std::string *fixed_expression=nullptr, ValueObject *ctx_obj=nullptr)
Definition: Target.cpp:2660
A collection of ValueObject values that.
lldb::ValueObjectSP GetValueObjectAtIndex(size_t idx)
static Status GetValuesForVariableExpressionPath(llvm::StringRef variable_expr_path, ExecutionContextScope *scope, GetVariableCallback callback, void *baton, VariableList &variable_list, ValueObjectList &valobj_list)
Definition: Variable.cpp:323
This class is used by Watchpoint to manage a list of watchpoints,.
lldb::WatchpointSP GetByIndex(uint32_t i)
Returns a shared pointer to the watchpoint with index i.
lldb::WatchpointSP FindByID(lldb::watch_id_t watchID) const
Returns a shared pointer to the watchpoint with id watchID, const version.
void GetListMutex(std::unique_lock< std::recursive_mutex > &lock)
Sets the passed in Locker to hold the Watchpoint List mutex.
size_t GetSize() const
Returns the number of elements in this watchpoint list.
void GetDescription(Stream *s, lldb::DescriptionLevel level)
Definition: Watchpoint.cpp:265
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:111
#define LLDB_WATCH_TYPE_WRITE
Definition: lldb-defines.h:46
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110
#define LLDB_WATCH_TYPE_MODIFY
Definition: lldb-defines.h:47
#define LLDB_WATCH_TYPE_READ
Definition: lldb-defines.h:45
#define UINT32_MAX
Definition: lldb-defines.h:19
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
std::vector< OptionArgElement > OptionElementVector
Definition: Options.h:43
@ eAddressTypeLoad
Address is an address as in the current target inferior process.
Definition: SBAddress.h:15
@ eWatchpointIDCompletion
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelBrief
@ eDescriptionLevelFull
@ eDescriptionLevelVerbose
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
Definition: lldb-forward.h:325
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:472
@ eLanguageTypeUnknown
Unknown or invalid language value.
ExpressionResults
The results of expression evaluation.
@ eExpressionCompleted
@ eEncodingUint
unsigned integer
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult
@ eArgTypeExpression
@ eArgTypeWatchpointID
@ eArgTypeWatchpointIDRange
std::shared_ptr< lldb_private::Watchpoint > WatchpointSP
Definition: lldb-forward.h:477
std::shared_ptr< lldb_private::Variable > VariableSP
Definition: lldb-forward.h:474
uint64_t addr_t
Definition: lldb-types.h:79
@ eNoDynamicValues
@ eValueTypeVariableLocal
function local variables
Used to build individual command argument lists.
Definition: CommandObject.h:93