views:

45

answers:

2

I've setup _NT_SYMBOL_PATH and have pointed it to

srv*c:\symbols*http://msdl.microsoft.com/download/symbols

When starting the debugger, I notice that the Windows related dlls load quickly. However, our company's dlls are taking a god awful long time to load. When I get rid of _NT_SYMBOL_PATH, restart visual studio, then everything loads pretty quickly (albeit I don't have MS symbols).

It's almost as if the symbol server above is being searched for my internal company dll's pdbs instead of first checking to see if they exist locally. Some of these dlls I do not have pdbs for. Some are part of my solution, so I build them when debugging and always have pdbs.

How is Visual Studio searching for symbols? Is there anyway I can control how visual studio searches for symbols? Can I explicitly say that for dlls from a given directory are not to be searched for symbols? Is there anything else that might drag down how fast symbols are loaded or anything I can do to speed up the process?

+7  A: 

Visual Studio searches _NT_SYMBOL_PATH before any paths configured inside Visual Studio. This is a "feature" of the debugging engine. This means that Microsoft's symbol servers will be searched for your symbols.

In Visual Studio 2010, they've made this explicit by (if it's set) including _NT_SYMBOL_PATH in the Debugging Symbols dialog. Unfortunately, this entry cannot be moved up or down.

To get around this, put your symbol server in _NT_SYMBOL_PATH before the Microsoft stuff:

_NT_SYMBOL_PATH=cache*C:\symbols;\\mysymsvr\Symbols;SRV*C:\symbols*http://msdl.microsoft.com/download/symbols

Roger Lipscombe
+2  A: 

In addition to @Roger's correct answer.

If you're debugging in Visual Studio I would avoid using the _NT_SYMBOL_PATH environment variable in favor of using the Visual Studio settings.

Tools -> Options -> Debugging Symbols

In 2010 this allows you more granularity than the raw environment variable route. For example you can filter down the list of DLL's for which Visual Studio attempts to load symbols for by default. This is very valuable in large projects where your only interested in a small subset of the DLL's and want to reduce load time.

JaredPar
You'll note that, in VS2010, if _NT_SYMBOL_PATH is set, it appears at the top of the Debugging Symbols list **and cannot be moved**. See https://connect.microsoft.com/VisualStudio/feedback/details/523855/move-up-move-down-buttons-dont-work-in-the-symbol-file-pdb-locations-list
Roger Lipscombe