From 0bbc1b4a43b130ac05d1297118731b5b129ba379 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Tue, 8 Dec 2015 22:34:59 -0800 Subject: [PATCH] sys: improve FSP_DEBUGBRK_() macro --- src/sys/debug.c | 1 + src/sys/driver.h | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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)