[Lldb-commits] [lldb] [lldb][AIX] get host info for AIX (cont..) (PR #138687)
Hemang Gadhavi via lldb-commits
lldb-commits at lists.llvm.org
Wed May 21 02:23:14 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);
+ }
----------------
HemangGadhavi wrote:
Done
https://github.com/llvm/llvm-project/pull/138687
More information about the lldb-commits
mailing list