[Lldb-commits] [PATCH] D68048: [WIP][RFC] Improve fetching the process list on the android platform

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 26 13:22:19 PDT 2019


clayborg added a comment.

We were discussing things over here and were wondering if we even need the lldb-server in order to connect to the platform, or if we should just implement everything through command line commands like "adb", or link against a ADB shared library (is there one?), or another way? There are complexities that make the lldb-server in platform mode less useful like needing to run lldb-platform as the user for the application in order to get things working.

For example, if we just want to connect to a device before we have an app we want to debug, like if we wanted to just attach to a process, we currently do:

  (lldb) platform select remote-android
  (lldb) platform connect tcp://1234

And the user must launch lldb-server in platform mode themselves, which is not optimal. A better experience might be to do:

  (lldb) platform select remote-android
  (lldb) platform connect

with no args to "platform connect" and LLDB will auto connect to a single device if only one device is available. If multiple devices are available we would need to name the device like:

  (lldb) platform connect device123

where "device123" is the name or could be the serial number or what ever uniquely identifies a device.

If we use lldb-platform in server mode, what user do we launch it as if we have no app? If we use the "shell" user? If so, is the platform connection useful still once we need to upload things into an application's data directory? Or would we need to launch another lldb-server in platform mode that runs as a user? Do we currently need to run lldb-server in platform mode as the user if we want to launch a debug session?

Seems like it would be cleaner to avoid using lldb-server and just have PlatformAndroid use any command line tools ("adb", etc) to run each command and each command can pick the user that would be required. With this patch in the current form we are kind of going the route of adding to the lldb-server, but is that the right decision? I want to avoid having multiple lldb-server binaries being run as multiple different users if we can avoid it. Thoughts?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68048/new/

https://reviews.llvm.org/D68048





More information about the lldb-commits mailing list