Dr. Watson is basically a debugging tool. When a program has an unhandled exception, Dr Watson will be automatically started by the system. An unhandled exception means that the program itself doesn't specify what to do when the error occurs, and no other debuggers are installed and configured to handle the error. There are two Registry entries that tell the system the debugger to use:
Hive: HKEY_LOCAL_MACHINE
Key: Software\Microsoft\Windows NT\CurrentVersion\AeDebug
Name: Debugger
Data Type: REG_SZ
Value: drwtsn32 -p %ld -e %ld -g
Hive: HKEY_LOCAL_MACHINE
Key: Software\Microsoft\Windows NT\CurrentVersion\AeDebug
Name: Auto
Data Type: REG_SZ
Value: 1
For the first entry, the value shown is the default for Dr Watson. If another debugger is used, the value will be the path and options of that debugger. The second value tells whether the debugger will start automatically (value of 1) or prompt the user first (value of 0). When Dr. Watson runs, it not only stops the program that errored, it also generates a log file at C:\Documents and Settings\All Users\Documents\DrWatson by default (根据OS的不同,其位置和文件名是不同的,请看下面的详细说明), called drwtsn32.log, which contains a plethora of information. This information is particularly useful to developers, but is difficult to decipher for users. If a third party debugger is installed, and you want to make Dr. Watson the default again, simply run "drwtsn32.exe -i" to restore the above Registry entries.
在NT或2000中,要禁用 Dr. Watson,请按照下列步骤操作
| 1. | 单击开始,单击运行,在打开框中键入 regedit.exe,然后单击确定。 |
| 2. | 找到并单击以下注册表项: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug 注意:步骤 3 和步骤 4 是可选的;如果您要还原使用 Dr. Watson 的默认设置,则需要执行这两个步骤。 |
| 3. | 单击 AeDebug 项,然后单击注册表菜单上的导出注册表文件。 |
| 4. | 为要保存的注册表文件输入名称和位置,然后单击保存。 |
| 5. | 删除 AeDebug 项。 |
在 Windows 中,调试程序的注册表项位于 AeDebug 项中。默认情况下,Dr. Watson 程序安装在 Windows 中,并配置为在发生应用程序错误时运行(Auto 值的数据值为 1)。默认值为:
数值名称 = Auto
类型 = 字符串 (REG_SZ)
数据值 = 1 或 0。(默认值为 1)
数值名称 = Debugger
类型 = 字符串 (REG_SZ)
数据值 = drwtsn32 -p %ld -e %ld -g
注意:该数据值 (drwtsn32 -p %ld -e %ld -g) 是 Dr.Watson 专有的。其他调试程序将具有它们自己的值和参数。
Dr. Watson log file. For Windows 2000 the Log file is located at: C:\Documents and Settings\All Users\Documents\Microsoft\Dr Watson. For Windows XP the log file is located at: C:\Documents and Settings\All Users\Application Data\Microsoft\Dr Watson (MS KB Q308538说缺省保存在C:\Documents and Settings\All Users.WINNT\Application Data\Microsoft\Dr Watson,到底是哪里未确认). The file is typically named drwtsn32.log. For Windows NT the log file is located at C:\WinNT and the file is typically named drwatson.log.
User dump log file. For Windows 2000 the Log file is located at: C:\Documents and Settings\All Users\Documents\Microsoft\Dr Watson. For Windows XP the log file is located at: C:\Documents and Settings\All Users\Application Data\Microsoft\Dr Watson. For Windows NT the log file is located at C:\Winnt. The file is typically named user.dmp.
以上的位置和Dump文件名可以在Dr Watson的GUI窗口中设置。
To bring up the "Dr Watson for Windows 2000" interface, click Start, Run, and type "drwtsn32" without the quotes. This brings up a window with the following options to configure.
Log File Path (ログ ファイル パス)
Crash Dump (クラッシュ ダンプ)
Wave File (WAVE ファイル)
Number of Instructions (インストラクションの数)
Number of Errors To Save (保存するエラー数)
Dump Symbol Table (ダンプ シンボル テーブル)
Dump All Thread Contexts (すべてのスレッド コンテキストをダンプ)
Append To Existing Log File (既存)
Visual Notification (メッセージ ボックスによる通知)
Sound Notification (音による通知)
Create Crash Dump File (クラッシュ ダンプ ファイルの作成)
这些设置值保存在 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DrWatson\
For Win98 / WinME the executable is DRWATSON.EXE
For WinNT / Win2000 / WinXP the executable is DRWTSN32.EXE (although DRWATSON.EXE is provided for backwards compatability)
DrWatson.exe (used to do dump stack information when a program crashes)works for 16-bit windows applications and DrWtsn32.exe works for 32-bit applications in NT.
MS KB article:
For 98/Me: Q185837, Q275481
For NT/2K: Q188296
得到Log后解读它也是一番学问, Dr Watson的GUI窗口自带的帮助文档有一些简单的说明,可作为初学者的参考。Dump的解读就更难了,