Monday 7 February 2011

How to start with WinDBG

There are different ways to debug an application using WinDbg.


1.  Start the application you want to debug.
2. Start WinDbg from start-> program -> Debugging tools for windows(x86)->WinDbg
3. From File -> attach to process,  select the process you want to debug.


Or
You can start an application directly from WinDbg as follows.
1. Start WinDbg select File --> Open Executable, and point to the exe path where the application is located.


or
after starting  WinDbg
type the following command 
.attach PID
PID --> Process ID of the application. This can get from task manager. Press the following key combination 
"Ctrl+Shift+Escape"  --> processes then search for relevant application you want to debug. If PID is not visible for the application. Go to View--> Select columns and select PID. Then you can find the PID of the process.


The SOS Debugging Extension (SOS.dll) helps you debug managed programs in the WinDbg.exe debugger and in Visual Studio by providing information about the internal common language runtime (CLR) environment.