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