Introduction
DebugView is an application that lets you monitor debug output on your local system, or any computer on the network that you can reach via TCP/IP. It is capable of displaying both kernel-mode and Win32 debug output, so you don't need a debugger to catch the debug output your applications or device drivers generate, nor do you need to modify your applications or drivers to use non-standard debug output APIs.
DebugView Capture
Under Windows 2000, XP, Server 2003 and Vista DebugView will capture:
- Win32 OutputDebugString
- Kernel-mode DbgPrint
- All kernel-mode variants of DbgPrint implemented in Windows XP and Server 2003
DebugView also extracts kernel-mode debug output generated before a crash from Window's 2000/XP crash dump files ifDebugView was capturing at the time of the crash.
Installation and Use
Simply execute the DebugView program file (dbgview.exe) andDebugView will immediately start capturing debug output. Note that if you run DebugView on Windows 2000/XP you must have administrative privilege to view kernel-mode debug output. Menus, hot-keys, or toolbar buttons can be used to clear the window, save the monitored data to a file, search output, change the window font, and more. The on-line help describes all of DebugView 's features.
Windows 中输出到DbgView中的函数实现:
在进行Windows开发中,大家经常需要将自己程序的运行时信息输出到一个调试窗口中,让系统的调试着可以随时监控程序的实际运行状态,如下的函 数可以将程序运行时数据输出到DbgView中(DbgView由Sysinternals开发,该公司已被微软收购),并且调用工具直接查看输出值;
void DEBUG_PRINT(IN TCHAR *format, ...)
{
va_list argList;
TCHAR szFormat[256], szContent[1024]; //maximum buffer is 1K bytes
_stprintf(szFormat, TEXT(" %s"), format);
va_start(argList, format);
_vsnwprintf(szContent, 1024, szFormat, argList);
va_end(argList);
lstrcat(szContent, L"/n");
OutputDebugString(szContent);
}