Prevent Visual Studio from trying to load symbols

2019-01-31 16:17发布

I have Visual Studio 2005 set up to use Microsoft's symbol servers. I also have UltraMon installed, which injects a hook DLL into every process. Whenever I start debugging my MFC application, Visual Studio says:

"Loading symbols for C:\Program Files\UltraMon\RTSUltraMonHookX32.dll..."

for anything from the blink of an eye to several tens of seconds. It's never going to find those symbols... Can I tell it not to bother looking?

(I tried creating an empty RTSUltraMonHookX32.pdb file, but Visual Studio sees that it's not good and carries on looking.)

8条回答
淡お忘
2楼-- · 2019-01-31 16:28

You can't do this in a very fine grained fashion but you can disable automatic symbol loading and then manually choose the symbols to load via the Modules window (Debug -> Windows -> Modules).

To Disable Automatic Symbol loading

  • Tools -> Options -> Debugging -> Symbols
  • Check "Search the above locations only when symbols are loaded manually"
查看更多
Root(大扎)
3楼-- · 2019-01-31 16:31

Also check that you have no "_NT_SYMBOL_PATH" environment variable. If you have this var symbols will load regardless of VS settings.

查看更多
Summer. ? 凉城
4楼-- · 2019-01-31 16:33

From Visual Studio 2010 onwards, you can go to:

Tools -> Options -> Debugging -> Symbols -> Specify excluded modules

and enter the list of the dlls which take too long to load. I use the full path, given by the Output Window; maybe it accepts wildcards or simple file names.

查看更多
forever°为你锁心
5楼-- · 2019-01-31 16:33

In Visual Studio 2013 Pro, if the Microsoft Symbol Server is checked, VS will attempt to load all symbols on their server, causing a lot of extra time.

查看更多
Summer. ? 凉城
6楼-- · 2019-01-31 16:34

You can also set up symbol server exclusions which will not be attempted to download in HKEY_CURRENT_USER\Software\Microsoft\Symbol Server\Exclusions or possibly also HKEY_LOCAL_MACHINE\Software\Microsoft\Symbol Server\Exclusions or via a .ini file at %WINDIR%\system32\inetsrv\Symsrv.ini (use the header [exclusions] and put each exclusion on its own line). The exclusions are simple pattern matches, so use msxml5.* for example.

查看更多
劳资没心,怎么记你
7楼-- · 2019-01-31 16:35
  • Load all symbol packages from MS website manually, put them on a SSD drive for speed :-)
  • If you have a "_NT_SYMBOL_PATH" environment variable, remove the part "http://msdl.microsoft.com/download/symbols" from "SRVe:\symbols*http://msdl.microsoft.com/download/symbols", so you have only the symbol path where your symbols live preciously downloaded.
  • Now you have support for symbols but they wont be downloaded from MS, but loaded from drive
查看更多
登录 后发表回答