debug_posix: add freebsd constants to tracing code
This commit is contained in:
parent
afa60e9d1f
commit
56948f9503
@ -25,6 +25,13 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
|
#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
|
// Will return true if it is known we are under a debugger. This isn't
|
||||||
@ -44,9 +51,9 @@ is_debugged (void)
|
|||||||
int res;
|
int res;
|
||||||
|
|
||||||
// attempt to trace our parent. this will fail if we're being debugged.
|
// 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);
|
waitpid (ppid, nullptr, 0);
|
||||||
ptrace (PTRACE_DETACH, ppid, nullptr, nullptr);
|
ptrace (PTRACE_DETACH, ppid, nullptr, 0);
|
||||||
|
|
||||||
res = 0;
|
res = 0;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user