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

Michael Lewis via llvm-dev llvm-dev at lists.llvm.org
Sun Aug 7 14:33:52 PDT 2016


This afternoon I finished a first pass at "whole cloth" PDB generation. I
can get my entry point function to show up in the debugger with a proper
name in both VS2015 and a couple versions of WinDbg. It isn't much but it's
a start, and now that I have a reasonable handle on how the PDB/MSF formats
are laid out, I can move on to adding in things like source line mappings
and type metadata.

My implementation is entirely in the Epoch language, since my ultimate goal
is to enable debugging of binaries emitted by the self-hosting compiler. I
plan to document the code much better in the near future, but the existing
pass at generating a usable PDB lives here:

https://github.com/apoch/epoch-language/tree/master/EpochDevTools/PDB

The project in that directory is basically a standalone test bed for
emitting a fabricated PDB. Now that the simple parts are in place and
working, I plan to clean it up and generalize a bunch of the hard-coded
magic in there, plus of course add a ton of comments :-)

After that the plan is to merge the standalone code back into the compiler
itself so that the linking portion of the build tools can emit PDBs for
arbitrary programs.



As before, the living wiki page contains my latest thoughts and knowledge
on the subject:

https://github.com/apoch/epoch-language/wiki/Knowledge-Dump---Debugging-Epoch-Programs


I'm curious now if there are any specific challenges facing other LLVM
languages in this area. I'd be glad to compare notes with anyone else
working on front-end integration of the ability to emit this debug format.





On Mon, Aug 1, 2016 at 2:38 PM, Hal Finkel <hfinkel at anl.gov> wrote:
>
> You might also find this useful: https://github.com/Microsoft/
> microsoft-pdb
>
>  -Hal
>


Thanks, Hal. I've been poking through there as well actually, and even
though it doesn't build, the code has been very helpful in reverse
engineering the file loading process.



And thanks all for the other pointers and resources from this thread; this
would have been a nightmare without that information!


 - Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160807/63692574/attachment.html>


More information about the llvm-dev mailing list