aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectWatchpoint.cpp
diff options
context:
space:
mode:
authorGongyu Deng <gy_deng@icloud.com>2020-08-11 13:38:36 +0200
committerRaphael Isemann <teemperor@gmail.com>2020-08-11 14:25:09 +0200
commit4f3559db1f313eed8bd84377de0fb2300a58125b (patch)
tree17ba7811adbd3657d1ac1607d3e25a7452c1aaa6 /lldb/source/Commands/CommandObjectWatchpoint.cpp
parent3483c28c5bc16d37d6c0f4e760357e4934f83b97 (diff)
downloadllvm-4f3559db1f313eed8bd84377de0fb2300a58125b.zip
llvm-4f3559db1f313eed8bd84377de0fb2300a58125b.tar.gz
llvm-4f3559db1f313eed8bd84377de0fb2300a58125b.tar.bz2
[lldb] watchpoint ID common completion for commands `watchpoint delete/enable/disable/modify/ignore`
1. Added a common completion WatchPointIDs to complete with a list of the IDs of the current watchpoints; 2. Applied the completion to these commands: watchpoint delete/enable/disable/modify/ignore; 3. Added a correlated test case. Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D84104
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp
index 390e241..e7b1f31 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -292,6 +292,14 @@ public:
~CommandObjectWatchpointEnable() override = default;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+ CommandCompletions::InvokeCommonCompletionCallbacks(
+ GetCommandInterpreter(), CommandCompletions::eWatchPointIDCompletion,
+ request, nullptr);
+ }
+
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
Target *target = &GetSelectedTarget();
@@ -362,6 +370,14 @@ public:
~CommandObjectWatchpointDisable() override = default;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+ CommandCompletions::InvokeCommonCompletionCallbacks(
+ GetCommandInterpreter(), CommandCompletions::eWatchPointIDCompletion,
+ request, nullptr);
+ }
+
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
Target *target = &GetSelectedTarget();
@@ -439,6 +455,14 @@ public:
~CommandObjectWatchpointDelete() override = default;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+ CommandCompletions::InvokeCommonCompletionCallbacks(
+ GetCommandInterpreter(), CommandCompletions::eWatchPointIDCompletion,
+ request, nullptr);
+ }
+
Options *GetOptions() override { return &m_options; }
class CommandOptions : public Options {
@@ -557,6 +581,14 @@ public:
~CommandObjectWatchpointIgnore() override = default;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+ CommandCompletions::InvokeCommonCompletionCallbacks(
+ GetCommandInterpreter(), CommandCompletions::eWatchPointIDCompletion,
+ request, nullptr);
+ }
+
Options *GetOptions() override { return &m_options; }
class CommandOptions : public Options {
@@ -677,6 +709,14 @@ public:
~CommandObjectWatchpointModify() override = default;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+ CommandCompletions::InvokeCommonCompletionCallbacks(
+ GetCommandInterpreter(), CommandCompletions::eWatchPointIDCompletion,
+ request, nullptr);
+ }
+
Options *GetOptions() override { return &m_options; }
class CommandOptions : public Options {