diff options
author | Raphael Isemann <teemperor@gmail.com> | 2020-03-06 15:49:23 -0800 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2020-03-06 17:05:25 -0800 |
commit | 2bba1c22e77a67bc6c245fbd4fa74160d33be564 (patch) | |
tree | 5dfe2a8167a8df8615838754af4d6a9a94390d17 /lldb/source/Commands/CommandObjectProcess.cpp | |
parent | f4d791f8332c2bb7e89849d0fe4ef48cb0a23229 (diff) | |
download | llvm-2bba1c22e77a67bc6c245fbd4fa74160d33be564.zip llvm-2bba1c22e77a67bc6c245fbd4fa74160d33be564.tar.gz llvm-2bba1c22e77a67bc6c245fbd4fa74160d33be564.tar.bz2 |
tab completion for process signal
Summary: Provide a list of Unix signals for the tap completion for command "process signal".
Reviewers: teemperor
Subscribers: labath, jingham, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D75418
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 504aec4..20bbf95 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -1034,6 +1034,20 @@ public: ~CommandObjectProcessSignal() override = default; + void + HandleArgumentCompletion(CompletionRequest &request, + OptionElementVector &opt_element_vector) override { + if (!m_exe_ctx.HasProcessScope() || request.GetCursorIndex() != 0) + return; + + UnixSignalsSP signals = m_exe_ctx.GetProcessPtr()->GetUnixSignals(); + int signo = signals->GetFirstSignalNumber(); + while (signo != LLDB_INVALID_SIGNAL_NUMBER) { + request.AddCompletion(signals->GetSignalAsCString(signo), ""); + signo = signals->GetNextSignalNumber(signo); + } + } + protected: bool DoExecute(Args &command, CommandReturnObject &result) override { Process *process = m_exe_ctx.GetProcessPtr(); |