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 bool 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 true;
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 false;
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 return result.Succeeded();
265 }
266
267private:
269};
270
271// CommandObjectWatchpointEnable
272#pragma mark Enable
273
275public:
277 : CommandObjectParsed(interpreter, "enable",
278 "Enable the specified disabled watchpoint(s). If "
279 "no watchpoints are specified, enable all of them.",
280 nullptr, eCommandRequiresTarget) {
284 // Add the entry for the first argument for this command to the object's
285 // arguments vector.
286 m_arguments.push_back(arg);
287 }
288
289 ~CommandObjectWatchpointEnable() override = default;
290
291 void
293 OptionElementVector &opt_element_vector) override {
295 GetCommandInterpreter(), lldb::eWatchpointIDCompletion, request,
296 nullptr);
297 }
298
299protected:
300 bool DoExecute(Args &command, CommandReturnObject &result) override {
301 Target *target = &GetSelectedTarget();
302 if (!CheckTargetForWatchpointOperations(target, result))
303 return false;
304
305 std::unique_lock<std::recursive_mutex> lock;
306 target->GetWatchpointList().GetListMutex(lock);
307
308 const WatchpointList &watchpoints = target->GetWatchpointList();
309
310 size_t num_watchpoints = watchpoints.GetSize();
311
312 if (num_watchpoints == 0) {
313 result.AppendError("No watchpoints exist to be enabled.");
314 return false;
315 }
316
317 if (command.GetArgumentCount() == 0) {
318 // No watchpoint selected; enable all currently set watchpoints.
319 target->EnableAllWatchpoints();
320 result.AppendMessageWithFormat("All watchpoints enabled. (%" PRIu64
321 " watchpoints)\n",
322 (uint64_t)num_watchpoints);
324 } else {
325 // Particular watchpoints selected; enable them.
326 std::vector<uint32_t> wp_ids;
328 target, command, wp_ids)) {
329 result.AppendError("Invalid watchpoints specification.");
330 return false;
331 }
332
333 int count = 0;
334 const size_t size = wp_ids.size();
335 for (size_t i = 0; i < size; ++i)
336 if (target->EnableWatchpointByID(wp_ids[i]))
337 ++count;
338 result.AppendMessageWithFormat("%d watchpoints enabled.\n", count);
340 }
341
342 return result.Succeeded();
343 }
344};
345
346// CommandObjectWatchpointDisable
347#pragma mark Disable
348
350public:
352 : CommandObjectParsed(interpreter, "watchpoint disable",
353 "Disable the specified watchpoint(s) without "
354 "removing it/them. If no watchpoints are "
355 "specified, disable them all.",
356 nullptr, eCommandRequiresTarget) {
360 // Add the entry for the first argument for this command to the object's
361 // arguments vector.
362 m_arguments.push_back(arg);
363 }
364
366
367 void
369 OptionElementVector &opt_element_vector) override {
371 GetCommandInterpreter(), lldb::eWatchpointIDCompletion, request,
372 nullptr);
373 }
374
375protected:
376 bool DoExecute(Args &command, CommandReturnObject &result) override {
377 Target *target = &GetSelectedTarget();
378 if (!CheckTargetForWatchpointOperations(target, result))
379 return false;
380
381 std::unique_lock<std::recursive_mutex> lock;
382 target->GetWatchpointList().GetListMutex(lock);
383
384 const WatchpointList &watchpoints = target->GetWatchpointList();
385 size_t num_watchpoints = watchpoints.GetSize();
386
387 if (num_watchpoints == 0) {
388 result.AppendError("No watchpoints exist to be disabled.");
389 return false;
390 }
391
392 if (command.GetArgumentCount() == 0) {
393 // No watchpoint selected; disable all currently set watchpoints.
394 if (target->DisableAllWatchpoints()) {
395 result.AppendMessageWithFormat("All watchpoints disabled. (%" PRIu64
396 " watchpoints)\n",
397 (uint64_t)num_watchpoints);
399 } else {
400 result.AppendError("Disable all watchpoints failed\n");
401 }
402 } else {
403 // Particular watchpoints selected; disable them.
404 std::vector<uint32_t> wp_ids;
406 target, command, wp_ids)) {
407 result.AppendError("Invalid watchpoints specification.");
408 return false;
409 }
410
411 int count = 0;
412 const size_t size = wp_ids.size();
413 for (size_t i = 0; i < size; ++i)
414 if (target->DisableWatchpointByID(wp_ids[i]))
415 ++count;
416 result.AppendMessageWithFormat("%d watchpoints disabled.\n", count);
418 }
419
420 return result.Succeeded();
421 }
422};
423
424// CommandObjectWatchpointDelete
425#define LLDB_OPTIONS_watchpoint_delete
426#include "CommandOptions.inc"
427
428// CommandObjectWatchpointDelete
429#pragma mark Delete
430
432public:
434 : CommandObjectParsed(interpreter, "watchpoint delete",
435 "Delete the specified watchpoint(s). If no "
436 "watchpoints are specified, delete them all.",
437 nullptr, eCommandRequiresTarget) {
441 // Add the entry for the first argument for this command to the object's
442 // arguments vector.
443 m_arguments.push_back(arg);
444 }
445
446 ~CommandObjectWatchpointDelete() override = default;
447
448 void
450 OptionElementVector &opt_element_vector) override {
452 GetCommandInterpreter(), lldb::eWatchpointIDCompletion, request,
453 nullptr);
454 }
455
456 Options *GetOptions() override { return &m_options; }
457
458 class CommandOptions : public Options {
459 public:
460 CommandOptions() = default;
461
462 ~CommandOptions() override = default;
463
464 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
465 ExecutionContext *execution_context) override {
466 const int short_option = m_getopt_table[option_idx].val;
467
468 switch (short_option) {
469 case 'f':
470 m_force = true;
471 break;
472 default:
473 llvm_unreachable("Unimplemented option");
474 }
475
476 return {};
477 }
478
479 void OptionParsingStarting(ExecutionContext *execution_context) override {
480 m_force = false;
481 }
482
483 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
484 return llvm::ArrayRef(g_watchpoint_delete_options);
485 }
486
487 // Instance variables to hold the values for command options.
488 bool m_force = false;
489 };
490
491protected:
492 bool DoExecute(Args &command, CommandReturnObject &result) override {
493 Target *target = &GetSelectedTarget();
494 if (!CheckTargetForWatchpointOperations(target, result))
495 return false;
496
497 std::unique_lock<std::recursive_mutex> lock;
498 target->GetWatchpointList().GetListMutex(lock);
499
500 const WatchpointList &watchpoints = target->GetWatchpointList();
501
502 size_t num_watchpoints = watchpoints.GetSize();
503
504 if (num_watchpoints == 0) {
505 result.AppendError("No watchpoints exist to be deleted.");
506 return false;
507 }
508
509 if (command.empty()) {
510 if (!m_options.m_force &&
511 !m_interpreter.Confirm(
512 "About to delete all watchpoints, do you want to do that?",
513 true)) {
514 result.AppendMessage("Operation cancelled...");
515 } else {
516 target->RemoveAllWatchpoints();
517 result.AppendMessageWithFormat("All watchpoints removed. (%" PRIu64
518 " watchpoints)\n",
519 (uint64_t)num_watchpoints);
520 }
522 return result.Succeeded();
523 }
524
525 // Particular watchpoints selected; delete them.
526 std::vector<uint32_t> wp_ids;
528 wp_ids)) {
529 result.AppendError("Invalid watchpoints specification.");
530 return false;
531 }
532
533 int count = 0;
534 const size_t size = wp_ids.size();
535 for (size_t i = 0; i < size; ++i)
536 if (target->RemoveWatchpointByID(wp_ids[i]))
537 ++count;
538 result.AppendMessageWithFormat("%d watchpoints deleted.\n", count);
540
541 return result.Succeeded();
542 }
543
544private:
546};
547
548// CommandObjectWatchpointIgnore
549
550#pragma mark Ignore::CommandOptions
551#define LLDB_OPTIONS_watchpoint_ignore
552#include "CommandOptions.inc"
553
555public:
557 : CommandObjectParsed(interpreter, "watchpoint ignore",
558 "Set ignore count on the specified watchpoint(s). "
559 "If no watchpoints are specified, set them all.",
560 nullptr, eCommandRequiresTarget) {
564 // Add the entry for the first argument for this command to the object's
565 // arguments vector.
566 m_arguments.push_back(arg);
567 }
568
569 ~CommandObjectWatchpointIgnore() override = default;
570
571 void
573 OptionElementVector &opt_element_vector) override {
575 GetCommandInterpreter(), lldb::eWatchpointIDCompletion, request,
576 nullptr);
577 }
578
579 Options *GetOptions() override { return &m_options; }
580
581 class CommandOptions : public Options {
582 public:
583 CommandOptions() = default;
584
585 ~CommandOptions() override = default;
586
587 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
588 ExecutionContext *execution_context) override {
590 const int short_option = m_getopt_table[option_idx].val;
591
592 switch (short_option) {
593 case 'i':
594 if (option_arg.getAsInteger(0, m_ignore_count))
595 error.SetErrorStringWithFormat("invalid ignore count '%s'",
596 option_arg.str().c_str());
597 break;
598 default:
599 llvm_unreachable("Unimplemented option");
600 }
601
602 return error;
603 }
604
605 void OptionParsingStarting(ExecutionContext *execution_context) override {
606 m_ignore_count = 0;
607 }
608
609 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
610 return llvm::ArrayRef(g_watchpoint_ignore_options);
611 }
612
613 // Instance variables to hold the values for command options.
614
615 uint32_t m_ignore_count = 0;
616 };
617
618protected:
619 bool DoExecute(Args &command, CommandReturnObject &result) override {
620 Target *target = &GetSelectedTarget();
621 if (!CheckTargetForWatchpointOperations(target, result))
622 return false;
623
624 std::unique_lock<std::recursive_mutex> lock;
625 target->GetWatchpointList().GetListMutex(lock);
626
627 const WatchpointList &watchpoints = target->GetWatchpointList();
628
629 size_t num_watchpoints = watchpoints.GetSize();
630
631 if (num_watchpoints == 0) {
632 result.AppendError("No watchpoints exist to be ignored.");
633 return false;
634 }
635
636 if (command.GetArgumentCount() == 0) {
637 target->IgnoreAllWatchpoints(m_options.m_ignore_count);
638 result.AppendMessageWithFormat("All watchpoints ignored. (%" PRIu64
639 " watchpoints)\n",
640 (uint64_t)num_watchpoints);
642 } else {
643 // Particular watchpoints selected; ignore them.
644 std::vector<uint32_t> wp_ids;
646 target, command, wp_ids)) {
647 result.AppendError("Invalid watchpoints specification.");
648 return false;
649 }
650
651 int count = 0;
652 const size_t size = wp_ids.size();
653 for (size_t i = 0; i < size; ++i)
654 if (target->IgnoreWatchpointByID(wp_ids[i], m_options.m_ignore_count))
655 ++count;
656 result.AppendMessageWithFormat("%d watchpoints ignored.\n", count);
658 }
659
660 return result.Succeeded();
661 }
662
663private:
665};
666
667// CommandObjectWatchpointModify
668
669#pragma mark Modify::CommandOptions
670#define LLDB_OPTIONS_watchpoint_modify
671#include "CommandOptions.inc"
672
673#pragma mark Modify
674
676public:
679 interpreter, "watchpoint modify",
680 "Modify the options on a watchpoint or set of watchpoints in the "
681 "executable. "
682 "If no watchpoint is specified, act on the last created "
683 "watchpoint. "
684 "Passing an empty argument clears the modification.",
685 nullptr, eCommandRequiresTarget) {
689 // Add the entry for the first argument for this command to the object's
690 // arguments vector.
691 m_arguments.push_back(arg);
692 }
693
694 ~CommandObjectWatchpointModify() override = default;
695
696 void
698 OptionElementVector &opt_element_vector) override {
700 GetCommandInterpreter(), lldb::eWatchpointIDCompletion, request,
701 nullptr);
702 }
703
704 Options *GetOptions() override { return &m_options; }
705
706 class CommandOptions : public Options {
707 public:
708 CommandOptions() = default;
709
710 ~CommandOptions() override = default;
711
712 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
713 ExecutionContext *execution_context) override {
715 const int short_option = m_getopt_table[option_idx].val;
716
717 switch (short_option) {
718 case 'c':
719 m_condition = std::string(option_arg);
720 m_condition_passed = true;
721 break;
722 default:
723 llvm_unreachable("Unimplemented option");
724 }
725
726 return error;
727 }
728
729 void OptionParsingStarting(ExecutionContext *execution_context) override {
730 m_condition.clear();
731 m_condition_passed = false;
732 }
733
734 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
735 return llvm::ArrayRef(g_watchpoint_modify_options);
736 }
737
738 // Instance variables to hold the values for command options.
739
740 std::string m_condition;
741 bool m_condition_passed = false;
742 };
743
744protected:
745 bool DoExecute(Args &command, CommandReturnObject &result) override {
746 Target *target = &GetSelectedTarget();
747 if (!CheckTargetForWatchpointOperations(target, result))
748 return false;
749
750 std::unique_lock<std::recursive_mutex> lock;
751 target->GetWatchpointList().GetListMutex(lock);
752
753 const WatchpointList &watchpoints = target->GetWatchpointList();
754
755 size_t num_watchpoints = watchpoints.GetSize();
756
757 if (num_watchpoints == 0) {
758 result.AppendError("No watchpoints exist to be modified.");
759 return false;
760 }
761
762 if (command.GetArgumentCount() == 0) {
763 WatchpointSP watch_sp = target->GetLastCreatedWatchpoint();
764 watch_sp->SetCondition(m_options.m_condition.c_str());
766 } else {
767 // Particular watchpoints selected; set condition on them.
768 std::vector<uint32_t> wp_ids;
770 target, command, wp_ids)) {
771 result.AppendError("Invalid watchpoints specification.");
772 return false;
773 }
774
775 int count = 0;
776 const size_t size = wp_ids.size();
777 for (size_t i = 0; i < size; ++i) {
778 WatchpointSP watch_sp = watchpoints.FindByID(wp_ids[i]);
779 if (watch_sp) {
780 watch_sp->SetCondition(m_options.m_condition.c_str());
781 ++count;
782 }
783 }
784 result.AppendMessageWithFormat("%d watchpoints modified.\n", count);
786 }
787
788 return result.Succeeded();
789 }
790
791private:
793};
794
795// CommandObjectWatchpointSetVariable
796#pragma mark SetVariable
797
799public:
802 interpreter, "watchpoint set variable",
803 "Set a watchpoint on a variable. "
804 "Use the '-w' option to specify the type of watchpoint and "
805 "the '-s' option to specify the byte size to watch for. "
806 "If no '-w' option is specified, it defaults to modify. "
807 "If no '-s' option is specified, it defaults to the variable's "
808 "byte size. "
809 "Note that there are limited hardware resources for watchpoints. "
810 "If watchpoint setting fails, consider disable/delete existing "
811 "ones "
812 "to free up resources.",
813 nullptr,
814 eCommandRequiresFrame | eCommandTryTargetAPILock |
815 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
816 SetHelpLong(
817 R"(
818Examples:
819
820(lldb) watchpoint set variable -w read_write my_global_var
821
822)"
823 " Watches my_global_var for read/write access, with the region to watch \
824corresponding to the byte size of the data type.");
825
827 CommandArgumentData var_name_arg;
828
829 // Define the only variant of this arg.
830 var_name_arg.arg_type = eArgTypeVarName;
831 var_name_arg.arg_repetition = eArgRepeatPlain;
832
833 // Push the variant into the argument entry.
834 arg.push_back(var_name_arg);
835
836 // Push the data for the only argument into the m_arguments vector.
837 m_arguments.push_back(arg);
838
839 // Absorb the '-w' and '-s' options into our option group.
840 m_option_group.Append(&m_option_watchpoint, LLDB_OPT_SET_1, LLDB_OPT_SET_1);
841 m_option_group.Finalize();
843
844 ~CommandObjectWatchpointSetVariable() override = default;
845
846 void
847 HandleArgumentCompletion(CompletionRequest &request,
848 OptionElementVector &opt_element_vector) override {
849 if (request.GetCursorIndex() != 0)
850 return;
852 GetCommandInterpreter(), lldb::eVariablePathCompletion, request,
853 nullptr);
855
856 Options *GetOptions() override { return &m_option_group; }
857
858protected:
859 static size_t GetVariableCallback(void *baton, const char *name,
860 VariableList &variable_list) {
861 size_t old_size = variable_list.GetSize();
862 Target *target = static_cast<Target *>(baton);
863 if (target)
865 variable_list);
866 return variable_list.GetSize() - old_size;
867 }
868
869 bool DoExecute(Args &command, CommandReturnObject &result) override {
870 Target *target = GetDebugger().GetSelectedTarget().get();
871 StackFrame *frame = m_exe_ctx.GetFramePtr();
872
873 // If no argument is present, issue an error message. There's no way to
874 // set a watchpoint.
875 if (command.GetArgumentCount() <= 0) {
876 result.AppendError("required argument missing; "
877 "specify your program variable to watch for");
878 return false;
879 }
880
881 // If no '-w' is specified, default to '-w modify'.
882 if (!m_option_watchpoint.watch_type_specified) {
883 m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchModify;
884 }
885
886 // We passed the sanity check for the command. Proceed to set the
887 // watchpoint now.
888 lldb::addr_t addr = 0;
889 size_t size = 0;
890
891 VariableSP var_sp;
892 ValueObjectSP valobj_sp;
893 Stream &output_stream = result.GetOutputStream();
894
895 // A simple watch variable gesture allows only one argument.
896 if (command.GetArgumentCount() != 1) {
897 result.AppendError("specify exactly one variable to watch for");
898 return false;
899 }
900
901 // Things have checked out ok...
903 uint32_t expr_path_options =
906 valobj_sp = frame->GetValueForVariableExpressionPath(
907 command.GetArgumentAtIndex(0), eNoDynamicValues, expr_path_options,
908 var_sp, error);
909
910 if (!valobj_sp) {
911 // Not in the frame; let's check the globals.
912
913 VariableList variable_list;
914 ValueObjectList valobj_list;
915
917 command.GetArgumentAtIndex(0),
918 m_exe_ctx.GetBestExecutionContextScope(), GetVariableCallback, target,
919 variable_list, valobj_list));
920
921 if (valobj_list.GetSize())
922 valobj_sp = valobj_list.GetValueObjectAtIndex(0);
923 }
924
925 CompilerType compiler_type;
926
927 if (valobj_sp) {
928 AddressType addr_type;
929 addr = valobj_sp->GetAddressOf(false, &addr_type);
930 if (addr_type == eAddressTypeLoad) {
931 // We're in business.
932 // Find out the size of this variable.
933 size = m_option_watchpoint.watch_size == 0
934 ? valobj_sp->GetByteSize().value_or(0)
935 : m_option_watchpoint.watch_size;
936 }
937 compiler_type = valobj_sp->GetCompilerType();
938 } else {
939 const char *error_cstr = error.AsCString(nullptr);
940 if (error_cstr)
941 result.AppendError(error_cstr);
942 else
943 result.AppendErrorWithFormat("unable to find any variable "
944 "expression path that matches '%s'",
945 command.GetArgumentAtIndex(0));
946 return false;
947 }
948
949 // Now it's time to create the watchpoint.
950 uint32_t watch_type = 0;
951 switch (m_option_watchpoint.watch_type) {
953 watch_type |= LLDB_WATCH_TYPE_MODIFY;
954 break;
956 watch_type |= LLDB_WATCH_TYPE_READ;
957 break;
960 break;
962 watch_type |= LLDB_WATCH_TYPE_WRITE;
963 break;
965 break;
966 };
967
968 error.Clear();
969 WatchpointSP watch_sp =
970 target->CreateWatchpoint(addr, size, &compiler_type, watch_type, error);
971 if (!watch_sp) {
973 "Watchpoint creation failed (addr=0x%" PRIx64 ", size=%" PRIu64
974 ", variable expression='%s').\n",
975 addr, static_cast<uint64_t>(size), command.GetArgumentAtIndex(0));
976 if (const char *error_message = error.AsCString(nullptr))
977 result.AppendError(error_message);
978 return result.Succeeded();
979 }
980
981 watch_sp->SetWatchSpec(command.GetArgumentAtIndex(0));
982 watch_sp->SetWatchVariable(true);
983 if (var_sp) {
984 if (var_sp->GetDeclaration().GetFile()) {
985 StreamString ss;
986 // True to show fullpath for declaration file.
987 var_sp->GetDeclaration().DumpStopContext(&ss, true);
988 watch_sp->SetDeclInfo(std::string(ss.GetString()));
989 }
990 if (var_sp->GetScope() == eValueTypeVariableLocal)
991 watch_sp->SetupVariableWatchpointDisabler(m_exe_ctx.GetFrameSP());
992 }
993 output_stream.Printf("Watchpoint created: ");
994 watch_sp->GetDescription(&output_stream, lldb::eDescriptionLevelFull);
995 output_stream.EOL();
998 return result.Succeeded();
999 }
1000
1001private:
1002 OptionGroupOptions m_option_group;
1003 OptionGroupWatchpoint m_option_watchpoint;
1004};
1005
1006// CommandObjectWatchpointSetExpression
1007#pragma mark Set
1008
1010public:
1013 interpreter, "watchpoint set expression",
1014 "Set a watchpoint on an address by supplying an expression. "
1015 "Use the '-l' option to specify the language of the expression. "
1016 "Use the '-w' option to specify the type of watchpoint and "
1017 "the '-s' option to specify the byte size to watch for. "
1018 "If no '-w' option is specified, it defaults to modify. "
1019 "If no '-s' option is specified, it defaults to the target's "
1020 "pointer byte size. "
1021 "Note that there are limited hardware resources for watchpoints. "
1022 "If watchpoint setting fails, consider disable/delete existing "
1023 "ones "
1024 "to free up resources.",
1025 "",
1026 eCommandRequiresFrame | eCommandTryTargetAPILock |
1027 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
1028 SetHelpLong(
1029 R"(
1030Examples:
1031
1032(lldb) watchpoint set expression -w modify -s 1 -- foo + 32
1033
1034 Watches write access for the 1-byte region pointed to by the address 'foo + 32')");
1035
1037 CommandArgumentData expression_arg;
1038
1039 // Define the only variant of this arg.
1040 expression_arg.arg_type = eArgTypeExpression;
1041 expression_arg.arg_repetition = eArgRepeatPlain;
1042
1043 // Push the only variant into the argument entry.
1044 arg.push_back(expression_arg);
1045
1046 // Push the data for the only argument into the m_arguments vector.
1047 m_arguments.push_back(arg);
1048
1049 // Absorb the '-w' and '-s' options into our option group.
1050 m_option_group.Append(&m_option_watchpoint, LLDB_OPT_SET_ALL,
1052 m_option_group.Finalize();
1053 }
1055 ~CommandObjectWatchpointSetExpression() override = default;
1057 // Overrides base class's behavior where WantsCompletion =
1058 // !WantsRawCommandString.
1059 bool WantsCompletion() override { return true; }
1060
1061 Options *GetOptions() override { return &m_option_group; }
1062
1063protected:
1064 bool DoExecute(llvm::StringRef raw_command,
1065 CommandReturnObject &result) override {
1066 auto exe_ctx = GetCommandInterpreter().GetExecutionContext();
1067 m_option_group.NotifyOptionParsingStarting(
1068 &exe_ctx); // This is a raw command, so notify the option group
1069
1070 Target *target = GetDebugger().GetSelectedTarget().get();
1071 StackFrame *frame = m_exe_ctx.GetFramePtr();
1072
1073 OptionsWithRaw args(raw_command);
1074
1075 llvm::StringRef expr = args.GetRawPart();
1076
1077 if (args.HasArgs())
1078 if (!ParseOptionsAndNotify(args.GetArgs(), result, m_option_group,
1079 exe_ctx))
1080 return false;
1081
1082 // If no argument is present, issue an error message. There's no way to
1083 // set a watchpoint.
1084 if (raw_command.trim().empty()) {
1085 result.AppendError("required argument missing; specify an expression "
1086 "to evaluate into the address to watch for");
1087 return false;
1088 }
1089
1090 // If no '-w' is specified, default to '-w write'.
1091 if (!m_option_watchpoint.watch_type_specified) {
1092 m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchModify;
1093 }
1094
1095 // We passed the sanity check for the command. Proceed to set the
1096 // watchpoint now.
1097 lldb::addr_t addr = 0;
1098 size_t size = 0;
1099
1100 ValueObjectSP valobj_sp;
1101
1102 // Use expression evaluation to arrive at the address to watch.
1104 options.SetCoerceToId(false);
1105 options.SetUnwindOnError(true);
1106 options.SetKeepInMemory(false);
1107 options.SetTryAllThreads(true);
1108 options.SetTimeout(std::nullopt);
1109 if (m_option_watchpoint.language_type != eLanguageTypeUnknown)
1110 options.SetLanguage(m_option_watchpoint.language_type);
1111
1112 ExpressionResults expr_result =
1113 target->EvaluateExpression(expr, frame, valobj_sp, options);
1114 if (expr_result != eExpressionCompleted) {
1115 result.AppendError("expression evaluation of address to watch failed");
1116 result.AppendErrorWithFormat("expression evaluated: \n%s", expr.data());
1117 if (valobj_sp && !valobj_sp->GetError().Success())
1118 result.AppendError(valobj_sp->GetError().AsCString());
1119 return false;
1120 }
1121
1122 // Get the address to watch.
1123 bool success = false;
1124 addr = valobj_sp->GetValueAsUnsigned(0, &success);
1125 if (!success) {
1126 result.AppendError("expression did not evaluate to an address");
1127 return false;
1128 }
1129
1130 if (m_option_watchpoint.watch_size != 0)
1131 size = m_option_watchpoint.watch_size;
1132 else
1133 size = target->GetArchitecture().GetAddressByteSize();
1134
1135 // Now it's time to create the watchpoint.
1136 uint32_t watch_type;
1137 switch (m_option_watchpoint.watch_type) {
1139 watch_type = LLDB_WATCH_TYPE_READ;
1140 break;
1142 watch_type = LLDB_WATCH_TYPE_WRITE;
1143 break;
1145 watch_type = LLDB_WATCH_TYPE_MODIFY;
1146 break;
1149 break;
1150 default:
1151 watch_type = LLDB_WATCH_TYPE_MODIFY;
1152 }
1153
1154 // Fetch the type from the value object, the type of the watched object is
1155 // the pointee type
1156 /// of the expression, so convert to that if we found a valid type.
1157 CompilerType compiler_type(valobj_sp->GetCompilerType());
1158
1159 Status error;
1160 WatchpointSP watch_sp =
1161 target->CreateWatchpoint(addr, size, &compiler_type, watch_type, error);
1162 if (watch_sp) {
1163 watch_sp->SetWatchSpec(std::string(expr));
1164 Stream &output_stream = result.GetOutputStream();
1165 output_stream.Printf("Watchpoint created: ");
1166 watch_sp->GetDescription(&output_stream, lldb::eDescriptionLevelFull);
1167 output_stream.EOL();
1169 } else {
1170 result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64
1171 ", size=%" PRIu64 ").\n",
1172 addr, (uint64_t)size);
1173 if (error.AsCString(nullptr))
1174 result.AppendError(error.AsCString());
1175 }
1177 return result.Succeeded();
1178 }
1179
1180private:
1181 OptionGroupOptions m_option_group;
1182 OptionGroupWatchpoint m_option_watchpoint;
1183};
1184
1185// CommandObjectWatchpointSet
1186#pragma mark Set
1187
1189public:
1192 interpreter, "watchpoint set", "Commands for setting a watchpoint.",
1193 "watchpoint set <subcommand> [<subcommand-options>]") {
1194
1195 LoadSubCommand(
1196 "variable",
1198 LoadSubCommand(
1199 "expression",
1201 }
1202
1203 ~CommandObjectWatchpointSet() override = default;
1204};
1205
1206// CommandObjectMultiwordWatchpoint
1207#pragma mark MultiwordWatchpoint
1208
1210 CommandInterpreter &interpreter)
1211 : CommandObjectMultiword(interpreter, "watchpoint",
1212 "Commands for operating on watchpoints.",
1213 "watchpoint <subcommand> [<command-options>]") {
1214 CommandObjectSP list_command_object(
1215 new CommandObjectWatchpointList(interpreter));
1216 CommandObjectSP enable_command_object(
1217 new CommandObjectWatchpointEnable(interpreter));
1218 CommandObjectSP disable_command_object(
1219 new CommandObjectWatchpointDisable(interpreter));
1220 CommandObjectSP delete_command_object(
1221 new CommandObjectWatchpointDelete(interpreter));
1222 CommandObjectSP ignore_command_object(
1223 new CommandObjectWatchpointIgnore(interpreter));
1224 CommandObjectSP command_command_object(
1225 new CommandObjectWatchpointCommand(interpreter));
1226 CommandObjectSP modify_command_object(
1227 new CommandObjectWatchpointModify(interpreter));
1228 CommandObjectSP set_command_object(
1229 new CommandObjectWatchpointSet(interpreter));
1230
1231 list_command_object->SetCommandName("watchpoint list");
1232 enable_command_object->SetCommandName("watchpoint enable");
1233 disable_command_object->SetCommandName("watchpoint disable");
1234 delete_command_object->SetCommandName("watchpoint delete");
1235 ignore_command_object->SetCommandName("watchpoint ignore");
1236 command_command_object->SetCommandName("watchpoint command");
1237 modify_command_object->SetCommandName("watchpoint modify");
1238 set_command_object->SetCommandName("watchpoint set");
1239
1240 LoadSubCommand("list", list_command_object);
1241 LoadSubCommand("enable", enable_command_object);
1242 LoadSubCommand("disable", disable_command_object);
1243 LoadSubCommand("delete", delete_command_object);
1244 LoadSubCommand("ignore", ignore_command_object);
1245 LoadSubCommand("command", command_command_object);
1246 LoadSubCommand("modify", modify_command_object);
1247 LoadSubCommand("set", set_command_object);
1248}
1249
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
bool DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectWatchpointDelete(CommandInterpreter &interpreter)
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The input array contains a parsed version of the line.
~CommandObjectWatchpointDelete() override=default
~CommandObjectWatchpointDisable() override=default
bool DoExecute(Args &command, CommandReturnObject &result) override
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The input array contains a parsed version of the line.
CommandObjectWatchpointDisable(CommandInterpreter &interpreter)
CommandObjectWatchpointEnable(CommandInterpreter &interpreter)
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The input array contains a parsed version of the line.
bool DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectWatchpointEnable() override=default
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 input array contains a parsed version of the line.
CommandObjectWatchpointIgnore(CommandInterpreter &interpreter)
bool DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectWatchpointIgnore() override=default
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
bool 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 input array contains a parsed version of the line.
~CommandObjectWatchpointModify() override=default
bool DoExecute(Args &command, CommandReturnObject &result) override
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
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:483
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:41
@ eExpressionPathOptionsAllowDirectIVarAccess
Definition: StackFrame.h:48
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:107
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:128
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
Definition: Stream.cpp:171
void IndentMore(unsigned amount=2)
Increment the current indentation level.
Definition: Stream.cpp:168
lldb::WatchpointSP CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *type, uint32_t kind, Status &error)
Definition: Target.cpp:815
bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count)
Definition: Target.cpp:1359
bool EnableWatchpointByID(lldb::watch_id_t watch_id)
Definition: Target.cpp:1324
const lldb::ProcessSP & GetProcessSP() const
Definition: Target.cpp:220
bool RemoveAllWatchpoints(bool end_to_end=true)
Definition: Target.cpp:1177
bool RemoveWatchpointByID(lldb::watch_id_t watch_id)
Definition: Target.cpp:1343
bool DisableAllWatchpoints(bool end_to_end=true)
Definition: Target.cpp:1206
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:967
const ArchSpec & GetArchitecture() const
Definition: Target.h:1009
WatchpointList & GetWatchpointList()
Definition: Target.h:761
bool IgnoreAllWatchpoints(uint32_t ignore_count)
Definition: Target.cpp:1288
bool DisableWatchpointByID(lldb::watch_id_t watch_id)
Definition: Target.cpp:1305
lldb::WatchpointSP GetLastCreatedWatchpoint()
Definition: Target.h:757
bool EnableAllWatchpoints(bool end_to_end=true)
Definition: Target.cpp:1233
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:2611
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:322
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:259
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:104
#define LLDB_WATCH_TYPE_WRITE
Definition: lldb-defines.h:46
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:103
#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
@ eVariablePathCompletion
@ eWatchpointIDCompletion
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelBrief
@ eDescriptionLevelFull
@ eDescriptionLevelVerbose
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
Definition: lldb-forward.h:315
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:458
@ eLanguageTypeUnknown
Unknown or invalid language value.
ExpressionResults
The results of expression evaluation.
@ eExpressionCompleted
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult
@ eArgTypeExpression
@ eArgTypeWatchpointID
@ eArgTypeWatchpointIDRange
std::shared_ptr< lldb_private::Watchpoint > WatchpointSP
Definition: lldb-forward.h:463
std::shared_ptr< lldb_private::Variable > VariableSP
Definition: lldb-forward.h:460
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