Debugging And Windows Programs

Debugging and Windows programs aren’t always child’s play for those who don’t know about computers.

There are two ways to debug a Windows program: through a debugger and using C++ programming language. Since Windows comes with a debugger called WinDbg, the method by which one would debug a program is done as described below.

Debugging Windows Programs Using WinDbg

  • Run the program that needs to be debugged.
  • Press Ctrl, Alt, Del simultaneously to open to Task Manager.
  • Select the “Processes” tab.
  • Find the name of the program under “Image Name,” and note the PID (Process ID). If the PID does not display, then select “Select Columns…” under the “View” option, and check the next to “PID.”
  • Open the Command Prompt by selecting “Run” from the Start menu and typing “cmd,” then pressing Enter.
  • Change the Command Prompt directory to reflect the location of WinDbg.
  • Type windbg –pn(the PID obtained from the Task Manager)/g
  • The debugger will then debug the program.

There are also a number of debugging tools available on the Microsoft website. The current debugging tools come in a kit that applies to Windows NT 4.0, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows Server 2008 R2, and Windows 7. The kit is called the Windows Driver Kit or WDK. This kit does not work on 64-bit operating systems. On this same page are a list of recently released debugging tools as well as a series of guides regarding various debugging methods and solutions. There is also a list of resources that apply to Windows debugging and a free Microsoft Application Verifier that helps users determine whether an application requires debugging.