Configuring WinDbg for Debugging Program Crashes (article re-print from Revelation)


Original Article:

[ Revelation site ]


OpenInsight is more than just a database, it is a complete application development environment. Applications developed with OpenInsight often go beyond the environment to interface with external systems. As the complexity over user developed applications increases so will the chance problems can occur outside of the BASIC+ debugger. Problems that cause program faults in OpenInsight are difficult to pinpoint and resolve without sufficient patterns and symptoms leading to the fault.

This article is designed to walk you through installing and configuring Microsoft's WinDbg (Windows Debug) to capture important information about the system when the crash happens. This information can aid Revelation Technical Support in debugging the underlying problem. Please note, the changes in this article will cause all programs that experience a program fault to generate a debug dump file, not just OpenInsight.

The instructions below are written for Windows 7 x64 and the Microsoft Windows SDK version 7.1. For 32 bit editions of windows please make the appropriate adjustments to the commands given.

Installing WinDbg
The first step is to install the WinDbg tool which is part of the Microsoft Windows SDK. Subsequent installations of the WinDbg program can be done using the redistributable package that can be installed as an option.

  1. Download the Microsoft Windows SDK.
  2. Run the winsdk_web.exe file downloaded in the previous step.
  3. Follow the installation wizard until you arrive at the Installation Options screen.
  4. Un-select everything except Debugging Tools for Windows and Debugging Tools as shown in the screen shot below.

    Note: The debugging tools under the redistributable packages section is optional but will make subsequent installations easier.
  5. Continue through the wizard and accept the default options until you complete the wizard.

WinDbg is now installed.

Configuring WinDbg
The final step is to configure WinDbg using RegEdit to automatically generate the debug dump file.
  1. Launch a command prompt with "Run as Administrator".
  2. Install WinDbg as the default debugger to catch program faults by executing the command execute the command:
    c:\Program Files\Debugging Tools for Windows (x64)\windbg.exe -I
    Note: windbg.exe is not in the system path so you must change to the directory where it was installed or use the full path to the program as shown.
  3. Click OK when you receive the message indicating it is now the default postmortem debugger.
  4. Open RegEdit to change the registry. The final step is to configure WinDbg to automatically generate a dump file.
  5. The steps below configure the dump file to be generated in folder c:\temp. Verify this folder exists. You may specify a different folder by substituting c:\temp for your desired location in step 8.
  6. Browse to the branch HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug
  7. Edit the Debugger setting.
  8. Locate the segment:
    -p %ld -e %ld -g
    at the end of the value and change it to:
    -p %ld -c ".dump /o /ma /u c:\temp\dumpcap.dmp;q" -e %ld -g -QY
    as shown below.
  9. Repeat steps 6 and 7 again for the branch HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
    Tip: Notice step 5 dealt with the Wow6432Node and step 8 does not.

Windows will launch WinDbg next time a program fault occurs. WinDbg will startup, write the dump file to the directory specified, and then exit. The dump file will aid technical support agents in troubleshooting the cause of the program fault.

Future installations of WinDbg can be accomplished by installing the redistributable MSI file if you chose to install the "Redistributable Packages" in the first section. The redistributable files are stored in "C:\Program Files\Microsoft SDKs\v7.1\Redist\Debugging Tools for Windows". To setup WinDbg simply copy the appropriate package to the computer and install it. You must still configure the registry according to the "Configuring WinDbg" section above.



Top of Page

See Also