Miscellaneous Debugging Techniques
Often the main problem in correcting driver bugs is just getting enough information to make an accurate diagnosis. This section presents a variety of techniques that may help.
Leaving Debugged Code in the Driver
In general, it is a good idea to leave debugging code in place, even after the driver is ready for release. That way, it can be reused if the driver must be modified at some later date. Conditional compilation makes this easy.
The BUILD utility defines a compile-time symbol called DBG that can be used to conditionally add debugging code to a driver. In the checked BUILD environment, DBG has a value of 1; in the free environment, it has a value of 0. Several of the macros described below use this symbol ...