⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 debug.h

📁 ReactOS是一些高手根据Windows XP的内核编写出的类XP。内核实现机理和API函数调用几乎相同。甚至可以兼容XP的程序。喜欢研究系统内核的人可以看一看。
💻 H
字号:
/*
 * COPYRIGHT:       See COPYING in the top level directory
 * PROJECT:         ReactOS kernel
 * FILE:            include/msvcrt/msvcrtdbg.h
 * PURPOSE:         Useful debugging macros
 * PROGRAMMER:
 * UPDATE HISTORY:
 *
 */

/*
 * NOTE: Define NDEBUG before including this header to disable debugging
 * macros
 */

#ifndef __MSVCRT_DEBUG
#define __MSVCRT_DEBUG

#include <roscfg.h>
#include <windows.h>


#define MK_STR(s) #s

#ifdef _UNICODE
   #define sT "S"
#else
   #define sT "s"
#endif

unsigned long DbgPrint(const char *Format,...);

#ifdef __GNUC__
	#define TRACE(...)
#endif

#ifdef DBG
   #ifdef __GNUC__
      #define DPRINT1(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0);
   #else
      #define DPRINT1 DbgPrint
   #endif
   #define CHECKPOINT1 do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0);
#else
   #ifdef __GNUC__
      #define DPRINT1(args...)
   #else
      #define DPRINT DbgPrint
   #endif
   #define CHECKPOINT1
#endif

#if !defined(NDEBUG) && defined(DBG)
   #ifdef __GNUC__
       #define DPRINT(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0);
   #endif
   #define CHECKPOINT do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0);
#else
   #ifdef __GNUC__
      #define DPRINT(args...)
   #else
      #define DPRINT DbgPrint
   #endif
   #define CHECKPOINT
#endif /* NDEBUG */


#if 0

   #define TRACE_RETURN(format_str, ret_type) \
   ret_type __return_value__; \
   static char* __return_format_str__ = "%s ret: "format_str"\n"

   #define FUNCTION(func) \
   static char* __func_name__ = #func

   #define TRACE(a,b...) DPRINT1(a"\n", b)

   #define RETURN(a) \
   do{ __return_value__ = (a); DPRINT1(__return_format_str__ ,__func_name__,__return_value__); return __return_value__ ; }while(0)

#endif


/* ULONG CDECL DbgPrint(PCH Format, ...); */
ULONG DbgPrint(PCCH Format,...);
/* unsigned long DbgPrint(const char* Format, ...); */



/* #define TRACE 0 ? (void)0 : Trace */

/* void Trace(TCHAR* lpszFormat, ...); */



#endif /* __MSVCRT_DEBUG */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -