I agree with that…
Sorry, but (a) I didn’t retract this statement, and (b) I stand by it.
Print/Trace is ONE type of debugging in one’s arsenal. Using the debugger provides a whole lot more. For MOST driver models, I do not think it is practical to use DebugView to debug your driver effectively.
Using DebugView to debug your driver limits you to one approach, requires a constant modification of your print/trace statements to deal with the situation at hand, and requires you to re-invent the wheel.
Without the debugger, you don’t have the KMDF debugger extensions. How do you read the IFR (!WDFLOGDUMP)? View the hierarchy of objects? The state of and in-progress requests on each queue??
With the debugger, how do you show the state of the ERESOURCE locks (!LOCKS) your driver holds, or how much they are contended?
How do you find all the IRPs allocated in the system?
In summary: I’ll grant that print/trace works. I’ll grant that there are people, with excellent abilities and reputations such as yourself, who are successful with using this approach alone.
What I won’t agree is that ANY dev – new or old – should voluntarily restrict their options to ONLY ever using print/trace, when there are other very useful tools available. If you’re doing an NDIS driver, a KMDF driver, and many others… the debugger is THE way to tap into system information (collected via traces and other means) that will help you diagnose large, complex, interaction problems.
Print/Trace is ONE tool… The debugger is the key to a whole range of OTHER tools. The ability to debug complex problems requires an engineer have the ability to understand and employ “the best tool for the job.”
To the OP’s problem: If the OP had been able to use a debugger, he probably wouldn’t have had to post on this list. He would have gotten a crash dump, done !analyze -v, looked at the structures in his driver, and figured out his problem!
If that didn’t help… sure, he could add tracing. But that would be iterative: Add IRP enter/exit tracing at each dispatch/event processing entry point. Run the test… OK, that tells us there’s a problem in an IOCTL. Let’s see the arguments: Edit the source, add more tracing to print the IOCTL control code. Run the test again. OK, it’s the IOCTL_DISK_SOMETHING function. It takes 2 arguments, one of which points to a structure. Fine. Edit the source, and add more tracing that prints out the arguments, and the contents of the structure. Run the test again.
Sorry, THAT seems difficult and doesn’t make a great deal of sense to me.
Alternative using the debugger: Set a breakpoint at each dispatch entry point. Observe crash. Rerun test. Stop before problematic IOCTL, step into code. Problem solved.
That just seems like a better, quicker, easier option to me…
Peter
OSR