Share via


Changing Debug Zones (Windows Embedded CE 6.0)

1/5/2010

You can set debug zones from within code, from the kernel debugger, and from the Target Control window.

Procedures

To change debug zones during runtime from within a module or process in code

  • From within a module or process, you can change the zone settings during run-time from code. For more information about the existing zones, see Viewing Debug Zones.

    For example, the following code line changes the zone settings from within a module:

      dpCurSettings.ulZoneMask = 0x00000001
    

To change debug zones for a module or process inside another application or module

  • If you want to change the zones for a process or module using code that is inside another application or module, use the SetDbgZone.

      DBGPARAM dbg;  // OK if uninitialized, receives new settings
      SetDbgZone(hProcess, hModule, 0, dwZone, &dbg);
    

    Use hProcess=0 if you are controlling a DLL; use hModule=0 if you are controlling a process.

To change debug zones from the debugger at a breakpoint

  • You can change zone settings from the debugger at a breakpoint by opening a watch window and typing

      {,,myapp.exe}dpCurSettings.ulZoneMask
    

    - or -

      {,,mydll.dll}dpCurSettings.ulZoneMask
    

    And then modifying the value. When you continue execution, the new debug zones will be used.

To set debug zones from the Target Control window

  • You can change zone settings from Target Control window using the zo command. For example, the following command sets the zone for a module at index 0 to 0x100

      Zo m 0 0x100
    

    For more information, see Target Control Debugging: zo Command.

Code Example

The following code example shows how to associate a bitmask with a debug zone. In this example, an application header file defines 16 (0–15) debug zones.

#define ZONEID_INIT    0
#define ZONEID_SECOND  1
#define ZONEID_EXCEPT  2
.
#define ZONEID_ERROR      15

After defining a debug zone to a bitmask, associate a debug zone mask name with the defined bitmask. A debug zone mask is a named bitmask that is used to turn a debug zone on or off.

The following code example shows how to associate debug zone mask names with the 16 previously defined debug zones.

#define ZONEMASK_INIT      (1<<ZONEID_INIT)
#define ZONEMASK_SECOND    (1<<ZONEID_SECOND)
#define ZONEMASK_EXCEPT    (1<<ZONEID_EXCEPT)
.
#define ZONEMASK_ERROR     (1<<ZONEID_ERROR)

See Also

Tasks

Viewing Debug Zones

Concepts

Setting Initial Debug Zones
Setting Debug Zone Parameters

Other Resources

Debug Zones