Local Symbol Server Caching

The Microsoft Symbol Server is a great boon for debugging on Windows. Here’s a neat way to create a local symbol cache so that your debuggers launch more quickly.

First, make a share on each of your machines for a local symbol cache. Your username will need write permission to this location.

  net share sym$=%SystemDrive%\\sym /GRANT:%USERNAME%,FULL

Next, elect one machine, perhaps a beefy server, to be the LAN master cache and set the following environment variable on every box:

   set _NT_SYMBOL_PATH = ^
      srv*\\\\\\sym$* ^
      \\\\localserver\\sym$* ^

You’ll want to adjust the line above in case you use a share other than sym$ or a LAN master cache other than localserver.

Now, when a debugger wants a new pdb he’ll use the following search order:

  1. Local sym$ share
  2. \\localserver\sym$
  3. The Microsoft Symbol Server

When the debugger fetches a PBD from an upstream source, he’ll replicate it downstream (official details here). After a few debug sessions, you’ll have a nice big local PDB repository and your debugger will load much faster.

This works on all the Microsoft debuggers: cdb, ntsd, windbg, kd and even Visual Studio.

(credit to Mark Lacey for this tip)


%d bloggers like this: