[Lldb-commits] [lldb] [lldb][AIX] get host info for AIX (cont..) (PR #138687)
Hemang Gadhavi via lldb-commits
lldb-commits at lists.llvm.org
Thu May 22 04:49:54 PDT 2025
================
@@ -90,6 +90,31 @@ TEST(Host, LaunchProcessSetsArgv0) {
ASSERT_THAT(exit_status.get_future().get(), 0);
}
+TEST(Host, FindProcesses) {
+ SubsystemRAII<FileSystem> subsystems;
+
+ if (test_arg != 0)
+ exit(0);
+
+ ProcessLaunchInfo info;
+ ProcessInstanceInfoList processes;
+ ProcessInstanceInfoMatch match;
+ ProcessInstanceInfo p_info;
+ info.SetExecutableFile(FileSpec(TestMainArgv0),
+ /*add_exe_file_as_first_arg=*/true);
+ info.GetArguments().AppendArgument("--gtest_filter=Host.FindProcesses");
+ info.GetArguments().AppendArgument("--test-arg=48");
+ std::promise<int> exit_status;
+ info.SetMonitorProcessCallback([&](lldb::pid_t pid, int signal, int status) {
+ exit_status.set_value(status);
+ });
+ ASSERT_THAT_ERROR(Host::LaunchProcess(info).takeError(), Succeeded());
+ ASSERT_TRUE(Host::GetProcessInfo(info.GetProcessID(), p_info));
+ ASSERT_TRUE(Host::FindProcesses(match, processes));
+ EXPECT_TRUE(match.ProcessIDsMatch(p_info));
----------------
HemangGadhavi wrote:
I have made use of `GetArg0()` instead `GetName()`. Because `GetName()` is giving only name without absolute path.
and we need Absolute path to compare
https://github.com/llvm/llvm-project/pull/138687
More information about the lldb-commits
mailing list