THe open dialog in this package does not work on NT4. Sorry.
Here are some work arounds:
- If the srcpath is set correctly then Windbg will automaticly open the
file for the current executing code, for example when a breakpoint is
hit.
I tried this for a user mode app. I started the app on the windbg
commandline. At the initial breakpoint I set the srcpath, then did a “g
main”. It executed to main then brought up the source file w/ main in
it.
For kernel mode I hooked up the debugger. Broke it. Did a “bp
testsys!DriverEntry” (testsys is a test driver I use sometimes) set
srcpath, then did “g”. Then on the target I started the driver. When
the breakpoint was hit Windbg brought up the source.
Once the source is up you can select lines and to “run to cursor” and
set breakpoints with the GUI.
- Another workaround is to use the console source commands. Normally
these are not used in Windbg because you have windows, but they are very
useful if you us plain old console kd.exe. You can open one file at a
time with the command “lsf file” then you can use “ls” and “lsa” to
display source in the command window.
Combined with the following commands one can do effective source level
debugging in kd.exe (not as nice as the GUI, but it works):
.lines - Tell the debugger you want to use line information (on
by default in Windbg)
l+* - Tell the debugger what you want to use source
for
You can set breakpoints on a given line by the following command
bp source.c:45
or
bp mydriver!source.c:45
Where mydriver is the module, source.c is your source file and 45 is the
line number. Becareful the ` are backticks, not apostrophes.
With these work arounds you can get Windbg to open the source for you
and avoid the problem with the dialog.
Enjoy
-----Original Message-----
From: Abhijit Mirajkar [mailto:xxxxx@controlnet.co.in]
Sent: Tuesday, May 02, 2000 11:43 PM
To: NT Developers Interest List
Subject: [ntdev] Query : How to open source files in New Windbg
Hi All,
Can anyone please explain how to open source files in new pre-release
version of Windbg?
I tried using File\Open Source File, Using the GUI button, using the
.srcpath option and also by first breaking-in using Ctrl+C (as required
in
old version) but of no use. I have also set the symbol path correctly .
Thanks in advance,
Regards,
Abhijit
Did you try - File\Open Source File…?
While there are a few shortcomings (like Options not working) I like
this
version of Windbg quite a bit. It has a vastly superior GUI to the
previous
versions and you can thankfully set breakpoints during runtime.
Note: since "Source File Path … " is grayed out you need to use
.srcpath
in order for source level debugging to work.
Daniel Nemiroff
You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)