Summary of dr. Watson's tips

Source: Internet
Author: User
 

Summary of dr. Watson's tips

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.

To include the call stack of the faulty function in the log generated by Dr Watson (useful !), Specify the debug info to generate coff format or both format in VC, instead of the default Microsoft format. For VC 6.0, you can set it at link-Debug of Project setting.

Dr. watson log file. for Windows 2000 the log file is located at: C: \ Documents ents and Settings \ All Users \ Documents ents \ Microsoft \ Dr Watson. for Windows XP the log file is located at: C: \ Documents ents and Settings \ All Users \ Application Data \ Microsoft \ Dr Watson (MS kb q308538 says it is saved in C by default: \ Documents and Settings \ all users. winnt \ Application Data \ Microsoft \ Dr Watson, where is it unconfirmed ). 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 ents and Settings \ All Users \ Documents ents \ Microsoft \ Dr Watson. for Windows XP the log file is located at: C: \ Documents ents 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.

You can set the above position and dump file name in the GUI window of Dr Watson.

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 ents and Settings \ All Users \ Documents ents \ drwatson by default (depending on OS, the location and file name are different. Please refer to the details below), called drwtsn32.log, which contains a plethora of information. this information is special 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.

To disable dr. Watson in NT or 2000, follow these steps:

1. Click Start, click Run, type regedit.exe in the open box, and click OK.

2. Locate and click the following registry key:

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

Note: Steps 3 and 4 are optional. To restore the default settings of dr. Watson, perform these two steps.

3. Click AeDebug, and then click Export registry file on the registry menu.

4. Enter the name and location of the Registry file to be saved, and click Save.

5. Delete the AeDebug item.

In Windows, the Registry Key of the debug program is located in AeDebug. By default, the dr. Watson program is installed in windows and configured to run when an application error occurs (the auto value is 1 ). Default Value:

Value = auto
Type = string (reg_sz)
Data value = 1 or 0. (Default value: 1)

Value = Debugger
Type = string (reg_sz)
Data value = drwtsn32-P % LD-E % LD-G

Note: The data value (drwtsn32-P % LD-E % LD-g) is proprietary to dr. Watson. Other debugging programs will have their own values and parameters.


1. What is dr. Watson?
Dr. Watson (drwtsn32.exe) is a built-in debugging tool for Windows. Compared with professional program debugging Engineers (windbg, ntsd ...) She looks weak, but she should be a better choice in the following scenarios:
A. Our program crashes on a test machine without any debugging tools installed. What should I do? Is it possible to capture the error dialog box displayed in windows and send it to developers? To tell the truth, that dialog box has too little information for developers. The only thing that can be determined is: Oh, this program crashes.
B. On the end user's machine, our program has been released to the end user, and the program crashes. What should I do? What is the problem?
At this time, dr. Watson showed her advantage: She is a debugging tool that comes with windows and does not need to be installed separately. She can provide necessary information to developers to identify the problem.
This means that dr. Watson can help us at the following time:
1. The application crashes (crash );
2. The application encounters an exception (Note: if an exception occurs, if we take all measures, such as the try-catch mechanism, it will not cause a crash)

2. When Will dr. Watson be run?
If your machine has dr. if Watson is set as the default debugging tool, dr. watson runs automatically. Of course, there may be no interface for her running (you can run it in dr. in the Watson Interface), she only silently generated a file containing the error information and stored it in a specific path. at this time, you may want to send the file containing the error information to developers. note that we mentioned earlier, "If dr. if Watson is set as the default debugging tool, then ...." That is to say, dr. Watson may not be the default debugging tool on your machine. For example, if you have installed vc6 ++, vc6 ++ will become your default debugging tool .... How can we set our dr. Watson sister as the default debugging tool ?? See 4. How to Set dr. Watson as the default debugging tool for windows?
Another way to run dr. Watson is to enter drwtsn32 and press enter at run.

3. What files does dr. Watson generate when a program crashes? Where does it exist?
Dr. drwtson32.log, user. DMP file. drwtson32.log is a text file. You can open it by finding a textedit file. The description of the information contained in the file will be described in detail later. DMP files are provided to professional debugging tools such as windbg. windbg can import user files. the DMP file then shows the crash scene.
The file storage location can be set in dr. Watson. The default storage location is related to the Windows version:
Windows NT: % USERPROFILE % \ Local Settings.
Windows 2000: % allusersprofile % \ Documents \ drwatson.
Windows 2003: % allusersprofile % \ Application Data \ Microsoft \ Dr Watson.
Windows XP: % allusersprofile % \ Application Data \ Microsoft \ Dr Watson.

4. How can I set dr. Watson as the default debugging tool for windows?
Start (start) à run (run), input "drwtsn32-I" and press Enter. Now dr. Watson is your default debugging tool for Windows.

5. How can we make dr. Watson focus only on the crash of the program I specified?
For most of the time, we don't care about the crash of other programs, but about the programs we are testing/debugging. Can we make Dr. what if Watson only records the crash of the program we are interested in ??
In the run dialog box, enter "drwtsn32-P processid" to specify dr. Watson to debug only the specified process.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.