調試工具DebugView for Windows (Dbgview.exe)

來源:互聯網
上載者:User
文章目錄
  • Windows 中輸出到DbgView中的函數實現:
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);
}

http://download.sysinternals.com/Files/DebugView.zip

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.