📄 debug.h
字号:
/****************************************************************************** * * Copyright (c) 2003 Gerhard W. Gruber * * PROJECT: pICE * $Source: /cvsroot/pice/pice/module/debug.h,v $ * $Revision: 1.5 $ * $Date: 2004/02/17 23:07:36 $ * $Author: lightweave $ * $Name: $ * * $Log: debug.h,v $ * Revision 1.5 2004/02/17 23:07:36 lightweave * * Improved the DEBUG facillity and replaced the configuration handler with a * new code which now can read MS Windows INI style files. See CHANGES.txt for * more details. * Also added a macro which prevents compiling for kernels before 2.4.19. * * Revision 1.4 2003/06/18 22:00:22 lightweave * DEBUG and DEBUG_SERIAL added * * *****************************************************************************//*++Copyright (c) 1998-2001 Klaus P. GerlicherModule Name: debug.hAbstract: HEADER for debug.cEnvironment: LINUX 2.2.X LINUX 2.4.X Kernel mode onlyAuthor: Klaus P. GerlicherRevision History: 15-Nov-2000: general cleanup of source filesCopyright notice: This file may be distributed under the terms of the GNU Public License.--*/#ifndef _DEBUG_H#define _DEBUG_H/* This is the default text to be used in front of a debug message */#define STANDARD_DEBUG_PREFIX "pICE: "/* This is mapped to KERN_DEBUG usually */#define PICE_DEBUG KERN_INFOtypedef enum { DBG_NONE, DBG_SERIAL, DBG_PARALLEL} DEBUG_MODE;typedef enum { DBT_NONE, // individual blocks DBT_ADDRESS, // file related messages DBT_MAIN, DBT_MEMORY, DBT_FUNCTION, DBT_ALIGNMENT, DBT_BP, DBT_EDITOR, DBT_ENTRY, DBT_HEAP, DBT_HARDWARE, DBT_HERCULES, DBT_HOOKS, DBT_INIT, DBT_PARSE, DBT_PATCH, DBT_PGFLT, DBT_SHELL, DBT_SMP, DBT_SYMBOLS, DBT_SYSCALL, DBT_TRACE, DBT_OUTPUT, DBT_UTILS, DBT_VGA, DBT_PROFILE, DBT_CONFIG, DBT_DEBUG, DBT_COUNT} DEBUG_TYPE;typedef enum { DBL_INFO, DBL_WARNING, DBL_ERROR, DBL_COUNT} DEBUG_LEVEL;// Global structure which shows what functions should be// logged.typedef struct { UBYTE Permission[DBT_COUNT]; LONG Nesting; DEBUG_LEVEL Level; DEBUG_MODE Mode;} DEBUG_PERMISSION;extern DEBUG_PERMISSION debug_permission;BOOLEAN DebugSendByte(UCHAR x);ULONG DebugSendValidString(UBYTE *str);void DebugSendString(LPSTR s);ULONG DebugPrintNumber(long num, int base, int size, int precision, int type);// dprint is ONLY to be used for constant strings or where the string is made// of memory which is sure to be available (i.e. local variables). It may not// be used with allocated memory. Use dprintf instea, if this is the case.VOID PICE_dprint(PCHAR File, PCHAR Function, int Line, DEBUG_TYPE DebugTyp, DEBUG_LEVEL DebugLevel, PCHAR DebugMessage, ...);VOID PICE_dprintf(PCHAR File, PCHAR Function, int Line, DEBUG_TYPE DebugTyp, DEBUG_LEVEL DebugLevel, PCHAR DebugMessage, ...);void DebugSetupSerial(ULONG port,ULONG baudrate);#if defined(DEBUG_SERIAL)# define __PICE__DEBUG__# define DPRINT(log, type, level, fmt, args...) PICE_dprintf(__FILE__, __FUNCTION__, __LINE__, type, level, STANDARD_DEBUG_PREFIX fmt, ## args)# define DVPRINT(log, type, level, fmt, args...) PICE_dprint(__FILE__, __FUNCTION__, __LINE__, type, level, STANDARD_DEBUG_PREFIX fmt, ## args)# define ENTER_FUNC() PICE_dprint(__FILE__, __FUNCTION__, __LINE__, DBT_FUNCTION, DBL_INFO, "ENTER\n")# define LEAVE_FUNC() PICE_dprint(__FILE__, __FUNCTION__, __LINE__, DBT_FUNCTION, DBL_INFO, "LEAVE\n")#else // DEBUG_SERIAL# define ENTER_FUNC()# define LEAVE_FUNC()# define DPRINT(log, level, fmt, args...)#endif#endif // _DEBUG_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -