Breaking into a Debugger from KMDF Drivers

If you want your framework-based driver to break into a kernel-mode debugger, you can use the following:

  • The WdfVerifierDbgBreakPoint function breaks into the debugger if the DbgBreakOnError value is set in the registry.

  • The WDFVERIFY macro tests a logical expression and breaks into the kernel debugger if the expression evaluates to FALSE and if the VerifyOn value is set in the registry.

  • The VERIFY_IS_IRQL_PASSIVE_LEVEL macro breaks into the kernel debugger if the driver is not executing at IRQL = PASSIVE_LEVEL and if the VerifyOn value is set in the registry.

  • The ASSERT macro tests a logical expression and breaks into the kernel debugger if the expression evaluates to FALSE.

  • The ASSERTMSG macro tests an expression and, if the expression evaluates to FALSE, breaks into the kernel debugger and supplies a displayable text message to the debugger.

  • The DbgPrintEx and KdPrintEx functions supply a displayable text message to the debugger.

The code for the WDFVERIFY and VERIFY_IS_IRQL_PASSIVE_LEVEL macros is included in your driver when you build your driver in a release or debug configuration (referred to as a free build environment or a checked build environment in Windows 7 and earlier). The code for the ASSERT and ASSERTMSG macros is included in your driver only when you build your driver in a debug configuration.

For more information about project configurations, see Building a Driver.

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft