This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix that `process signal` completion always returns all signals
ClosedPublic

Authored by teemperor on Jun 28 2021, 6:58 AM.

Details

Summary

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).

Diff Detail

Event Timeline

teemperor created this revision.Jun 28 2021, 6:58 AM
teemperor requested review of this revision.Jun 28 2021, 6:58 AM
mib accepted this revision.Jun 28 2021, 7:00 AM

LGTM!

This revision is now accepted and ready to land.Jun 28 2021, 7:00 AM
This revision was landed with ongoing or failed builds.Jul 22 2021, 4:51 AM
This revision was automatically updated to reflect the committed changes.