This is a mirror of official site: http://jasper-net.blogspot.com/

Debugging Series: Symbols Server and Your Symbols

| Friday, April 8, 2011
Last post, I gave you a simple introduction to Symbol Servers. I showed you how you can use the options in Visual Studio to quickly get access to Microsoft public symbols and how that could give you more information for your debugging sessions. However, I did not show you how you could add your owns symbols to the server, and more importantly, why that is a great thing to do.

Adding Your Symbols
Adding your symbols to the symbol server is a great practice, as it gives you a better chance of debugging one of your own executables or dlls without having to have that exact version of the image available. The typical use case here of course is support of a previously deployed app. You’re currently heads down working on V3 of your app but some customer out there is currently using V1 and reports some crashing or other bug with that version. How to maximize your chances of debugging the issue? Symbols server will certainly help, as long as you have added your PDBs to the server.

NOTE:
This is all predicated on the fact that you have indeed saved your PDBs. Even if you don’t plan to setup a symbol server, please please please save your PDBs!

How do you add your own symbols to the server? There’s an “easy” way, and then a “hard” way.

The Easy Way
The “easy” way is to use the support built into Team Foundation Server 2010’s Team Build. All you need to do is tell TFS where to drop your PDBs ( it must have permission to write to that directory ) and it will handle all the rest! You do that in your build definition file. Just set the “Path to Publish Symbols” to a public UNC share, and your golden. Here’s an example:

image_thumb.png

Behind the scenes, TFS is actually handling the steps you can manually do, which I’ll describe now.

NOTE:
I’ll be discussing the details of what the Source Server is all about in a future post. Stay tuned.

The Hard Way
You can manually add your PDBs to a symbol server by making use of the symstore.exe, which is part of the “Debugging Tools for Windows” package. Of course, since this is just a command line tool, you can incorporate the following steps into any MSBuild process.

Here’s an example of the command line options that I used to push my symbols to my store:

symstore add /f DebuggingSeries.* /s \\camerons4\Symbols\MySymbols /t "My Version 1" /v "1.0.0.0" /c "Manually adding"

This simply takes the exe and the PDB from my output directory ( the directory I ran symstore in ), and copied the symbols to the UNC folder specified.

Check out this page in the MSDN docs for more details, and here for all the details around the command line options.

If you take a look at the folder where the PDBs and exe get pushed, it should look something like this:

Read more: Skinner's Blog

Posted via email from Jasper-net

0 comments: