debugbreak
debugbreak copied to clipboard
add IsDebuggerPresent equivalent?
Hi, would it be possible to add an equivalent of IsDebuggerPresent to test if the process is actually being debugged? Thanks
Easy enough to add it yourself:
#if defined WGUI_OS_WINDOWS
#include <Windows.h>
WGUI_IS_DBG_ATTACHED_FN()
{
return IsDebuggerPresent();
}
#elif defined WGUI_OS_LINUX
#include <sys/ptrace.h>
WGUI_IS_DBG_ATTACHED_FN()
{
if (ptrace(PTRACE_TRACEME, 0, 1, 0) < 0)
{
return true;
}
return false;
}
#endif
That works for windows and linux. I'm sure other platforms like MacOS are just as simple