diff --git a/src/sys/debug.c b/src/sys/debug.c index 05a34ed3..2e5e4dff 100644 --- a/src/sys/debug.c +++ b/src/sys/debug.c @@ -10,6 +10,7 @@ #define SYM(x) case x: return #x; #define SYMBRC(x) case x: return "[" #x "]"; +int fsp_bp_global = 1; static ANSI_STRING DbgBreakPointInc = RTL_CONSTANT_STRING("Fsp*"); BOOLEAN HasDbgBreakPoint(const char *Function) { diff --git a/src/sys/driver.h b/src/sys/driver.h index d8cc6561..aceeca85 100644 --- a/src/sys/driver.h +++ b/src/sys/driver.h @@ -43,9 +43,10 @@ #define FSP_DEBUGBRK_() \ do \ { \ - static int fsp_bp_enabled = 1; \ - if (fsp_bp_enabled && HasDbgBreakPoint(__FUNCTION__))\ - try { DbgBreakPoint(); } except (EXCEPTION_EXECUTE_HANDLER) {}\ + extern int fsp_bp_global; \ + static int fsp_bp = 1; \ + if (fsp_bp && fsp_bp_global && !KD_DEBUGGER_NOT_PRESENT && HasDbgBreakPoint(__FUNCTION__))\ + DbgBreakPoint(); \ } while (0,0) #else #define FSP_DEBUGLOG_(fmt, rfmt, ...) ((void)0)