Share via


Controlling Debug Message Output With Macros (Windows Embedded CE 6.0)

1/5/2010

After debug zones are registered, you can use macro calls in the source code to output debugging messages collected in the zones. The macros you can use depend on whether the build is a Release or Debug configurations.

The following table describes macros you can use from a Release configuration:

Release Configuration Macro Description

RETAILMSG(cond, printf_exp)

Conditionally displays the print message.

RETAILLED(cond, parms)

Conditionally outputs WORD values to the LED.

DEBUGREGISTER, RETAILREGISTERZONES(hmod)

Enables debug zones for Release configurations.

ERRORMSG(cond, printf_exp)

Prints Error: File Line before the print message.

From a Debug configuration, you can also use the three Release configuration macros. In addition, you can use other macros that can only be called from a Debug configuration.

Note

To enable debug configuration macros, you must build a run-time image from a Debug configuration.

The following table describes macros you can call from a Debug configuration:

Debug Configuration Macro Description

DEBUGREGISTER, RETAILREGISTERZONES(hmod)

Enables debug zones for Debug configurations.

DEBUGMSG(cond, printf_exp)

Conditionally displays a print message.

DEBUGLED(cond, parms)

Conditionally outputs WORD values to the LED.

DEBUGCHK(expr)

Asserts a specified expression. If expr is FALSE, the macro calls DebugBreak.

DEBUGZONE(zone_id)

Tests the mask bit in the current debug zone settings.

You can also use DEBUGZONE to declare a particular debug zone.

See Also

Reference

Registering Debug Zones

Other Resources

Debug Zones