Setting Up Symbols for Offline Environments

August 8, 2013

no comments

Yawn. That was my first reaction too, but turns out many developers around the world (including me in the not-so-distant past) work in a disconnected environment with no access to the Microsoft public symbol server or a symbol proxy. This post is for you.

Microsoft offers a set of symbol packages for each major Windows version and service pack. If your system administrator does not install updates, ever, this is good enough for you. You can find the symbol packages here.

If you are getting sporadic updates, chances are that a large number of Windows binaries have been touched by these updates, so the symbol packages aren’t gonna cut it. You will need to contact the symbol server to download symbols for the updated binaries, but you will do this in two hops. On the disconnected machine you will generate a manifest file that contains the names and timestamps of the symbol files you need. On some Internet connected machine, you will use that manifest file to download the symbols, and then transfer them to the disconnected machine again. So here goes.

On the disconnected machine, you will need symchk.exe from the Debugging Tools for Windows package (part of the Windows SDK). Then, you need to decide which symbol files you require. For typical C/C++ applications, you will need symbols for kernel32.dll, kernelbase.dll, ntdll.dll, user32.dll, advapi32.dll, mfc*.dll, msvc*.dll, and a few others. For .NET applications, you’ll have to add the .NET Framework and the CLR (e.g. clr.dll, clrjit.dll) to the list. The easier way out is to simply run the application(s) you’re debugging, and then grab the symbols for all the loaded modules. Suppose your application is called App.exe. Then you can do this:

symchk.exe /ie App.exe /om C:\temp\manifest.txt

Copy that manifest file to the connected machine, and grab the symbols to the C:\temp folder there, like this:

symchk.exe /im C:\temp\manifest.txt /s srv*C:\temp*

Now you can copy the symbols to the disconnected machine, point the debugger at them, and you’re good to go. Rinse, repeat for every Windows update you get from your system administrator :-)

I am posting short links and updates on Twitter as well as on this blog. You can follow me: @goldshtn

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>