diff options
author | Med Ismail Bennani <ismail@bennani.ma> | 2023-06-06 10:24:48 -0700 |
---|---|---|
committer | Med Ismail Bennani <ismail@bennani.ma> | 2023-06-06 10:58:34 -0700 |
commit | 6a9c3e611505b7637b46fbaacaf50362c97a263d (patch) | |
tree | ad6cd9ec81eb504e18480d49fd1b616815eaa874 /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | 1e82b20118e31bd6c3844a84e03f701997a9b7ed (diff) | |
download | llvm-6a9c3e611505b7637b46fbaacaf50362c97a263d.zip llvm-6a9c3e611505b7637b46fbaacaf50362c97a263d.tar.gz llvm-6a9c3e611505b7637b46fbaacaf50362c97a263d.tar.bz2 |
[lldb/Commands] Add support to auto-completion for user commands
This patch should allow the user to set specific auto-completion type
for their custom commands.
To do so, we had to hoist the `CompletionType` enum so the user can
access it and add a new completion type flag to the CommandScriptAdd
Command Object.
So now, the user can specify which completion type will be used with
their custom command, when they register it.
This also makes the `crashlog` custom commands use disk-file completion
type, to browse through the user file system and load the report.
Differential Revision: https://reviews.llvm.org/D152011
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 30d2434..327dae4 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -828,9 +828,8 @@ public: void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override { - CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), CommandCompletions::eBreakpointCompletion, - request, nullptr); + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eBreakpointCompletion, request, nullptr); } Options *GetOptions() override { return &m_options; } @@ -902,9 +901,8 @@ public: void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override { - CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), CommandCompletions::eBreakpointCompletion, - request, nullptr); + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eBreakpointCompletion, request, nullptr); } protected: @@ -1017,9 +1015,8 @@ the second re-enables the first location."); void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override { - CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), CommandCompletions::eBreakpointCompletion, - request, nullptr); + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eBreakpointCompletion, request, nullptr); } protected: @@ -1394,9 +1391,8 @@ public: void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override { - CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), CommandCompletions::eBreakpointCompletion, - request, nullptr); + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eBreakpointCompletion, request, nullptr); } Options *GetOptions() override { return &m_options; } @@ -1803,9 +1799,8 @@ public: void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override { - CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), CommandCompletions::eBreakpointCompletion, - request, nullptr); + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eBreakpointCompletion, request, nullptr); } Options *GetOptions() override { return &m_option_group; } @@ -1887,9 +1882,8 @@ public: void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override { - CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), CommandCompletions::eBreakpointCompletion, - request, nullptr); + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eBreakpointCompletion, request, nullptr); } Options *GetOptions() override { return &m_option_group; } @@ -2203,9 +2197,8 @@ public: switch (GetDefinitions()[opt_defs_index].short_option) { case 'f': - CommandCompletions::InvokeCommonCompletionCallbacks( - interpreter, CommandCompletions::eDiskFileCompletion, request, - nullptr); + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + interpreter, lldb::eDiskFileCompletion, request, nullptr); break; case 'N': @@ -2343,9 +2336,8 @@ public: void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override { - CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), CommandCompletions::eBreakpointCompletion, - request, nullptr); + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eBreakpointCompletion, request, nullptr); } Options *GetOptions() override { return &m_options; } |