Michael Lewis via llvm-dev
2016-Jul-25 01:18 UTC
[llvm-dev] Gauging interest in generating PDBs from LLVM-backed languages
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, personally. 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? Thanks, - Mike [0] - https://github.com/apoch/epoch-language/wiki/Knowledge-Dump---Debugging-Epoch-Programs -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160724/b87c5fe2/attachment.html>
Tony Kelman via llvm-dev
2016-Jul-26 12:58 UTC
[llvm-dev] Gauging interest in generating PDBs from LLVM-backed languages
Michael Lewis via llvm-dev <llvm-dev <at> lists.llvm.org> writes:> My question to the list - is this work valuable for anyone else? Wouldthere be general interest in documentation or even example code that assembles what I've learned throughout this effort? I imagine Julia, Rust, and others would appreciate that kind of resource (and improving the PDB support that's available upstream in LLVM) for better integration with PDB-based Windows debuggers, so yes! -Tony
Reid Kleckner via llvm-dev
2016-Jul-26 15:02 UTC
[llvm-dev] Gauging interest in generating PDBs from LLVM-backed languages
We've been pursuing the direction of writing PDBs from scratch in llvm/lib/DebugInfo/PDB/Raw and related directories. It might be interesting to have code that talks to MSPDB140.dll in LLVM, but we really want LLD to be able to produce its output on any platform. On Sun, Jul 24, 2016 at 9:18 PM, Michael Lewis via llvm-dev < llvm-dev at lists.llvm.org> wrote:> 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, > personally. > > 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? > > > Thanks, > > > > - Mike > > > [0] - > https://github.com/apoch/epoch-language/wiki/Knowledge-Dump---Debugging-Epoch-Programs > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160726/66cbc1ed/attachment.html>
Michael Lewis via llvm-dev
2016-Jul-26 18:52 UTC
[llvm-dev] Gauging interest in generating PDBs from LLVM-backed languages
On Tue, Jul 26, 2016 at 8:02 AM, Reid Kleckner <rnk at google.com> wrote:> We've been pursuing the direction of writing PDBs from scratch in > llvm/lib/DebugInfo/PDB/Raw and related directories. It might be interesting > to have code that talks to MSPDB140.dll in LLVM, but we really want LLD to > be able to produce its output on any platform. >I completely agree about independence from arbitrary platform-specific binaries. (After all, escaping LINK.EXE just to rely on MSPDB140.dll isn't that huge of a win by itself.) I forgot to mention it in my original mail, but my plan is to transition away from using MSPDB140.dll and fabricate "whole cloth" PDB/MSF files in the near future. Based on the microsoft-pdb GitHub repo and the code I've seen in LLVM, I think this is a totally reachable goal. Most of what I've found has little to do with the mechanics of the MSF format (yet!) and more to do with the semantic content of PDBs and how to coax the debuggers in question to yield the desired results. I don't know how much of that stuff is mysterious to the larger community and what was just mysterious to me when I set out on this little venture :-) But in any case I'd be glad to compare notes with anyone who's working in this space. - Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160726/75b30b50/attachment.html>
Possibly Parallel Threads
- Gauging interest in generating PDBs from LLVM-backed languages
- Gauging interest in generating PDBs from LLVM-backed languages
- Gauging interest in generating PDBs from LLVM-backed languages
- Gauging interest in generating PDBs from LLVM-backed languages
- [MCJIT] messy call stack debug on x64 code in VisualStudio