I just had to figure out how to do this so I figured a quick blog post is in order to save other people time in future.
If you ever need to use windbg to debug a SQL Server crash dump, or you want to capture call stacks using extended events (e.g. when debugging excessive spinlock contention), you’ll need the correct symbol file (sqlservr.pdb) to go with sqlservr.exe of the instance you’re interested in.
KB article 311503 has details on how to do this in general, but they’re a little cryptic.
Assuming you’ve already installed the Windows debugging tools (see here), you’ll have a tool called symchk in the folder where windbg resides (for my laptop, “C:\Program Files\Debugging Tools for Windows (x64)”) – this is what will pull down sqlservr.pdb.
You need to point symchk at the executable you’re interested in, tell it where to put the sqlservr.pdb, and tell it the location of the Microsoft symbol server.
For me, the following worked:
C:\>cd C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn>“C:\Program Files\Debugging Tools for Windows (x64)\symchk” sqlservr.exe /s SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
Then go to the c:\symbols directory, find the directory called sqlservr.pdb with today’s date and then copy the sqlservr.pdb into the \Binn directory. You’ll also need to do this for sqlos.dll, plus on SQL Server 2012 you’ll need to do it for sqlmin.dll, sqldk.dll, sqllang.dll, sqlboot.dll too otherwise call stacks won’t resolve properly. I usually just replace sqlservr.exe in the command above with *.dll and then I’ve got all the symbol files possible.
If you get an error “The filename, directory name, or volume label syntax is incorrect.”, the copy&paste inserted weird characters for the double-quotes so delete and reinsert them.