2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: include/internal/debug.h
5 * PURPOSE: Useful debugging macros
6 * PROGRAMMER: David Welch (welch@mcmail.com)
12 * NOTE: Define NDEBUG before including this header to disable debugging
16 #ifndef __INTERNAL_DEBUG
17 #define __INTERNAL_DEBUG
19 #define UNIMPLEMENTED do {DbgPrint("%s at %s:%d is unimplemented, have a nice day\n",__FUNCTION__,__FILE__,__LINE__); for(;;); } while(0);
21 /* FIXME: should probably remove this later */
22 #if !defined(CHECKED) && !defined(NDEBUG)
28 #define assert(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); }
34 #define DPRINT1(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0);
35 #define CHECKPOINT1 do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0);
39 #define DPRINT(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0);
40 #define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0);
42 #define DPRINT(args...)
47 * FUNCTION: Assert a maximum value for the current irql
51 #define ASSERT_IRQL(x) assert(KeGetCurrentIrql()<=(x))
52 #define assert_irql(x) assert(KeGetCurrentIrql()<=(x))
54 /* Macros expanding to the appropriate inline assembly to raise a breakpoint */
56 #define ASM_BREAKPOINT "\nint $3\n"
57 #elif defined(_M_ALPHA)
58 #define ASM_BREAKPOINT "\ncall_pal bpt\n"
59 #elif defined(_M_MIPS)
60 #define ASM_BREAKPOINT "\nbreak\n"
62 #error Unsupported architecture.
65 #endif /* __INTERNAL_DEBUG */