23 struct psinfo psinfoData;
24 auto BufferOrError =
getProcFile(getpid(),
"psinfo");
26 std::unique_ptr<llvm::MemoryBuffer> PsinfoBuffer =
27 std::move(*BufferOrError);
28 memcpy(&psinfoData, PsinfoBuffer->getBufferStart(),
sizeof(psinfoData));
29 llvm::StringRef exe_path(
31 strnlen(psinfoData.pr_psargs,
sizeof(psinfoData.pr_psargs)));
32 if (!exe_path.empty())
33 g_program_filespec.
SetFile(exe_path, FileSpec::Style::native);
35 return g_program_filespec;