Share via


Change Active Debug Zones (Compact 2013)

3/26/2014

You can change which debug zones are active by using code or by using Platform Builder.

Use code

You can change a module’s active debug zones programmatically within the module itself or within the code of another module.

To change debug zones from the code within a module

  • To change the active debug zones for a module from within the code of the module, set the module’s dpCurSettingsulZoneMask parameter.

    This example code shows how to change the active debug zone settings from within a module.

      dpCurSettings.ulZoneMask = 0x00000001
    

To change debug zones for a module from inside the code of another module

  • To change the active debug zones for a module by using code that is inside another module, use SetDbgZone, as shown in the following example.

      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.  
    

Use Platform Builder

In Platform Builder, you can change the active debug zones at a breakpoint by using the Watch window or anytime by using the Target Control window.

To change debug zones from the debugger at a breakpoint

  1. In Platform Builder, at a breakpoint during debugging, select Debug, click Windows, and then click Watch to open a watch window.

  2. In the Watch window, first find the debug zone bit mask. To do this, if the module is an application, type the following.

      {,,myapp.exe}dpCurSettings.ulZoneMask
    

    If the module is a DLL, type the following.

      {,,mydll.dll}dpCurSettings.ulZoneMask
    
  3. Next, modify the value.

    When you continue execution, Platform Builder will use the new debug zones.

To set debug zones from the Target Control window

  1. In Platform Builder, in the Target Control window, use the gi mod command to get the module index.

  2. In the Target Control window, use the zo command. For example, the following command sets the debug zone for a module at index 0 to 0x100.

      zo m 0 0x100
    

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

See Also

Concepts

Use Debug Zones
Kernel Debugger
Debugging

Other Resources

Windows Embedded Compact 2013