Share via


Reserve Memory for Error Reporting Dumps (Compact 7)

3/12/2014

To use Windows Embedded Compact Error Reporting, you must specify the amount of memory to reserve for dump files on the device. To do so, you initialize the dwNKDrWatsonSize variable in the OEMInit function to the amount of memory to reserve (dwNKDrWatsonSize corresponds to cbErrReportSize.) Although we recommend that you reserve a minimum of 128 KB for dump files, devices that run numerous processes or modules may require additional reserved memory. The amount of memory must be a multiple of the PAGE_SIZE (typically 4096 bytes) of the device.

The amount of memory that you reserve determines not only the kind of dump file that the Error Reporting system generates and saves but also whether a dump file is generated. Typically, the Error Reporting system attempts to generate a System dump, which includes all loaded processes, threads, and modules. However, if the size of the dump generated is larger than the size reserved, the Error Reporting system reverts to a much smaller Context dump, which includes only information about the process that was running when the crash occurred. For more information about dump file types, see Choose the Dump File Type.

Important

If you do not initialize dwNKDrWatsonSize, your device will not create Windows Embedded Compact Error Reporting dump files.

To set the amount of memory to reserve for dump files, set the value of dwOEMDrWatsonSize and initialize dwNKDrWatsonSize, as shown in the following procedure. Note that you can use FIXUPVAR to enable the size to be easily modified by changing WATSONBUFFERSIZE.

To set the amount of memory to reserve for dump files

  1. In config.bib, set the value of dwOEMDrWatsonSize as shown in the following example. In the following example, if you do not define WATSONBUFFERSIZE, then dwOEMDrWatsonSize is set to a default value of 300 KB (x4B000).

    #if $(WATSONBUFFERSIZE)==$()
        #define WATSONBUFFERSIZE     0004B000
    #endif
        dwOEMDrWatsonSize   00000000    $(WATSONBUFFERSIZE)   FIXUPVAR
    
  2. In OEMInit, initialize dwNKDrWatsonSize. The following code example shows how to initialize dwNKDrWatsonSize to dwOEMDrWatsonSize.

    extern DWORD dwNKDrWatsonSize;
    extern DWORD dwOEMDrWatsonSize;
    
    #define NOT_FIXEDUP (DWORD)-1
    DWORD dwOEMDrWatsonSize = NOT_FIXEDUP;
    
    
    OEMInit()
    {
    ... 
     if (dwOEMDrWatsonSize != NOT_FIXEDUP) 
     {
             // Reserve memory for Error Reporting Dumps
             dwNKDrWatsonSize = dwOEMDrWatsonSize;
    }
         //rest of OemInit 
    

See Also

Concepts

Set Up Your Device for Post-Mortem Debugging