Change Active Debug Zones (Compact 7)
3/12/2014
You can change which debug zones are active by using code or by using Platform Builder, as explained in the following sections.
By using 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.
For example, the following code changes 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 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.
By using 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
In Platform Builder, at a breakpoint during debugging, open a Watch window.
In the Watch window, first find the debug zone bit mask. To do so, if the module is an application, type:
{,,myapp.exe}dpCurSettings.ulZoneMask
If the module is a DLL, type:
{,,mydll.dll}dpCurSettings.ulZoneMask
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
In Platform Builder, in the Target Control window, use the gi mod command to get the module index.
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