[llvm-dev] Gauging interest in generating PDBs from LLVM-backed languages

Michael Lewis via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 24 18:18:40 PDT 2016

Hi all,

I've recently been doing some work on a novel language that uses LLVM for
optimization and machine codegen. The language is self-hosted, I'm building
my third iteration of its garbage collector, and also writing a thin IDE to
stretch the language a bit. Needless to say, debugging is a major concern
for me.

My primary experience (and primary development focus) is Windows-centric,
so my go-to debuggers are Visual Studio and WinDbg. I know of the lldb/VS
integration efforts, and of course with appropriate setup I could also
leverage gdb (IIRC). But these aren't quite what I was looking for,

Long story short I set out to build a PDB emitter that could generate debug
information for my language based on the existing CodeView emission support
as of LLVM 3.8. I'm happy to report success as of this afternoon. More
details about the effort and its status can be found at [0].

The high-level overview of my strategy is to crack the CodeView blob from
LLVM (.data$S COFF section) and reassemble it, plus some augmentation, then
feed that to the API exposed by MSPDB140.dll (Visual Studio 2015's
version). This works and I can debug programs in both VS and WinDbg
assuming the front-end supplies sane metadata to the LLVM layer.

My question to the list - is this work valuable for anyone else? Would
there be general interest in documentation or even example code that
assembles what I've learned throughout this effort?


 - Mike

[0] -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160724/b87c5fe2/attachment.html>

More information about the llvm-dev mailing list