================ @@ -139,8 +177,53 @@ FileSpec HostInfoPosix::GetDefaultShell() { return FileSpec("/bin/sh"); } +FileSpec HostInfoPosix::GetProgramFileSpec() { + static FileSpec g_program_filespec; + + if (!g_program_filespec) { + char exe_path[PATH_MAX]; + ssize_t len = readlink("/proc/self/exe", exe_path, sizeof(exe_path) - 1); + if (len > 0) { + exe_path[len] = 0; + g_program_filespec.SetFile(exe_path, FileSpec::Style::native); + } + } + + return g_program_filespec; +} ---------------- DhruvSrivastavaX wrote:
Just one concern with not moving `GetProgramFileSpec` , is that `ComputeSupportExeDirectory` relies on calling this, in case the file_spec is not found. So we'll have to restore `ComputeSupportExeDirectory` as well back to Linux, unless we have a better option. https://github.com/llvm/llvm-project/pull/119694 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits