WinDbg安裝與使用

來源:互聯網
上載者:User

WinDbg是微軟發布的一款相當優秀的源碼級(source-level)調試工具,可以用於Kernel模式調試和使用者模式調試,還可以調試Dump檔案。

首頁:http://msdn.microsoft.com/en-us/windows/hardware/gg463016

下載連結:http://msdl.microsoft.com/download/symbols/debuggers/dbg_x86_6.11.1.404.msi

安裝好以後開啟主介面:

WinDbg提供了圖形介面和命令列兩種運行方式。這裡介紹使用圖形介面的WinDbg來調試應用程式:
     File->OpenExecutable->可以選擇一個可執行檔進行調試;
     File->Attache to a Process->可以選擇一個運行中的進程,並對其進行調試;

 

我們用C#寫一個簡單的控制台程式,

using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{    class Program    {        static void Main(string[] args)        {            int a = 20120108;            Console.Write(a.ToString()+DateTime.Now.ToString());        }    }}

 

再用windbg開啟

點擊進入按鈕F11

點擊go按鈕F5

 

選擇view-register顯示寄存器內容

選擇view-memory顯示記憶體內容

原始碼和運行內容

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.