Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendebug.h
Go to the documentation of this file.
00001 /* 00002 * FreeLoader 00003 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, write to the Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 */ 00019 00020 #ifndef __DEBUG_H 00021 #define __DEBUG_H 00022 00023 #define DPRINT_NONE 0 // No debug print 00024 #define DPRINT_WARNING 1 // debugger messages and other misc stuff 00025 #define DPRINT_MEMORY 2 // memory management messages 00026 #define DPRINT_FILESYSTEM 3 // file system messages 00027 #define DPRINT_INIFILE 4 // .ini file messages 00028 #define DPRINT_UI 5 // user interface messages 00029 #define DPRINT_DISK 6 // disk messages 00030 #define DPRINT_CACHE 7 // cache messages 00031 #define DPRINT_REGISTRY 8 // registry messages 00032 #define DPRINT_REACTOS 9 // ReactOS messages 00033 #define DPRINT_LINUX 10 // Linux messages 00034 #define DPRINT_HWDETECT 11 // hardware detection messages 00035 #define DPRINT_WINDOWS 12 // messages from Windows loader 00036 #define DPRINT_PELOADER 13 // messages from PE images loader 00037 #define DPRINT_SCSIPORT 14 // messages from SCSI miniport 00038 #define DPRINT_HEAP 15 // messages in a bottle 00039 #define DBG_CHANNELS_COUNT 16 00040 00041 #if DBG && !defined(_M_ARM) 00042 00043 VOID DebugInit(VOID); 00044 ULONG DbgPrint(const char *Format, ...); 00045 VOID DbgPrint2(ULONG Mask, ULONG Level, const char *File, ULONG Line, char *Format, ...); 00046 VOID DebugDumpBuffer(ULONG Mask, PVOID Buffer, ULONG Length); 00047 VOID DbgParseDebugChannels(PCHAR Value); 00048 00049 #define ERR_LEVEL 0x1 00050 #define FIXME_LEVEL 0x2 00051 #define WARN_LEVEL 0x4 00052 #define TRACE_LEVEL 0x8 00053 00054 #define MAX_LEVEL ERR_LEVEL | FIXME_LEVEL | WARN_LEVEL | TRACE_LEVEL 00055 00056 #define DBG_DEFAULT_CHANNEL(ch) static int DbgDefaultChannel = DPRINT_##ch 00057 00058 #define ERR_CH(ch, fmt, ...) DbgPrint2(DPRINT_##ch, ERR_LEVEL, __FILE__, __LINE__, fmt, ##__VA_ARGS__) 00059 #define FIXME_CH(ch, fmt, ...) DbgPrint2(DPRINT_##ch, FIXME_LEVEL, __FILE__, __LINE__, fmt, ##__VA_ARGS__) 00060 #define WARN_CH(ch, fmt, ...) DbgPrint2(DPRINT_##ch, WARN_LEVEL, __FILE__, __LINE__, fmt, ##__VA_ARGS__) 00061 #define TRACE_CH(ch, fmt, ...) DbgPrint2(DPRINT_##ch, TRACE_LEVEL, __FILE__, __LINE__, fmt, ##__VA_ARGS__) 00062 00063 #define ERR(fmt, ...) DbgPrint2(DbgDefaultChannel, ERR_LEVEL, __FILE__, __LINE__, fmt, ##__VA_ARGS__) 00064 #define FIXME(fmt, ...) DbgPrint2(DbgDefaultChannel, FIXME_LEVEL, __FILE__, __LINE__, fmt, ##__VA_ARGS__) 00065 #define WARN(fmt, ...) DbgPrint2(DbgDefaultChannel, WARN_LEVEL, __FILE__, __LINE__, fmt, ##__VA_ARGS__) 00066 #define TRACE(fmt, ...) DbgPrint2(DbgDefaultChannel, TRACE_LEVEL, __FILE__, __LINE__, fmt, ##__VA_ARGS__) 00067 00068 #define UNIMPLEMENTED DbgPrint("(%s:%d) WARNING: %s is UNIMPLEMENTED!\n", __FILE__, __LINE__, __FUNCTION__); 00069 00070 #define BugCheck(fmt, ...) do { DbgPrint("(%s:%d) Fatal Error in %s: " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); for (;;); } while (0) 00071 #define DbgDumpBuffer(mask, buf, len) DebugDumpBuffer(mask, buf, len) 00072 00073 #ifdef __i386__ 00074 00075 // Debugging support functions: 00076 // 00077 // BREAKPOINT() - Inserts an "int 3" instruction 00078 // INSTRUCTION_BREAKPOINTX(x) - Enters exception handler right before instruction at address "x" is executed 00079 // MEMORY_READWRITE_BREAKPOINTX(x) - Enters exception handler when a read or write occurs at address "x" 00080 // MEMORY_WRITE_BREAKPOINTX(x) - Enters exception handler when a write occurs at address "x" 00081 // 00082 // You may have as many BREAKPOINT()'s as you like but you may only 00083 // have up to four of any of the others. 00084 #define BREAKPOINT() __asm__ ("int $3"); 00085 void INSTRUCTION_BREAKPOINT1(unsigned long addr); 00086 void MEMORY_READWRITE_BREAKPOINT1(unsigned long addr); 00087 void MEMORY_WRITE_BREAKPOINT1(unsigned long addr); 00088 void INSTRUCTION_BREAKPOINT2(unsigned long addr); 00089 void MEMORY_READWRITE_BREAKPOINT2(unsigned long addr); 00090 void MEMORY_WRITE_BREAKPOINT2(unsigned long addr); 00091 void INSTRUCTION_BREAKPOINT3(unsigned long addr); 00092 void MEMORY_READWRITE_BREAKPOINT3(unsigned long addr); 00093 void MEMORY_WRITE_BREAKPOINT3(unsigned long addr); 00094 void INSTRUCTION_BREAKPOINT4(unsigned long addr); 00095 void MEMORY_READWRITE_BREAKPOINT4(unsigned long addr); 00096 void MEMORY_WRITE_BREAKPOINT4(unsigned long addr); 00097 00098 #endif // defined __i386__ 00099 00100 #else 00101 00102 #define DBG_DEFAULT_CHANNEL(ch) 00103 00104 #define ERR_CH(ch, fmt, ...) 00105 #define FIXME_CH(ch, fmt, ...) 00106 #define WARN_CH(ch, fmt, ...) 00107 #define TRACE_CH(ch, fmt, ...) 00108 00109 #define ERR(fmt, ...) 00110 #define FIXME(fmt, ...) 00111 #define WARN(fmt, ...) 00112 #define TRACE(fmt, ...) 00113 00114 #define UNIMPLEMENTED 00115 00116 #define DebugInit() 00117 #define BugCheck(fmt, ...) 00118 #define DbgDumpBuffer(mask, buf, len) 00119 #define DbgParseDebugChannels(val) 00120 00121 #endif // DBG 00122 00123 #endif // defined __DEBUG_H Generated on Sat May 26 2012 04:16:28 for ReactOS by
1.7.6.1
|