Share via


Set Debug Zone Parameters (Compact 2013)

3/26/2014

After you define your debug zones as described in Define Debug Zones, you implement the global variable dpCurSettings in your module’s source code. The dpCurSettings variable is a global variable of type DBGPARAM that names the module, names the debug zones, and keeps track of which debug zones are currently active by using a DWORD bit field. Each module has its own implementation of dpCurSettings and can define up to 16 zones.

The fields listed in the following table are included in dpCurSettings.

Field

DBGPARAM member name

Description

Module name

lpszName

A Unicode string that is the name of the module. Windows Embedded Compact uses this variable to look for debug zone initialization information in the registry of the development computer and the registry of the device. This name should match the module’s DLL or EXE name as closely as possible so that, for example, you are able to identify the module when you use Target Control window to view the debug zones as described in View Debug Zones.

Debug zone name

rglpszZones

An array of Unicode strings that are the names of the debug zones. These names are displayed by Platform Builder when you view and change the zones as described in View Debug Zones and Change Active Debug Zones. You must list the debug zone names in the order of the bit position that you defined as described in Define Debug Zones. That is, list the name of the debug zone that corresponds to 0x01 first and the name of the debug zone that corresponds to 0x8000 last.

Initial debug zone mask

ulZoneMask

Defines which zones are enabled by default and turns on specific debug zones during startup.

The following example shows the implementation of dpCurSettings.

#ifdef DEBUG

DBGPARAM dpCurSettings = {
    TEXT("MyModule"), {
    TEXT("Errors"),         TEXT("Warnings"),  TEXT("Init"),        TEXT("Trace"),
    TEXT("Undefined"),      TEXT("Undefined"), TEXT("Undefined"),   TEXT("Undefined"),
    TEXT("Undefined"),      TEXT("Undefined"), TEXT("Undefined"),   TEXT("Undefined"),
    TEXT("Undefined"),      TEXT("Undefined"), TEXT("Undefined"),   TEXT("Undefined")},
    ZONEMASK_ERR | ZONEMASK_WARN
};

#endif

In this example, the module name is MyModule. There are four debug zones, and they are named Errors, Warnings, Init, and Trace. The last variable, ZONEMASK_ERR | ZONEMASK_WARN, is the bit mask that indicates that the Errors and Warnings debug zones are active by default. Because Errors is the first debug zone, the value of ZONEMASK_ERR is 1 (that is, the first bit of the bit field is set to 1). Because Warnings is the second debug zone, the value of ZONEMASK_WARN is 2 (that is, the second bit of the bit field is set to 1). These two values are combined with |, so the default value of ulZoneMask is 3.

See Also

Concepts

Use Debug Zones
Kernel Debugger
Debugging

Other Resources

Windows Embedded Compact 2013