Scott Hanselman

Set up your system to use Microsoft's public Symbol Server

September 30, '06 Comments [1] Posted in Programming
Sponsored By

Symbolserver1If you're always futzing around with Process Explorer or trying to load your DLLs into someone else's memory space (like Explorer.exe), you're running WinDBG (or you want to) on Vista memory dumps, then you'll want to hook up to Microsoft's public Symbol Server for the PDBs for Microsoft's various and sundry processes.

Here's a good "Getting Started" article at MSDN as well as this one on How to use a Symbol Server.

Basically all you have to do is right-click My Computer, then click Properties. Select the Advanced tab and click the Environment Variables button. Set a variable called _NT_SYMBOL_PATH to something like:

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

...and you'll automatically get the PDBs downloaded directly from Microsoft while debugging. Be aware that there's often a long pause the first time the big ones come down. After that, it's speedy.

As long as the Symsrv.dll file is in your C:\Program Files\<Visual Studio>\Common7\IDE folder - it's put there by installing Debugging Tools for Windows - you'll get the symbols in VS.NET. Here's a video explaining how.

Sysinternals' Process Explorer has a dialog box where you can configure Symbols as well that it'll use to resolve function names while you're in the very useful Threads tab of a process' properties.

Symbolprocexp

Gets you actual function names and stack locations that are meaningful in Process Explorer:

Symbolprocexp2

You can also set up a Symbol Server at your company (we have one here at Corillian, but it's not well-advertised internally - yet). Here's a screenshot of part of my C:\symbols folder after debugging. Notice that I've set the folder with the Compressed attribute. That's useful because PDBs will typically squish at least in half.

Symbolpath

If you really want to go bonkers, you can also setup a Source Server that will automatically retrieve the files needed to debug at the source level. Here's a great article from this August explaining what's involved in setting up your own Source Server.

This is one of those things you should just setup and forget and you'll be happy when it's already ready for you when you need it.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. I am a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Saturday, September 30, 2006 11:31:19 AM UTC
Also keep in mind that Visual Studio 2005 uses the symbol server if it is configured, and this can be both a blessing and a curse. As I unwittingly discovered while debugging a broken unit test, Visual Studio 2005 took its sweet time between clicking Run Test... in Debugger and hitting the breakpoint. This is primarily because (as I recall) it attempted to download symbols for a boatload of .NET DLLs.
Lothan
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.