<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">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.</div><div class="gmail_quote"><br></div><div class="gmail_quote">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:</div><div class="gmail_quote"><br></div><div class="gmail_quote"><a href="https://github.com/apoch/epoch-language/tree/master/EpochDevTools/PDB">https://github.com/apoch/epoch-language/tree/master/EpochDevTools/PDB</a><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">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 :-)</div><div class="gmail_quote"><br></div><div class="gmail_quote">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.</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">As before, the living wiki page contains my latest thoughts and knowledge on the subject:</div><div class="gmail_quote"><br></div><div class="gmail_quote"><a href="https://github.com/apoch/epoch-language/wiki/Knowledge-Dump---Debugging-Epoch-Programs">https://github.com/apoch/epoch-language/wiki/Knowledge-Dump---Debugging-Epoch-Programs</a><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">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.</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Mon, Aug 1, 2016 at 2:38 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:rgb(0,0,0)">You might also find this useful: <a href="https://github.com/Microsoft/microsoft-pdb" target="_blank">https://github.com/Microsoft/<wbr>microsoft-pdb</a><br><br> -Hal</div></blockquote><div><br></div><div><br></div><div>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. </div><div><br></div><div><br></div><div><br></div><div>And thanks all for the other pointers and resources from this thread; this would have been a nightmare without that information!</div><div><br></div><div><br></div><div> - Mike</div><div><br></div><div><br></div></div></div></div>