[Lldb-commits] [lldb] support attaching by name for platform android (PR #160931)

Roy Shi via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 29 06:43:47 PDT 2025


================
@@ -477,6 +477,85 @@ std::string PlatformAndroid::GetRunAs() {
   }
   return run_as.str();
 }
+uint32_t
+PlatformAndroid::FindProcesses(const ProcessInstanceInfoMatch &match_info,
+                               ProcessInstanceInfoList &proc_infos) {
+  // Use the parent implementation for host platform
+  if (IsHost())
+    return PlatformLinux::FindProcesses(match_info, proc_infos);
+
+  // For remote Android platform, implement process name lookup using adb
+  proc_infos.clear();
----------------
royitaqi wrote:

For my learning: What's the reason to not always clear this at the beginning and instead put it behind the above fallback.  The next block of code also falls back to `PlatformLinux`, hence my confusion.

https://github.com/llvm/llvm-project/pull/160931


More information about the lldb-commits mailing list