summaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorGongyu Deng <gy_deng@icloud.com>2020-08-11 13:13:49 +0200
committerRaphael Isemann <teemperor@gmail.com>2020-08-11 13:14:27 +0200
commitb2b7dbb47aa9aff1252d4440bb9986df5a7e67cb (patch)
tree15a5ba55c99111bb1f9ffb6a44a80570cf73f7ef /lldb/source/Commands/CommandObjectTarget.cpp
parent1de173c049841e0c3262ffbf416dba006500a140 (diff)
[lldb] stop-hook ID common completion for commands `target stop-hook enable/disable/delete'
1. Added a common completion StopHookIDs to provide completion with a list of stop hook ids; 2. Applied the common completion to commands: `target stop-hook delete/enable/disable'; 3. Added an related test case. Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D84123
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 927070f3d3ba..3cd4ad88afc7 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -4722,6 +4722,16 @@ public:
~CommandObjectTargetStopHookDelete() override = default;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+ if (request.GetCursorIndex())
+ return;
+ CommandCompletions::InvokeCommonCompletionCallbacks(
+ GetCommandInterpreter(), CommandCompletions::eStopHookIDCompletion,
+ request, nullptr);
+ }
+
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
Target &target = GetSelectedOrDummyTarget();
@@ -4770,6 +4780,16 @@ public:
~CommandObjectTargetStopHookEnableDisable() override = default;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+ if (request.GetCursorIndex())
+ return;
+ CommandCompletions::InvokeCommonCompletionCallbacks(
+ GetCommandInterpreter(), CommandCompletions::eStopHookIDCompletion,
+ request, nullptr);
+ }
+
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
Target &target = GetSelectedOrDummyTarget();