Debugging an application after its been released can be a total pain. Â So, over time I’ve collected some software and techniques for making it a bit easier on myself and my team. Â We ship our product with a modified version ofÂ Â Hans Dietrich’s XCrashReport to provide logs, system information, and minidumps when our application inevitably crashes. If you’re not already using something similar I would highly recommend checking it out.
This utility sends us lots of crash dump files and until now we’ve always had to dig back through our archives to find the corresponding symbols and source code. But today I decided to rid us of the headache and set up a Symbol Server that could automatically determine our version and load it into Visual Studio 2008. The documentation can be a bit lacking at times, so I will try to illuminate the path that I took.
Download Debugging Tools for Windows. This provides you with symstore.exe which will be important for creating the symbol store.
Add the Debugging Tools directory to your path, so we have access to symstore.exe.
Create a folder on your build server and share it such that you have something like \\BuildServer\Symbols available to your workstation.
For each build, execute a command like
symstore.exe add /r /p /f U:\Project\Bin\*.* /s \\BuildServer\Symbols /t “My Project” /v “Build 42”
Where U:\Project\Bin is the directory with your .pdb files, \\BuildServer\Symbols is obviously the symbols directory, “My Project” is the name of the project, and “Build 42” is the description of the version.
Open Visual Studio 2008, Â go to Tools->Options->Debugging->Symbols. Set your cache directory to something like C:\SymbolCache, then add the location of the new symbol store: \\BuildServer\Symbols.
At this point, it would be advisable to add the Microsoft Symbol Store to the locations list too: http://msdl.microsoft.com/download/symbols.
This should facilitate debugging crash dumps without tracking down the symbols. Also, check out theÂ Source Server which will access your VCS system to pull out the correct source code files for you automatically too.