sys: improve FSP_DEBUGBRK_() macro

This commit is contained in:
Bill Zissimopoulos 2015-12-08 22:34:59 -08:00
parent 5abc81a58f
commit 0bbc1b4a43
2 changed files with 5 additions and 3 deletions

View File

@ -10,6 +10,7 @@
#define SYM(x) case x: return #x; #define SYM(x) case x: return #x;
#define SYMBRC(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*"); static ANSI_STRING DbgBreakPointInc = RTL_CONSTANT_STRING("Fsp*");
BOOLEAN HasDbgBreakPoint(const char *Function) BOOLEAN HasDbgBreakPoint(const char *Function)
{ {

View File

@ -43,9 +43,10 @@
#define FSP_DEBUGBRK_() \ #define FSP_DEBUGBRK_() \
do \ do \
{ \ { \
static int fsp_bp_enabled = 1; \ extern int fsp_bp_global; \
if (fsp_bp_enabled && HasDbgBreakPoint(__FUNCTION__))\ static int fsp_bp = 1; \
try { DbgBreakPoint(); } except (EXCEPTION_EXECUTE_HANDLER) {}\ if (fsp_bp && fsp_bp_global && !KD_DEBUGGER_NOT_PRESENT && HasDbgBreakPoint(__FUNCTION__))\
DbgBreakPoint(); \
} while (0,0) } while (0,0)
#else #else
#define FSP_DEBUGLOG_(fmt, rfmt, ...) ((void)0) #define FSP_DEBUGLOG_(fmt, rfmt, ...) ((void)0)