Debugging Applications for MicrosoftВ® .NET and Microsoft WindowsВ® (Pro-Developer)
|
Overview
I hope that instead of reading Dr. Watson logs, you'll be adding minidump creation to your application, which I described in Chapter 13, to make debugging your crashes extremely simple. However, if you've got an existing application or a customer that won't e-mail you the binary minidump, you've always got Dr. Watson to tell you when and where the problem occurred.
In some ways, Dr. Watson should really be named Dr. Jekyll and Mr. Hyde. In Dr. Jekyll mode, you get the information about a crash on a user's machine and can easily find where the crash occurred and fix it quickly. In Mr. Hyde mode, all you get is another set of numbers that don't tell you anything. In this appendix, I'll explain how to read Dr. Watson logs so that you can see less of Mr. Hyde and more of Dr. Jekyll.
I'll walk you through a complete Dr. Watson log in the following pages, explaining all the pertinent information as we go. (Relevant information in a particular section appears in boldface type.) The crash log in this appendix is for an early version of
Now that you've read this book, nothing in the Dr. Watson log should come as a big surprise. When it comes to differences between Dr. Watson logs in Microsoft Windows 2000, Windows XP, and Windows Server 2003, there aren't many. However, as you'll see in this appendix, the Windows XP and Windows Server 2003 versions are slightly better.
To get your logs, start Dr. Watson (DRWTSN32.EXE). The Application Errors list box shows recent crashes. If Dr. Watson doesn't list any crashes in the Application Errors list box, Dr. Watson might not be set up as the default debugger. To set up Dr. Watson as the default debugger, run it with the –i switch: drwtsn32 –i. To generate a test crash, run
In the Application Errors list box, select the crash you're interested in viewing and click the View button. The Log File Viewer dialog box appears as shown in Figure A-2. In Windows 2000, you'll be presented with only the application error numbers and the addresses where you crashed. For Windows XP and Windows Server 2003, you'll see the process name. In the Log File Viewer dialog box, copy the text out of the edit control for the particular crash. If you'd like to get the minidump of the last crash, the Crash Dump edit control in the Dr. Watson window contains the complete path.
|