From 56948f950350cf2e2bcfeab1183435a5b0e33785 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 12 May 2016 18:19:24 +1000 Subject: [PATCH] debug_posix: add freebsd constants to tracing code --- debug_posix.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/debug_posix.cpp b/debug_posix.cpp index 8ed67e64..bc703769 100644 --- a/debug_posix.cpp +++ b/debug_posix.cpp @@ -25,6 +25,13 @@ #include #include +#include "./platform.hpp" + +#if defined(PLATFORM_FREEBSD) +#define PTRACE_ATTACH PT_ATTACH +#define PTRACE_DETACH PT_DETACH +#endif + /////////////////////////////////////////////////////////////////////////////// // Will return true if it is known we are under a debugger. This isn't @@ -44,9 +51,9 @@ is_debugged (void) int res; // attempt to trace our parent. this will fail if we're being debugged. - if (ptrace (PTRACE_ATTACH, ppid, nullptr, nullptr) == 0) { + if (ptrace (PTRACE_ATTACH, ppid, nullptr, 0) == 0) { waitpid (ppid, nullptr, 0); - ptrace (PTRACE_DETACH, ppid, nullptr, nullptr); + ptrace (PTRACE_DETACH, ppid, nullptr, 0); res = 0; } else {