Post-Mortem Debugging (Compact 7)
You can use the Windows Embedded Compact Error Reporting feature to do post-mortem debugging. Post-mortem debugging refers to debugging a device after it crashes. By analyzing a dump file that the device saved at the time of the crash, you can obtain key information about the state of the device. For example, you can view the call stack, a list of loaded modules, the exception type, the values of global and local variables, and the contents of memory. Although a dump file cannot provide as much information as when you debug a crash directly by using the Kernel Debugger, the data from dump files not only helps you debug particular issues, it helps you spot trends. Historically, most failures are caused by very few code defects; fewer than 1% of the defects collected in crash dumps account for more than half of the total failures.
To use post-mortem debugging with Windows Embedded Compact, you include catalog items for Windows Embedded Compact Error Reporting in your OS design. When your OS includes Error Reporting, it automatically creates a dump file when a second-chance exception causes a program crash. This debugging technique is useful for detecting intermittent problems that cannot be easily reproduced. You can also use Error Reporting to create a dump file when a particular event occurs.
By default, dump files are uploaded to the Microsoft Watson website (watson.microsoft.com). You may want to upload dump files to this website because the Watson server groups dump files into categories called buckets. Each bucket contains dump files that resulted from similar crashes. This information can help you, for example, judge the priority of a code defect based on the number of crashes that it causes. When you upload files to the Watson website, however, you need to contact your Microsoft representative for details on how to retrieve this information. (For more information about buckets, and the benefits of using them, see Error Reporting Dump Files.) You can also upload the dump files to your own website by changing default settings in the code.
You may choose to save the dump files on the device and analyze them yourself. This approach can be useful, for example, if there is a problem on a customer’s device and you want to debug the issue without interfering with the use of the device. You can ask the customer to send you the dump file so that you can debug the issue without accessing the device while the customer is using it. If you save the dump files on the device, you can analyze the dump files yourself by using the methods in Analyze Dump Files.
Error Reporting has four main components, each associated with a catalog item. Each component performs a different function in the dump file process:
- Error Report Generator. Creates a dump file when an unhandled second-chance exception occurs on a device or when you capture a dump file by using your code or by using Platform Builder. For more information, see Generate Dump Files.
- Error Report Transfer Driver. Moves dump files from the reserved memory area into the file system and then starts the Report Upload Client.
- Report Upload Client. Uploads a dump file that was created on a device to the Microsoft Watson website.
- Error Report Control Panel. Provides a Control Panel on the device that you use to set options for dump file generation.
This developer guide shows you how to set up your device to support post-mortem debugging, how to generate and store dump files, and how to analyze them.
In This Section
- Set Up Your Device for Post-Mortem Debugging
Shows you how to include Error Reporting in the OS, how to choose the dump file type, how to configure registry settings, how to reserve memory for dump files, some security aspects to consider, and how to implement persistent storage for dump files.
- Generate Dump Files
Shows you how to generate dump files automatically, from a handled exception, from a process, or while debugging.
- Store Dump Files
Shows you how to upload dump files to the Microsoft Watson website and how to save them on the device.
- Analyze Dump Files
Shows you how to analyze dump files by using Platform Builder and Windows Debugger (WinDbg).