This commit was generated by cvs2svn to compensate for changes in r10,
[reactos.git] / reactos / include / internal / debug.h
index 055c54e..6c8a05f 100644 (file)
@@ -1,70 +1,72 @@
-/*\r
- * COPYRIGHT:       See COPYING in the top level directory\r
- * PROJECT:         ReactOS kernel\r
- * FILE:            include/internal/debug.h\r
- * PURPOSE:         Useful debugging macros\r
- * PROGRAMMER:      David Welch (welch@mcmail.com)\r
- * UPDATE HISTORY: \r
- *                28/05/98: Created\r
- */\r
-\r
-/*\r
- * NOTE: Define NDEBUG before including this header to disable debugging\r
- * macros\r
- */\r
-\r
-#ifndef __INTERNAL_DEBUG\r
-#define __INTERNAL_DEBUG\r
-\r
-\r
-#ifndef NDEBUG\r
-#define DPRINT(fmt,args...) do { printk("(%s:%d) ",__FILE__,__LINE__); printk(fmt,args); } while(0);\r
-//#define assert(x) if (!(x)) {printk("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); (*((unsigned int *)0))=1; for (;;); }\r
-#define assert(x) if (!(x)) {printk("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); for (;;); }\r
-#define CHECKPOINT printk("%s:%d\n",__FILE__,__LINE__)\r
-#else\r
-#define DPRINT(fmt,args...)\r
-#define assert(x)\r
-#define CHECKPOINT\r
-#endif /* NDEBUG */\r
-\r
-/*\r
- * FUNCTION: Assert a maximum value for the current irql\r
- * ARGUMENTS:\r
- *        x = Maximum irql\r
- */\r
-#define ASSERT_IRQL(x) assert(KeGetCurrentIrql()<=(x))\r
-\r
-#define HBP_EXECUTE     (0)\r
-#define HBP_WRITE       (1)\r
-#define HBP_READWRITE   (3)\r
-\r
-#define HBP_BYTE        (0)\r
-#define HBP_WORD        (1)\r
-#define HBP_DWORD       (3)\r
-\r
-/*\r
- * FUNCTION: Sets a hardware breakpoint\r
- * ARGUMENTS:\r
- *          i = breakpoint to set (0 to 3)\r
- *          addr = linear address to break on\r
- *          type = Type of access to break on\r
- *          len = length of the variable to watch\r
- * NOTES:\r
- *       The variable to watch must be aligned to its length (i.e. a dword\r
- *      breakpoint must be aligned to a dword boundary)\r
- * \r
- *       A fatal exception will be generated on the access to the variable.\r
- *       It is (at the moment) only really useful for catching undefined\r
- *       pointers if you know the variable effected but not the buggy\r
- *       routine. \r
- * \r
- * FIXME: Extend to call out to kernel debugger on breakpoint\r
- *        Add support for I/O breakpoints\r
- * REFERENCES: See the i386 programmer manual for more details\r
- */ \r
-void set_breakpoint(unsigned int i, unsigned int addr, unsigned int type,\r
-                   unsigned int len);\r
-\r
-\r
-#endif /* __INTERNAL_DEBUG */\r
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS kernel
+ * FILE:            include/internal/debug.h
+ * PURPOSE:         Useful debugging macros
+ * PROGRAMMER:      David Welch (welch@mcmail.com)
+ * UPDATE HISTORY: 
+ *                28/05/98: Created
+ */
+
+/*
+ * NOTE: Define NDEBUG before including this header to disable debugging
+ * macros
+ */
+
+#ifndef __INTERNAL_DEBUG
+#define __INTERNAL_DEBUG
+
+#define UNIMPLEMENTED do {printk("%s at %s:%d is umimplemented, have a nice day\n",__FUNCTION__,__FILE__,__LINE__); for(;;);  } while(0);
+
+#ifndef NDEBUG
+#define DPRINT(fmt,args...) do { printk("(%s:%d) ",__FILE__,__LINE__); printk(fmt,args); } while(0);
+//#define assert(x) if (!(x)) {printk("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); (*((unsigned int *)0))=1; for (;;); }
+#define assert(x) if (!(x)) {printk("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); for (;;); }
+#define CHECKPOINT printk("%s:%d\n",__FILE__,__LINE__)
+#else
+#define DPRINT(fmt,args...)
+#define assert(x)
+#define CHECKPOINT
+#endif /* NDEBUG */
+
+/*
+ * FUNCTION: Assert a maximum value for the current irql
+ * ARGUMENTS:
+ *        x = Maximum irql
+ */
+#define ASSERT_IRQL(x) assert(KeGetCurrentIrql()<=(x))
+#define assert_irql(x) assert(KeGetCurrentIrql()<=(x))
+
+#define HBP_EXECUTE     (0)
+#define HBP_WRITE       (1)
+#define HBP_READWRITE   (3)
+
+#define HBP_BYTE        (0)
+#define HBP_WORD        (1)
+#define HBP_DWORD       (3)
+
+/*
+ * FUNCTION: Sets a hardware breakpoint
+ * ARGUMENTS:
+ *          i = breakpoint to set (0 to 3)
+ *          addr = linear address to break on
+ *          type = Type of access to break on
+ *          len = length of the variable to watch
+ * NOTES:
+ *       The variable to watch must be aligned to its length (i.e. a dword
+ *      breakpoint must be aligned to a dword boundary)
+ * 
+ *       A fatal exception will be generated on the access to the variable.
+ *       It is (at the moment) only really useful for catching undefined
+ *       pointers if you know the variable effected but not the buggy
+ *       routine. 
+ * 
+ * FIXME: Extend to call out to kernel debugger on breakpoint
+ *        Add support for I/O breakpoints
+ * REFERENCES: See the i386 programmer manual for more details
+ */ 
+void set_breakpoint(unsigned int i, unsigned int addr, unsigned int type,
+                   unsigned int len);
+
+
+#endif /* __INTERNAL_DEBUG */