Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <sys/wait.h>
#include <unistd.h>

#include <sstream>
#include <csignal>
#include <sstream>

#ifdef __ANDROID__
#include <android/api-level.h>
Expand All @@ -47,8 +47,7 @@ static void write_string(int error_fd, const char *str) {
(void)r;
}

[[noreturn]] static void ExitWithError(int error_fd,
const char *operation) {
[[noreturn]] static void ExitWithError(int error_fd, const char *operation) {
int err = errno;
write_string(error_fd, operation);
write_string(error_fd, " failed: ");
Expand Down Expand Up @@ -193,8 +192,13 @@ struct ForkLaunchInfo {
}

// Start tracing this child that is about to exec.
#if !defined(_AIX)
if (ptrace(PT_TRACE_ME, 0, nullptr, 0) == -1)
ExitWithError(error_fd, "ptrace");
#else
if (ptrace64(PT_TRACE_ME, 0, 0, 0, nullptr) == -1)
ExitWithError(error_fd, "ptrace");
#endif
}

// Execute. We should never return...
Expand Down
Loading