Groups | Blog | Home
all groups > visual studio .net debugging > july 2006 >

visual studio .net debugging : Image search path for VC7.1, VC8.0, and WinDbg


Pieter
7/6/2006 4:37:15 PM
I am looking for a generic way to tell VC 7.1, VC 8.0, and WinDbg where to
load binary images when debugging a dump file.

For reference see:
http://msdn2.microsoft.com/en-us/library/da0e4t52.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxgrfadditionaldumpmodulesearchpaths.asp
http://www.debuginfo.com/articles/matchmodules.html

Microsoft says that VC8 no longer uses MODPATH but uses the symbols search
path, I found this to be incorrect. I have a _NT_SYMBOL_PATH variable that
sets my symbol path, but unless I use MODPATH with the same value as
_NT_SYMBOL_PATH in the VC8 command arguments, VC8 will not load symbols for
images that are not on my system.

I tried setting the
"HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\NativeDE\Dumps\GlobalModPath"
path, but VC8 did not do anything different. Should I use 8.0 instead of
7.1, is it supposed to work, MSDN does not say anything about VC8 and this
key?

Should I use _NT_IMAGE_PATH instead?

I know I can experiment, but if somebody can point me to documentation, or
somebody else went through the experiment, that would save me some time ;)


Regards
Pieter

Skywing
7/6/2006 8:03:30 PM
WinDbg will use _NT_SYMBOL_PATH - not sure offhand about VC.

[quoted text, click to view]

jetan NO[at]SPAM online.microsoft.com (
7/7/2006 12:00:00 AM
Hi Pieter,

Thanks for your post!

Based on my understanding, you think MODPATH must be provided to VS2005 to
correctly load the binaries, while MSDN states MODPATH is not used in
VS2005. Also, I think the "_NT_IMAGE_PATH" you pointed out is actually the
typo for _NT_EXECUTABLE_IMAGE_PATH.

I have performed some test regarding this scenario. Below is the steps:
1. Use windbg to load a normal win32 application "hellowin.exe" which
resides in the following folder:
G:\Program\win32\VC\ProgrammingWindows\hellowin\Debug
2. In the initial loader breakpoint, use ".dump D:\test.dmp" to generate a
test.dmp file.
3. To simulate the scenario that the debugging machine does not contain the
"hellowin.exe" image, I remove "hellowin.exe" from
G:\Program\win32\VC\ProgrammingWindows\hellowin\Debug folder and place it
E:\ folder.
4. In VS2005, I use Open Project menu to open the D:\test.dmp and then F5
to start the dump debugging, the VS2005 will complain that can not find the
image file, which is expected.
5. I set the E:\ path in both _NT_EXECUTABLE_IMAGE_PATH and _NT_SYMBOL_PATH
environment variables, however, it seems that they both do not take any
effect.
6. Setting the E:\ path in MODPATH in Command Arguments. The VS2005 finally
can find the hellowin.exe in E:\ folder.

Conclusion:
Yes, MODPATH still takes effect in VS2005, I assumed this is a MSDN
document error, I will try to forward this to our document team.
_NT_EXECUTABLE_IMAGE_PATH can not be used in VS2005, actually, I can not
find any document regarding VS2005 using it. It is actually an module
search environment used by windbg.

Yes, I see that you want to find a consistent way of finding binraries for
VS.net2003, VS2005 and windbg. However, VS and windbg are developed by 2
different teams, so they may not always choose to go consistent with each
other. Thanks for your understanding. Normally, we may always set
_NT_EXECUTABLE_IMAGE_PATH and _NT_SYMBOL_PATH environment variables to
correct folder in the debugging machine, it will eliminate the time for
setting windbg binary/symbol search path. Regarding VS dump debugging, we
still should use MODPATH to point to the correct binaries folder.

Thanks for reporting this issue.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Oleg Starodumov
7/7/2006 9:02:49 AM

[quoted text, click to view]

When searching for modules, VS2005 debugger uses the symbol directories
specified in Tools | Options | Debugging | Symbols.

_NT_SYMBOL_PATH is used only when searching for symbols.

Oleg


Pieter
7/7/2006 1:35:46 PM
Jeffrey

Thank you for clarifying this.

I hope you can convince the VC team to be at least as good as the WinDbg
team in using the environment variables ;)


Regards
Pieter

[quoted text, click to view]

jetan NO[at]SPAM online.microsoft.com (
7/10/2006 2:54:23 AM
Hi Pieter,

Yes, I see your concern. I will help you to report this issue through
internal channel to Whidbey debugger team.

Since the internal channel reporting is invisible to you, it is a good
opportunity for you report it through a customer channel:
http://connect.microsoft.com/Main/content/content.aspx?ContentID=2220

Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Pieter
7/11/2006 11:19:46 AM
Jeffrey

Thanks, feedback id is 161652.

Regards
Pieter

[quoted text, click to view]

jetan NO[at]SPAM online.microsoft.com (
7/12/2006 12:00:00 AM
Hi Pieter,

Thanks for your sharing the status. I hope the VS2005 debugger will provide
some useful feedback regarding this reporting.
If you got anything useful, please feel free to feedback and benifit the
community. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button