As Tony pointed out, you need to look at the stack trace. Either use the
“kb” command (or any of the k* variants), or use WINDBG’s Call Stack window
(under the View menu). Once you have opened the “Call Stack” window, you
can double-click on any of the call frames to “focus” on that frame. The
debugger will then resolve local variable names in the context of that call
frame, and the debugger will attempt to find and display the source file for
that local call frame.
You can configure WINDBG to display debug messages when it is loading its
symbols. Read up on the .symopt command. The command “.symopt+ 0x80000000”
will turn on the symopt debug flag. This will produce a lot of debugging
spew, such as:
0:000> .symopt+ 0x80000000
Symbol options are 0x80030237:
0x00000001 - SYMOPT_CASE_INSENSITIVE
0x00000002 - SYMOPT_UNDNAME
0x00000004 - SYMOPT_DEFERRED_LOADS
0x00000010 - SYMOPT_LOAD_LINES
0x00000020 - SYMOPT_OMAP_FIND_NEAREST
0x00000200 - SYMOPT_FAIL_CRITICAL_ERRORS
0x00010000 - SYMOPT_AUTO_PUBLICS
0x00020000 - SYMOPT_NO_IMAGE_SEARCH
0x80000000 - SYMOPT_DEBUG
0:000> x notepad!*
DBGHELP: C:\WINDOWS\system32\notepad.pdb - file not found
DBGHELP: notepad.pdb - file not found
*** ERROR: Module load completed but symbols could not be loaded for
notepad.exe
DBGHELP: notepad - no symbols loaded
This is an example of loading (or not loading!) user-mode symbols, but it
works the same way for kernel-mode symbols. Because so much about using
WINDBG applies equally well to user-mode code, you can learn a lot about how
to use WINDBG by debugging user-mode apps.
Another way to test your symbols is to use this command: “x yourdriver!*”.
This dumps the list of all symbols in your driver. If you get nothing, or a
very short list, then you know that your symbols have not been properly
loaded. You should get a long list, containing every symbol (global
function and global variable) declared in your driver. You should also be
able to resolve symbols such as DriverEntry, by issuing the command “x
yourdriver!DriverEntry”.
– arlie
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Yu Sai Kong
Sent: Thursday, November 24, 2005 8:31 PM
To: Kernel Debugging Interest List
Subject: RE: [windbg] Problem in setting up windbg environment
Hi all,
Thank you for all of your great help. Now I can start running the driver
and something and be printed out to the command window. But unfortunately
I can’t step the code. It did stop at the point where I put
DbgBreakPoint(), but no code seems to be appeared. I did setup the symbol
path pointing to the *.pdb file in the host machine. I have tried with the
.kdfiles command but have no luck. Here is the steps I used:
-
Start VMware, when it is in the boot-up menu, I switch back to the host
machine and launch the windbg by “C:\Program Files\Debugging Tools for
Windows\windbg.exe” -b -k com:pipe,port=\.\pipe\com_1,resets=0
-
Continue booting the target machine.
-
When it reached a break point, I used the command “.kdfiles
C:\WINDDK\2600.1106\src\wdm\usb\bulkusb\sym.ini”,
and
here is the content of my sym.ini file
map
\Systemroot\system32\drivers\BULKUSB.sys
C:\WINDDK\2600.1106\src\wdm\usb\bulkusb\sys\objchk_wxp_x86\i386\bulkusb.sys
-
Press ‘g’ to let the system runs.
-
When I tried to plug-in a usb device, it simply stops at the point
where I insert the break point, but no code appear.
Is there anything I do wrong? Please help and thank you in advance!
Regards,
Nicholas