Frage

How can I set up a symbol server for use with WinDbg and friends on a Linux machine that runs an HTTP server?

The upstream symbol servers provided by Microsoft are HTTP servers (e.g. http://msdl.microsoft.com/download/symbols) and I'd like to mimic their behavior and enable the usual Win32 debuggers to download the symbols from my own.

How can I achieve this without emulating bits and pieces of Windows (e.g. via Wine or KVM)?

War es hilfreich?

Lösung 2

You can use the python symstore package to publish PDB (and exe/dll) files to a local symstore directory, and then you just need serve that directory with a web server.

  • configure a web-server to server contests of a directory, say /var/www/symbols
  • install the 'symstore' python package

Each time you need to publish new PDB/exe/dll files, put them somewhere on you web-server. Then run 'symstore' command, provided by the python package, e.g.

symstore /var/www/symbols pdb1 pdb2 ...

This will copy all the specified files to correct subdirectories of /var/www/symbols and create a transaction entry in meta-files of the symbol store.

The symstore package also provides an python API, so it's possible to do the publication programmatically from any python process.

Symstore package installation instructions are here: https://pypi.python.org/pypi/symstore/0.1.1

Andere Tipps

If you haven't already, you might want to brush up on how to create a symbol store on Windows because to create one on Linux you would need to create a compatible file structure.

First, it's important to note that sharing a symbol server over http is not special at all. Once a symbol store is created, it is just a matter of having it somewhere that is accessible via http. So, what is really important is the work that symstore.exe does.

I know you do not want to entertain the idea of using emulation, but you really have 2 choices:

  1. Directly execute symstore.exe on a Linux box using something like Wine. (I don't know how well KVM would work here.)
  2. Recreate the features of symstore.exe that you need to use.

Recreating symstore.exe can be pretty simple if you don't want to use any of its more advanced features like transactions, file links, or multiple users being able to import.


A simplified view of what symstore.exe does:

  1. Creates a subdirectory in the output subdirectory with the name of each pdb imported.
  2. Hashes the pdb file and creates a subfolder with the name of the hash.
  3. Copies the pdb to the hash directory, optionally compressing it. (Or, depending on flags, stores a file file.ptr with the location the pdb is being imported from.)
  4. Appends a line to refs.ptr in the hash directory with some information about the PDB that was imported. (I don't believe this file is actually used by the client, dgbhelp.dll, so this step could possibly be omitted.)
  5. Updates files in the [output directory]\000Admin to support things like transactions. (Again, this is just here for future runs of symstore.exe.)
  6. Touches pingme.txt in the output folder.

(More info here.)

This doesn't sound too complicated, but no doubt, it could take some time to get right. To start with, you might want to take a look at Mozilla's build script which places pdbs in a structure that Windows debuggers know how to read. And some more information on it is available here.

Update: see a more detailed answer of mine.


Given the assumption that you are the administrator of all symbols, you can do like this:

  1. Create the "master" symbol store on your machine using symstore.exe.
  2. Create a new virtual host or use an existing domain and create a subdirectory for storing your symbols.
  3. Upload the complete master symbol store to the directory

To add new symbols, execute symstore.exe on your Windows machine again. Then upload all files again. You can skip the ones which already exist on the server, except pingme.txt. Existing files should not change, otherwise their hash should be different as well, which means they are in a different subdirectory.

You might want to protect your symbols from access. WinDbg supports .htaccess and .htpasswd, at least with basic authentication. I guess you're familiar with that.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top