BT

Introducing Portable PDB

| by Jonathan Allen Follow 641 Followers on Feb 06, 2017. Estimated reading time: 1 minute |

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 Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

TFS 2017 support missing by Stijn Peeters

Also nice to know, TFS 2017 does even support this yet for indexing sources. So using nuget pacakges that contain those pdb breaks the build!

Re: TFS 2017 support missing by Jonathan Allen

That's quite unfortunate. Is there an open bug report on the issue?

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

2 Discuss
BT