diff options
author | Raphael Isemann <teemperor@gmail.com> | 2021-07-22 13:37:34 +0200 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2021-07-22 13:51:21 +0200 |
commit | 078003482e90ff5c7ba047a3d3152f0b0c392b31 (patch) | |
tree | ac760eba38ab26c75190e268750628655c390a67 /lldb/source/Commands/CommandObjectProcess.cpp | |
parent | 5a4de84d55faa5502de38b4f7ec6c6ed43d90043 (diff) | |
download | llvm-078003482e90ff5c7ba047a3d3152f0b0c392b31.zip llvm-078003482e90ff5c7ba047a3d3152f0b0c392b31.tar.gz llvm-078003482e90ff5c7ba047a3d3152f0b0c392b31.tar.bz2 |
[lldb] Fix that `process signal` completion always returns all signals
`CompletionRequest::AddCompletion` adds the given string as completion of the
current command token. `CompletionRequest::TryCompleteCurrentArg` only adds it
if the current token is a prefix of the given string. We're using
`AddCompletion` for the `process signal` handler which means that `process
signal SIGIN` doesn't get uniquely completed to `process signal SIGINT` as we
unconditionally add all other signals (such as `SIGABRT`) as possible
completions.
By using `TryCompleteCurrentArg` we actually do the proper filtering which will
only add `SIGINT` (as that's the only signal with the prefix 'SIGIN' in the
example above).
Reviewed By: mib
Differential Revision: https://reviews.llvm.org/D105028
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 00fb4d66..7aaba37 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -1043,7 +1043,7 @@ public: UnixSignalsSP signals = m_exe_ctx.GetProcessPtr()->GetUnixSignals(); int signo = signals->GetFirstSignalNumber(); while (signo != LLDB_INVALID_SIGNAL_NUMBER) { - request.AddCompletion(signals->GetSignalAsCString(signo), ""); + request.TryCompleteCurrentArg(signals->GetSignalAsCString(signo)); signo = signals->GetNextSignalNumber(signo); } } |