WinDbg is a source-level debugging tool released by Microsoft. It can be used for Kernel mode debugging and user mode debugging, as well as Dump file debugging.
1. WinDbg introduction:
Debugging Tools and Symbols: Getting Started
Http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx
A word for WinDbg
Http://mtaulty.com/communityserver/blogs/mike_taultys_blog/archive/2004/08/03/4656.aspx
2. Download WinDbg:
Install Debugging Tools for Windows 32-bit Version
Http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx
Install Debugging Tools for Windows 64-bit Versions
Http://www.microsoft.com/whdc/devtools/debugging/install64bit.mspx
3. Configure WinDbg:
Run WinDbg-> menu-> File-> Symbol File Path-> set the _ NT_SYMBOL_PATH variable as follows:
In the pop-up box, enter "C: \ MyCodesSymbols; SRV * C: \ MyLocalSymbols * configure (follow these settings to find the Symbol from the local folder C: \ MyCodesSymbols first, if no Symbols is found, the system automatically downloads the Symbols from the MS Symbol Server ). Another way is to extract ". (Note that the downloaded Symbols version must be correct.In my Win2003 + Sp1, I thought that the Symbols for installing Win2003 + Sp2 may be good at, but the result proved that I was wrong. When I opened the executable file with WinDbg, the prompt "PDB symbol for mscorwks. dll not loaded; Defaulted to export symbols for ntdll. dll "error, I have re-installed the Symbols of Win2003 + Sp1, now everything is running normally ^_^)
4. Use WinDbg:
WinDbg provides two running modes: graphical interface and command line. This section describes how to use the WinDbg in the graphic interface to debug applications:
File-> OpenExecutable-> You can select an executable File for debugging;
File-> Attache to a Process-> select a running Process and debug it;
So far, we can enter each function instruction in the text box marked with a red box (for instructions help documentation, refer: help-> Contents-> Debugging Tools for Windows-> Debuggers-> Debugger Reference. The following table describes the functions of all command machines !).