[Lldb-commits] [lldb] cf0bc8d - [lldb][AIX] Adding AIX version of ptrace64 (#120390)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Dec 20 03:08:20 PST 2024
Author: Dhruv Srivastava
Date: 2024-12-20T11:08:17Z
New Revision: cf0bc8d0321a55f3f166131ec3fe45cdef7d5e3c
URL: https://github.com/llvm/llvm-project/commit/cf0bc8d0321a55f3f166131ec3fe45cdef7d5e3c
DIFF: https://github.com/llvm/llvm-project/commit/cf0bc8d0321a55f3f166131ec3fe45cdef7d5e3c.diff
LOG: [lldb][AIX] Adding AIX version of ptrace64 (#120390)
This PR is in reference to porting LLDB on AIX.
Link to discussions on llvm discourse and github:
1. https://discourse.llvm.org/t/port-lldb-to-ibm-aix/80640
2. https://github.com/llvm/llvm-project/issues/101657
The complete changes for porting are present in this draft PR:
https://github.com/llvm/llvm-project/pull/102601
Adding changes for minimal build for lldb binary on AIX. ptrace64 is
needed to debug 64-bit AIX debuggee, and its format is different than
the traditional ptrace on other platforms: [AIX
ptrace](https://www.ibm.com/docs/en/aix/7.3?topic=p-ptrace-ptracex-ptrace64-subroutine)
Added:
Modified:
lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
Removed:
################################################################################
diff --git a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
index 4a0437b634ee39..7b8b42a4b7fe07 100644
--- a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
+++ b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
@@ -192,7 +192,11 @@ struct ForkLaunchInfo {
}
// Start tracing this child that is about to exec.
+#ifdef _AIX
+ if (ptrace64(PT_TRACE_ME, 0, 0, 0, nullptr) == -1)
+#else
if (ptrace(PT_TRACE_ME, 0, nullptr, 0) == -1)
+#endif
ExitWithError(error_fd, "ptrace");
}
More information about the lldb-commits
mailing list