Attaining this functionality was not easy, but it was definitely worth the investment. It all started almost exactly a year ago, when I decided that being unable to debug the self-hosting process for 64-bit Epoch was unacceptable.

Initially debug information was generated via piping some bogus line numbers into LLVM and then routing the generated block of CodeView symbols into MSPDB140.dll to generate a somewhat-working PDB file on disk. This implementation took about two weeks.

That wasn’t enough, though; it introduced a heavy dependency on Visual Studio (something I’ve been keen to avoid, despite strongly encouraging use of VS with Epoch) and also had limitations via the API of MSPDB140.dll that were…​ inscrutable, to say the least.

So I set out in search of a complete understanding of the PDB file format and how to generate my own debug information for it. The intervening year wasn’t all dedicated to PDB work; a fair amount of time went into Visual Studio integration and other tidbits of self-hosting effort. (Not to mention there were a few major spans of downtime. This gets exhausting after a while!)

The Epoch repo commit log shows the gory details of how everything came together, but the high-level is pretty simple; using a suite of tools, I reverse engineered large sections of the PDB format and developed an Epoch implementation of code to write them out.

Noteworthy projects: