WinDbg c-level debugging?
Just started to step my kernel mode usb driver and it is in assembler. How do I configure WinDbg 开发者_C百科to c-level debugging? This is how i looks now =/
MyDriver!MyDriver_EvtDeviceAdd+0xb:
af20801b 833d647020af03 cmp dword ptr [MyDriver!DebugLevel (af207064)],3
0: kd> p
MyDriver!MyDriver_EvtDeviceAdd+0x2e:
af20803e ff15006020af call dword ptr [MyDriver!_imp__KeGetCurrentIrql (af206000)]
0: kd> p
MyDriver!MyDriver_EvtDeviceAdd+0x58:
af208068 8d95a8feffff lea edx,[ebp-158h]
0: kd> p
MyDriver!MyDriver_EvtDeviceAdd+0x64:
af208074 c785bcfeffff508420af mov dword ptr [ebp-144h],offset MyDriver!MyDriver_EvtDevicePrepareHardware (af208450)
WinDbg cannot find pdb files. Fill properly all WinDbg paths:
Symbol search path - must include driver .pdb files and local path for MS debugging symbols.
Source search path - must include directory with driver source files.
Image file path - must contain driver .sys file.
Look at WinDbg log: it reports all errors trying to load debug information. If you see something like "Cannot load debug information for your_driver.sys", something is wrong.
Your symbols look fine based on the output above. If you're not getting your source window popping up, you're typically in one of two cases:
1) You've moved your source code from where you originally built it. By default, the PDBs have the fully qualified path to the orignal source code location. If you move it, WinDBG won't be able to find it. You can see where WinDBG is looking by doing:
u MyDriver!MyDriver_EvtDeviceAdd
That should give you the full path of the source module containing that function embedded in the PDB. You can override this path by setting your Source Search Path to point to the new location.
2) You've managed to hide the source window somehow. Seems silly, but happens to my students all the time :) Check under the "Window" menu item in WinDBG to see if the window is open somewhere.
To clarify an earlier point, you do not need to set your Image File Path in this case. The only time that is required is if you're debugging a mini-dump.
-scott
You need to ensure you are generating "Codeview"/debug symbols for your driver, and the file generated is accessible to Windbg.
精彩评论