From 59db773f35da07af5684f25da04a3d77b5b5f6c9 Mon Sep 17 00:00:00 2001 From: AMJ <69196954+ThisAMJ@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:44:19 +1000 Subject: [PATCH] fixup: only break if debugger attached not so trivial on linux --- src/Utils/Memory.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Utils/Memory.cpp b/src/Utils/Memory.cpp index 28c70f26..fba110cb 100644 --- a/src/Utils/Memory.cpp +++ b/src/Utils/Memory.cpp @@ -149,11 +149,10 @@ uintptr_t Memory::Scan(const char *moduleName, const char *pattern, int offset) if (result == 0) { if (console) console->DevMsg("Failed to find pattern \"%s\" in module \"%s\"\n", pattern, moduleName); -#ifdef SAR_DEV_BUILD - // handy for debugging #ifdef _WIN32 - DebugBreak(); + if (IsDebuggerPresent()) DebugBreak(); #else +#ifdef SAR_DEV_BUILD raise(SIGTRAP); #endif #endif