[Lldb-commits] [lldb] [lldb][AIX] get host info for AIX (cont..) (PR #138687)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed May 7 00:18:16 PDT 2025
================
@@ -18,5 +20,18 @@ void HostInfoAIX::Terminate() { HostInfoBase::Terminate(); }
FileSpec HostInfoAIX::GetProgramFileSpec() {
static FileSpec g_program_filespec;
+ struct psinfo psinfoData;
+ auto BufferOrError = getProcFile(getpid(), "psinfo");
+ if (BufferOrError) {
+ std::unique_ptr<llvm::MemoryBuffer> PsinfoBuffer =
+ std::move(*BufferOrError);
+ memcpy(&psinfoData, PsinfoBuffer->getBufferStart(), sizeof(psinfoData));
+ llvm::StringRef exe_path(
+ psinfoData.pr_psargs,
+ strnlen(psinfoData.pr_psargs, sizeof(psinfoData.pr_psargs)));
+ if (!exe_path.empty()) {
+ g_program_filespec.SetFile(exe_path, FileSpec::Style::native);
+ }
----------------
labath wrote:
```suggestion
if (!exe_path.empty())
g_program_filespec.SetFile(exe_path, FileSpec::Style::native);
```
https://github.com/llvm/llvm-project/pull/138687
More information about the lldb-commits
mailing list