Compartilhar via


Debugging Macros (Compact 2013)

3/28/2014

The following table summarizes the debugging macros.

You can use these macros to call the debugging functions RegisterDbgZones, NKDbgPrintfW, DebugBreak, and WriteDebugLED conditionally based on whether you want these calls to appear in Debug, Checked, Retail, and Ship builds.

Macro

Description

DEBUGREGISTER, RETAILREGISTERZONES(hMod)

Calls RegisterDbgZones to register zones for the current module (a DLL or process).

This macro only registers zones on Debug and Checked builds; it does nothing on Retail and Ship builds.

This macro assumes that a global variable dpCurSettings has already been defined, where dpCurSettings must be a DBGPARAM structure.

DEBUGREGISTER, RETAILREGISTERZONES(hMod)

Calls RegisterDbgZones to register zones for the current module (a DLL or process).

This macro only registers zones on Debug, Checked, and Retail builds; it does nothing on Ship builds.

This macro assumes that a global variable dpCurSettings has already been defined, where dpCurSettings must be a DBGPARAM structure.

DEBUGZONE(n)

Associates a mask bit with a zone.

DEBUGMSG(cond, printf_exp)

Conditionally outputs a formatted debugging message to NKDbgPrintfW.

This macro is only present in Debug and Checked builds; it does nothing on Retail and ship builds.

RETAILMSG(cond,printf_exp)

Conditionally outputs a formatted debugging message to NKDbgPrintfW.

This macro is only present in Debug, Checked, and Retail builds; it does nothing on ship builds.

ERRORMSG(cond,printf_exp)

Conditionally outputs a formatted error message to NKDbgPrintfW, adding the file name and line number where the error occurred.

This macro is only present in Debug, Checked, and Retail builds; it does nothing on ship builds.

DEBUGCHK(exp)

Asserts an expression and produces a DebugBreak if the expression is FALSE.

This assertion is only present in Debug and Checked builds; it does nothing on Retail and Ship builds.

This macro assumes that a global variable dpCurSettings has already been defined, where dpCurSettings must be a DBGPARAM structure.

ASSERT(exp)

Asserts an expression and produces a DebugBreak if the expression is FALSE.

This assertion does not assume dpCurSettings is present. The assertion is only present in Debug and Checked builds; it does nothing on Retail and Ship builds.

ASSERTMSG(msg, cond)

Asserts an expression, and if the expression is FALSE, produces an error message to NKDbgPrintfWand a DebugBreak.

This macro is only present in Debug and Checked builds; it does nothing on Retail and Ship builds.

DEBUGLED(cond, parms)

Conditionally outputs a pattern to WriteDebugLED.

This macro is only present in Debug and Checked builds; it does nothing on Retail and Ship builds.

RETAILLED(cond, parms)

Conditionally outputs a pattern to WriteDebugLED.

This macro is only present in Debug, Checked, and Retail builds; it does nothing on Ship builds.

Remarks

When implementing dpCurSettings in a Retail build, if the environment variable "WINCESHIP=1" is set, dpCurSettings will NOT be included in the library. To use dpCurSettings for a retail build, rebuild the library with "WINCESHIP=" or use the Debug build to build the individual DLL.

See Also

Reference

Debugging Reference