_NT_SYMBOL_PATH format

criddell picture criddell · Jun 8, 2009 · Viewed 24.2k times · Source

I'm trying to use windbg more, and I keep having problems with the symbol cache. It isn't clear to me what the format of the string is supposed to be.

I have a few requirements:

The archive of symbols from our distributed build at \\foo\Build1234 are not organized as a symbol server. If I understand it correctly, I need to use the cache keyword.

Given these requirements, does this look like a properly formatted srvpath:

cache*\\foo\Build1234;srv*c:\dev\symbols*http://msdl.microsoft.com/download/symbols

Edit:

I just started reading Advanced Windows Debugging and I had misinterpreted how the cache keyword works. I thought it was a way of telling the debugger that the folder is just a folder of files and not a symbol server. After Michael left his comment, I reread the section and see that it indeed works as Michael described.

Now I'm confused by when you use a ; or a * to separate paths/URLs. And when you need the srv* prefix. In the online help for windbg they give this example:

\\someshare\that\cachestar\ignores;srv*c:\mysymbols*http://msdl.microsoft.com/download/symbols;cache*c:\mysymbols;\\anothershare\that\gets\cached

The symbols from \\someshare are not cached, symbols from Microsoft are cached in c:\mysymbols, and c:\mysymbols is used as the cache for any other paths to the right of the cache* directive.

The occasional use of srv* is confusing me -- I don't understand why the first and last paths aren't prefixed with srv*.

Edit 2:

This is slowly starting to make sense to me. The srv directive is used for symbol servers, and not for normal symbol directories. So, I believe the answer to my original question is this:

\\foo\Build1234;cache*c:\dev\symbols;srv*http://msdl.microsoft.com/download/symbols

Answer

Michael picture Michael · Jun 8, 2009
SRV*C:\dev\symbols*http://msdl.microsoft.com/download/symbols;\\foo\build1234

Should work fine, if \\foo\build1234 is just flat PDB's. Cache isn't needed here; you just need to add the directory to your symbol path.

The cache keyword specifies where you want to cache your symbol files, and is useful for caching symbols locally from non-indexed shares (like \\foo\build1234)

cache*C:\dev\symbols;SRV*C:\dev\symbols*http://msdl.microsoft.com/download/symbols;\\foo\build1234

The above path would store symbols from MS's symbol server and your symbol share to your local machine in C:\dev\symbols.

To debug symbol issues using windbg, do

!sym noisy
.reload <some exe or DLL in your session>

And then do some action that would force the PDB to be loaded. You'll see where windbg is looking for files, and if it rejects a PDB why it did so.

!sym quiet

Will then suppress symbol prompts.