Dr. Watson overview

Dr. Watson for Windows is a program error debugger.

The information obtained and logged by Dr. Watson is the information needed by technical support groups to diagnose a program error for a computer running Windows. A text file (Drwtsn32.log) is created whenever an error is detected, and can be delivered to support personnel by the method they prefer. You also have the option of creating a crash dump file, which is a binary file that a programmer can load into a debugger.

If a program error occurs, Dr. Watson will start automatically. To start Dr. Watson, click Start, click Run, and then type drwtsn32. To start Dr. Watson from a command prompt, change to the root directory, and then type drwtsn32.

Related Topics


Setting up Dr. Watson

Dr. Watson (Drwtsn32.exe) is installed in your system folder when you set up Windows. The default options are set the first time Dr. Watson runs, which can be either when a program error occurs or when you start Dr. Watson yourself.

When a program error occurs in Windows, the system searches for a program error handler. A program error handler deals with errors as they arise during the running of a program. If the system does not find a program error handler, the system verifies that the program is not currently being debugged and considers the error to be unhandled. The system then processes unhandled errors by looking in Registry Editor for a program error debugger.

The system looks in Registry Editor under the key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug for the entries named Debugger and Auto. The value for the Debugger entry specifies the command for the debugger that will be used to analyze program errors. If the value for the Debugger entry is found, the system checks to see if the value for the Auto entry is set to zero or one.

  • If the value for the Auto entry is set to zero, the system generates a message box that notifies you that a program error has occurred. If the value for the Debugger entry specifies the command for a valid debugger, the message box will display two buttons: OK and Cancel. If you click OK, the program is terminated. If you click Cancel, the specified debugger is started. If the value for the Debugger entry is empty, the message box will display only OK, and no debugger will start.
  • If the value for the Auto entry is set to one and the value for the Debugger entry specifies the command for a valid debugger, the system automatically starts the debugger and does not generate a message box.

When Windows is set up on your system, the value for the Auto entry is set by default to one and the value for the Debugger entry specifies the command to start Dr. Watson. This means that when a program error occurs, Dr. Watson for Windows will automatically diagnose the error and log the appropriate diagnostic information.

If you have been using a program other than Dr. Watson as your default debugger, and you want to use Dr. Watson instead, go to the command prompt and type the command drwtsn32 -i to start Dr. Watson. Typing -i causes the necessary changes to be made to the registry.

You can set up Dr. Watson to generate more exacting information for debugging purposes if the appropriate symbols are installed and the symbol search path is set. To do this, you need to create a new system environment variable. First, you need to install the appropriate symbols on your computer. On the How to Get Symbols page on the Microsoft Windows Driver Development Kits Web site (go to http://www.microsoft.com/ and search for "How to get symbols"), download the symbol package for the appropriate processor type for your version of Windows. (If you subscribe to MSDN, you can install symbols from the Customer Support and Diagnostics Tools CD. When you insert the CD into your CD drive, the Customer Support Diagnostics page will open. Under Install Symbols, click the appropriate link for your platform.) By default, the symbols will be installed to the Symbols subfolder in the systemroot folder on your computer.

After the symbols are installed, create the new system environment variable. Type _NT_SYMBOL_PATH for the variable name and %systemroot%\Symbols for the variable value. You can install various symbols to different locations separated by semicolons and point to each of those locations using the same environment variable. Be sure to include variables for added service packs. For example: _NT_SYMBOL_PATH=%systemroot%\symbols;%systemroot%\symbolsW2kSp3.

XOX

Related Topics


Working with Dr. Watson

You can use the Dr. Watson for Windows dialog box to change the behavior of Dr. Watson. The data that you specify is stored in Registry Editor under the key \\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DrWatson.

For information about the dialog box options, click the appropriate option in the following list:

  • Log File Path
  • Crash Dump
  • Wave File
  • Number of Instructions
  • Number of Errors To Save
  • Crash Dump Type
  • Dump Symbol Table
  • Dump All Thread Contexts
  • Append To Existing Log File
  • Visual Notification
  • Sound Notification
  • Create Crash Dump File
  • View
  • Clear
  • Application Errors

Related Topics


Using the Dr. Watson log file

When a program error occurs, Dr. Watson generates a log file (Drwtsn32.log). The log file will always start with the following line:

Application exception occurred:

The next part of the log file always contains program error information. The error number listed corresponds to the error generated by the system.

Application Exception Error

The next part of the log file contains system information about the user and the computer on which the program error occurred.

The next part of the log file contains the list of tasks that were running on the system at the time that the program error occurred.

The next part of the log file contains the list of modules that the program loaded.

The next part of the log file contains the state dump for the thread ID that is listed. The state dump consists of a register dump, disassembly of the code surrounding the current program counter, a stack back trace, and a raw stack dump. This first part of the state dump lists the thread ID.

State Dump for Thread Id 0xbf

The next part of the state dump contains the register dump.

Register Dump Information

The next part of the state dump contains the instruction disassembly.

Instruction Disassembly Information

The next part of the state dump contains the stack back trace.

Stack Back Trace

The final part of the state dump contains the raw stack dump.

Row Stack Dump

Following the state dump, the final part of the log file contains the symbol table.

Related Topics


Compile Date

Microsoft Windows graphic
Compile Date: 2002-10-03