Search code examples
.netdebuggingpdb-filesdbghelpdia-sdk

What is the format (schema) of .NET PDB files?


What is the format (schema) of .NET PDB files? I'd like to parse the information out of these files so that I can display the correct lines of code (line numbers) in a debugging application.


Solution

  • dbghelp library (straightforward):

    http://msdn.microsoft.com/en-us/library/ms679309(VS.85).aspx

    DIA SDK (more comprehensive, but COM):

    http://msdn.microsoft.com/en-us/library/x93ctkx8(VS.80).aspx

    I've only used dbghelp myself, and only for native binaries. I found it pretty easy to use, if all you need to do is convert address to file name and line number. Can't say whether it works for managed apps too, but if not then it looks like the DIA SDK does.

    As for the PDB format, to quote the DIA page, "Because the format of the .pdb file generated by the postcompiler tools undergoes constant revision, exposing the format is impractical". So that's that, I suppose...