[platform process list] add a flag for showing the processes of all users
authorWalter Erquinigo <a20012251@gmail.com>
Sat, 12 Oct 2019 00:44:50 +0000 (00:44 +0000)
committerWalter Erquinigo <a20012251@gmail.com>
Sat, 12 Oct 2019 00:44:50 +0000 (00:44 +0000)
commit914f38295e1249daea77d75da230a4179a9a5b3b
treef58144c6f953dd4eb455cd66272c49f6b6a758b6
parentc8e5b90ba65959fed4b1da1a7aee2175003f1a7c
[platform process list] add a flag for showing the processes of all users

Summary:
For context: https://reviews.llvm.org/D68293

We need a way to show all the processes on android regardless of the user id.
When you run `platform process list`, you only see the processes with the same user as the user that launched lldb-server. However, it's quite useful to see all the processes, though, and it will lay a foundation for full apk debugging support from lldb.

Before:
```
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
3234   1                 aarch64-unknown-linux-android adbd
8034   3234              aarch64-unknown-linux-android sh
9096   3234              aarch64-unknown-linux-android sh
9098   9096              aarch64-unknown-linux-android lldb-server
(lldb) ^D
```

Now:
```
(lldb) platform process list -x
205 matching processes were found on "remote-android"
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
1      0                                          init
524    1                                          init
525    1                                          init
531    1                                          ueventd
568    1                                          logd
569    1                 aarch64-unknown-linux-android servicemanager
570    1                 aarch64-unknown-linux-android hwservicemanager
571    1                 aarch64-unknown-linux-android vndservicemanager
577    1                 aarch64-unknown-linux-android qseecomd
580    577               aarch64-unknown-linux-android qseecomd
...
23816  979                                        com.android.providers.calendar
24600  979                                        com.verizon.mips.services
27888  979                                        com.hualai
28043  2378                                       com.android.chrome:sandboxed_process0
31449  979                                        com.att.shm
31779  979                                        com.samsung.android.authfw
31846  979                                        com.samsung.android.server.iris
32014  979                                        com.samsung.android.MtpApplication
32045  979                                        com.samsung.InputEventApp
```

Reviewers: labath,xiaobai,aadsm,clayborg

Subscribers:

> llvm-svn: 374584

llvm-svn: 374620
lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
lldb/source/Commands/CommandObjectPlatform.cpp
lldb/source/Commands/Options.td
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp