Skip to content

[LLDB/Android] Cannot list processes #164192

@emrekultursay

Description

@emrekultursay

After #160931, when debugging Android remotely, platform process list command cannot find any processes,

  • After the change:
(lldb) platform process list
error: no processes were found on the "remote-android" platform

(lldb) platform process list -n com.example.hellojni
1 matching process was found on "remote-android"
 whose name matched "com.example.hellojni"
PID    PARENT USER       TRIPLE                         NAME
====== ====== ========== ============================== ============================
5276   359    u0_a192                                   com.example.hellojni

(lldb) platform process list -p 5276
PID    PARENT USER       TRIPLE                         NAME
====== ====== ========== ============================== ============================
5276   359    u0_a192    x86_64-unknown-linux-android   app_process64
  • Before the change:
(lldb) platform process list
5 matching processes were found on "remote-android"

PID    PARENT USER       TRIPLE                         NAME
====== ====== ========== ============================== ============================
5276   359    u0_a192    x86_64-unknown-linux-android   app_process64
5357   5355   u0_a192    x86_64-unknown-linux-android   sh
5370   5357   u0_a192    x86_64-unknown-linux-android   sh
5377   5370   u0_a192    x86_64-unknown-linux-android   lldb-server
5510   5394   u0_a192    x86_64-unknown-linux-android   sh

(lldb) platform process list -n com.example.hellojni
error: no processes were found that matched "com.example.hellojni" on the "remote-android" platform

(lldb) platform process list -p 5276
PID    PARENT USER       TRIPLE                         NAME
====== ====== ========== ============================== ============================
5276   359    u0_a192    x86_64-unknown-linux-android   app_process64

Note also that the results returned by platform process list -n are inconsistent with platform process list -p (and inconsistent with the results of platform process list before the change). With -n, it returns no triple and a different process name. LLDB used to return app_process64 (zygote). This may be the root cause.


  • Repro instructions

On the Android side:

$ adb shell
adb$ run-as com.example.hellojni
adb|com.example.hellojni$ /data/data/com.example.hellojni/lldb/bin/lldb-server platform --server --listen unix-abstract:///com.example.hellojni-0/platform-156393867851.sock --log-file /data/data/com.example.hellojni/lldb/log/platform.log --log-channels 'lldb process:gdb-remote packets'

On the host side:

(lldb) platform select remote-android
(lldb) platform connect unix-abstract-connect://[emulator-5554]/com.example.hellojni-0/platform-156393867851.sock
(lldb) platform process list

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions