<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 9, 2016 at 2:26 PM Chris Bieneman via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello cfe-dev,<br class="gmail_msg">
<br class="gmail_msg">
I would like to propose a new Clang library for implementing functionality that is used by LLDB. I see this as the first step in a long process of refactoring the language interfaces for LLDB.<br class="gmail_msg">
<br class="gmail_msg">
The short-term goal is for this library is to be a place for us to rebuild functionality that exists in LLDB today and relies heavily on the implementation of Clang. As we rebuild the functionality we will build a suite of testing tools in Clang that exercise this library and more general Clang functionality in the same ways that LLDB will.<br class="gmail_msg">
<br class="gmail_msg">
As bits of functionality become fully implemented and tested, we will migrate LLDB to using the Clang implementations, allowing LLDB to remove its own copies. This will provide the Clang community with a higher confidence that changes in Clang do not break LLDB, and it will provide LLDB with better test coverage of the Clang functionality.<br class="gmail_msg">
<br class="gmail_msg">
The long-term goal of this library is to provide the implementation for what could some day become a defined debugger<->frontend interface for providing modularized (maybe even plugin-based) language debugging support in LLDB. In the distant future I could see us being able to tell people building new frontends that we have a defined interface they need to implement for the debugger, and once implemented the debugger should “Just Work”.<br class="gmail_msg">
<br class="gmail_msg">
The first bit of functionality that I would like to build up into the ClangDebuggerSupport library is materialization of Clang AST types from DWARF. To support this development I intend to add a new tool in Clang that reads DWARF types, generates a Clang AST, and prints the AST. I will also add DWARF support to obj2yaml and yaml2obj, so we will be able to write YAML LIT tests for the functionality.<br class="gmail_msg">
<br class="gmail_msg">
If people are in favor of this general approach I’ll begin working in this direction, and I’ll probably add the new library sometime next month.<br class="gmail_msg">
<br class="gmail_msg">
Thoughts?<br class="gmail_msg"></blockquote><div><br>My knee-jerk reaction is that this could just as well live in LLDB if there are no other users - though Keno points out he could use it in Julia, so that seems like potentially sufficient interest to demonstrate that it might be a reasonable/reusable abstraction.<br><br>I'll leave it up to Richard or others to weigh in on whether the ongoing cost to the Clang project would be worth the benefit to these users/use cases.<br><br>Beyond that - as for testing infrastructure. I'd like to make sure we only have one piece of code for generating DWARF, as we are trying to have one piece of code for reading it (& perhaps in some far off future - we could have one piece of code that does both, to some degree - at least some more shared information about the size/representation of forms, etc) - so however we're generating DWARF, it'd be good if that used the APIs in llvm's lib/CodeGen/AsmPrinter (potentially refactored out to some more general purpose location & generalized somewhat).<br><br>Not sure exactly what sort of syntax (how low level - presumably not raw bytes written in hex or anything) you're thinking of for writing DWARF - wonder if we could have a syntax that's nice enough to read that it's either the standard form llvm-dwarfdump could use, or at least a flag to enable it? (obviously dwarfdump wants to print things like byte offsets, etc - but a higher level symbolic rendering would probably be nice for many uses and be more likely what you'd want to write when writing a test case)<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Chris<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
cfe-dev mailing list<br class="gmail_msg">
<a href="mailto:cfe-dev@lists.llvm.org" class="gmail_msg" target="_blank">cfe-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class="gmail_msg">
</blockquote></div></div>