[Lldb-commits] [lldb] support attaching by name for platform android (PR #160931)
Walter Erquinigo via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 9 06:52:44 PDT 2025
================
@@ -477,6 +477,248 @@ std::string PlatformAndroid::GetRunAs() {
}
return run_as.str();
}
+
+// Helper function to populate process status information from
+// /proc/[pid]/status
+void PlatformAndroid::PopulateProcessStatusInfo(
+ lldb::pid_t pid, ProcessInstanceInfo &process_info) {
+ // Read /proc/[pid]/status to get parent PID, UIDs, and GIDs
+ Status error;
+ auto status_adb = GetAdbClient(error);
+ if (error.Fail())
+ return;
+
+ std::string status_output;
+ StreamString status_cmd;
+ status_cmd.Printf(
+ "cat /proc/%llu/status 2>/dev/null | grep -E '^(PPid|Uid|Gid):'",
+ (unsigned long long)pid);
----------------
walter-erquinigo wrote:
static_cast
https://github.com/llvm/llvm-project/pull/160931
More information about the lldb-commits
mailing list