Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

_NT_SYMBOL_PATH format

Tags:

windbg

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:

  • use Microsoft's server http://msdl.microsoft.com/download/symbols
  • use symbols from our software that are archived at \\foo\Build1234
  • use a local cache at c:\dev\symbols

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 
like image 825
criddell Avatar asked Jun 08 '09 21:06

criddell


People also ask

How do I use SymStore?

Use SymStore with the /x option to create an index file. After SymStore finishes, compress the files listed in the index file. Then use SymStore with the /y option (and, if you wish, the /p option) to store the files or pointers to the files in the symbol store.


2 Answers

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.

like image 176
Michael Avatar answered Sep 18 '22 15:09

Michael


Here's a detailed post on debugging issues with symbols loading.

Loading symbols in Windbg

like image 44
user1573932 Avatar answered Sep 18 '22 15:09

user1573932