Monday, January 20, 2014

How to Set WinDbg as a Default Windows Postmortem Debugger

Sometimes it’s difficult to capture a user dump inside a terminal session because Dr. Watson doesn’t work as the default debugger.

The could be possibly caused by security permissions in Windows Server 2003.

Steps to set Windbg as default Postmortem debugger.

Resolution

1. Install the latest Debugging Tools for Windows:

http://www.microsoft.com/whdc/devtools/debugging/default.mspx

2. Set WinDbg as a default debugger by issuing the following command:
           WinDbg -I

Note: The I must be capitalized.

3. Create a folder where the dump must be stored and give it full control permissions for users or remote desktop users.

For this example, the c:\TEMP folder is used.

4. Inspect the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug

For example, it has the following value:

"C:\Program Files\Debugging Tools for Windows\windbg.exe" -p %ld -e %ld -g

Take the current key value and append the following string:

-c '.dump /o /f c:\TEMP\new.dmp; q' -Q -QS -QY -QSY

The new key should have the following value:

"C:\Program Files\Debugging Tools for Windows\windbg.exe" -p %ld -e %ld -g -c '.dump /o /f c:\TEMP\new.dmp; q' -Q -QS -QY -QSY

On 64-bit Windows, use the 64-bit Debugging Tools for Windows. However if you want to save dumps from 32-bit processes (shown as *32 in Task Manager) you also need to change Wow6432Node registry hive and use the 32-bit WinDbg.exe from the 32-bit Debugging Tools for Windows:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug

5. Whenever there is an exception inside a session, a dump is stored in the TEMP folder.

No comments:

Post a Comment