Skip to content

Commit

Permalink
fixup: only break if debugger attached
Browse files Browse the repository at this point in the history
not so trivial on linux
  • Loading branch information
ThisAMJ committed Sep 24, 2024
1 parent e3c0be2 commit 59db773
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Utils/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59db773

Please sign in to comment.