[lldb] common completion for process pids and process names

1. Added two common completions: `ProcessIDs` and `ProcessNames`, which are
refactored from their original dedicated option completions;
2. Removed the dedicated option completion functions of `process attach` and
`platform process attach`, so that they can use arg-type-bound common
completions instead;
3. Bound `eArgTypePid` to the pid completion, `eArgTypeProcessName` to the
process name completion in `CommandObject.cpp`;
4. Added a related test case.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D80700
This commit is contained in:
Gongyu Deng
2020-08-24 14:23:23 +02:00
committed by Raphael Isemann
parent d1a1cce5b1
commit 19311f5c3e
7 changed files with 84 additions and 95 deletions

View File

@@ -1,3 +1,5 @@
#include <iostream>
class Foo
{
public:
@@ -11,14 +13,16 @@ namespace { int Quux (void) { return 0; } }
struct Container { int MemberVar; };
int main()
{
Foo fooo;
Foo *ptr_fooo = &fooo;
fooo.Bar(1, 2);
int main(int argc, char *argv[]) {
if (argc > 1 && std::string(argv[1]) == "-x")
std::cin.get();
Container container;
Container *ptr_container = &container;
int q = Quux();
return container.MemberVar = 3; // Break here
Foo fooo;
Foo *ptr_fooo = &fooo;
fooo.Bar(1, 2);
Container container;
Container *ptr_container = &container;
int q = Quux();
return container.MemberVar = 3; // Break here
}