BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Introducing Portable PDB

Introducing Portable PDB

This item in japanese

In order to debug compiled applications, it is necessary to match-up the IL or machine code in the binary with the original lines of source code. While this data could be embedded in the application itself, that would significantly increase the size of the EXE or DLL file. Instead, a separate “symbols” file is usually used. On the Windows platform, this is known as a PDB or “program database”.

Originally designed for C/C++, the PDB format has been expanded over the years to include .NET. Unfortunately, the format was always considered to be proprietary, which in this case means that it wasn’t well documented and really could only be read using Windows-only libraries.

With .NET Core, a new cross-platform PDB library was needed. But rather than trying just to port the existing library, Microsoft chose to rewrite the Windows PDB format. The new Portable PDB format drops the features needed for native code, leaving only .NET functionality. This allowed them to simplify the format and significantly reduce the size of the PDB files.

The Portable PDB format is publicly documented with an open source library for reading it. But there are some downsides: the Portable PDB format does not support Edit-and-Continue, FXCop style code analysis (Roslyn code analysis does work), profiling tools, post-compilation build steps such as AOP or Code Contracts, or .NET decompilers. None of these are permanent limitations, but it will take time for the tooling to be upgraded to support the new format.

Rate this Article

Adoption
Style

BT