Set Initial Debug Zones (Compact 2013)
3/26/2014
You can set a debug zone to active by using one of the following three methods:
- Set the initial state of the debug zone bit mask when you define dpCurSettings. (You always have to do this when you define dpCurSettings.)
- Set a registry key on the development computer.
- Set a registry key on the device.
When a module loads, Platform Builder checks options 1, 2, and 3 in that order. However, option 2, the value set in the registry of the development computer, takes precedence. Thus, if you set the registry value in the registries of both the development computer and the device, the value on the development computer is used. Platform Builder queries the value on the device only if it cannot reach the development computer or if the registry on the development computer does not contain a value for the module.
Note
After a module is loaded, none of these options have any effect. If you want to change which debug zones are active after the module is loaded, see the methods described in Change Active Debug Zones.
Each of the three methods is described below.
To set the initial state of dpCurSettings
In your module’s code, set the debug zones that are active by default by using the last parameter of dpCurSettings.
For information about how to define dpCurSettings, see Set Debug Zone Parameters.
To set a registry key on the development computer
On the Start menu, click Run.
In the Run dialog box, type regedit, and then click OK.
In the Registry Editor window, in the left pane, expand HKEY_CURRENT_USER, and then expand the key Pegasus.
Right-click Zones, select New, and then click DWORD (32-bit) Value.
In the Name box, type the name of your module, and then press Enter. Note that in your code, you named your module when you defined dpCurSettings.
For more information, see Set Debug Zone Parameters.
Note
When the module loads, Platform Builder reads the registry key HKEY_CURRENT_USER\Pegasus\Zones and searches for the module name. If a key with the module name exists, SetDbgZone uses the stored debug zone mask to update the debug zone name specified in the dpCurSettings structure.
Right-click the module name, and then click Modify.
In the Edit DWORD (32-bit) Value dialog box, in the Value data box, type a value equal to the debug zone bit mask, and then click OK.
For example, to turn on the first five debug zones for a module named VoIPPhone, create a VoIPPhone entry with DWORD hex value 0x001F.
In the Registry Editor window, on the File menu, click Exit.
To set a registry key on the device
In Platform Builder, open your OS design project.
In Solution Explorer, expand the OS design project node, and then expand the Parameter Files directory.
Under Parameter Files, double-click OSDesign.reg.
In the OSDesign.reg pane, right-click HKEY_LOCAL_MACHINE, click New, and then click Key.
Type DebugZones and press Enter.
Right-click DebugZones, click New, and then click DWORD Value.
Type the name of the module and press Enter.
In the Properties pane for the module’s registry value, for Data or Hex Value, type a DWORD value equal to the debug zone bit mask.
Important
If you set that particular registry value on the development computer, use the same registry value on the device as you did on the development computer.
For example, to turn on the first five debug zones for a module named VoIPPhone, create a VoIPPhone entry with a DWORD hex value 0x001F.
Save and then build the OS design project.
See Also
Concepts
Use Debug Zones
Kernel Debugger
Debugging