Skip to content

Commit cf0bc8d

Browse files
[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. #101657 The complete changes for porting are present in this draft PR: #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)
1 parent c2bd5c2 commit cf0bc8d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lldb/source/Host/posix/ProcessLauncherPosixFork.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ struct ForkLaunchInfo {
192192
}
193193

194194
// Start tracing this child that is about to exec.
195+
#ifdef _AIX
196+
if (ptrace64(PT_TRACE_ME, 0, 0, 0, nullptr) == -1)
197+
#else
195198
if (ptrace(PT_TRACE_ME, 0, nullptr, 0) == -1)
199+
#endif
196200
ExitWithError(error_fd, "ptrace");
197201
}
198202

0 commit comments

Comments
 (0)