Getting the svn revision from a source indexed pdb

Indexing your PDBs with the information required to retrieve the source code, as it was when they were built, is definitely a “best practice”.

But given an indexed PDB, how do you extract that information?

Luckily Microsoft provides a number of useful tools for examining metadata, dumpbin for example. To get the information we are looking for, we need a utility called srctool (provided as part of the “Debugging Tools for Windows”).

When run against an indexed PDB, it generates output like this:

[c:\Server\Projects\MbUnit v3.3\Work\src\Gallio\Gallio\Common\Collections\EnumerableCounter.cs] cmd: cmd /c svn.exe cat "" --non-interactive > "C:\Program Files\Debugging Tools for Windows (x64)\srcsrv\svn\trunk\v3\src\Gallio\Gallio\Common\Collections\EnumerableCounter.cs\3241\enumerablecounter.cs"

After the filename is the command to get the correct version from source control, in this case r3241 from SVN.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s