This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Tab completion for process plugin name
ClosedPublic

Authored by MrHate on May 14 2020, 2:46 AM.

Details

Summary
  1. Added tab completion to process launch -p, process attach -P, process connect -p;
  2. Bound the plugin name common completion as the default completion for eArgTypePlugin arguments.

Diff Detail

Event Timeline

MrHate created this revision.May 14 2020, 2:46 AM
teemperor requested changes to this revision.May 22 2020, 3:43 AM

I think the two completions here are not related to each other? If yes, I think this should be two reviews/commits. Especially since the plugin completions is good to go, but the PID test should probably test that we get *some* pid back (so that test requires some small changes).

lldb/source/Commands/CommandObjectProcess.cpp
377

Nit: We don't usually do empty lines after case: I think.

lldb/test/API/functionalities/completion/TestCompletion.py
84

This is just testing that this isn't crashing, but not that we get some pid back. You could just take the pid of the current process and see that we find that (we know that the current process PID exists, so that should be safe).

This revision now requires changes to proceed.May 22 2020, 3:43 AM

I think the two completions here are not related to each other? If yes, I think this should be two reviews/commits. Especially since the plugin completions is good to go, but the PID test should probably test that we get *some* pid back (so that test requires some small changes).

The reason I put them together is because the command process attach will be provided with both the PID completion and the plugin name completion. So I think there should be a little relationship between these two completions.

MrHate updated this revision to Diff 265742.May 22 2020, 8:17 AM
MrHate retitled this revision from [lldb] Tab completion for process plugin name and pids to [lldb] Tab completion for process plugin name.
MrHate edited the summary of this revision. (Show Details)
  1. Removed PID completion from this patch;
  2. Removed the first empty lines for cases;
  3. Modified the title and the summary.
This revision is now accepted and ready to land.May 27 2020, 5:11 AM
This revision was automatically updated to reflect the committed changes.

This change makes the eArgTypePlugin be the completion for process plugins. Shouldn't we change the enum name and completion name to indicate that?

MrHate marked an inline comment as done.May 27 2020, 6:07 PM

That does make sense. I will split it into eArgTypeProcessPlugin and eArgTypeDisassemblePlugin along with the corresponding completion function names at the time I implement the disassemble related completion function.

That does make sense. I will split it into eArgTypeProcessPlugin and eArgTypeDisassemblePlugin along with the corresponding completion function names at the time I implement the disassemble related completion function.

Excellent, thanks!