I was looking into implementing debugger support for Hylo, so I found this article which seemed very promising: Adding Language Support
However, I also saw these two comments in the open projects page:
Finish the language abstraction and remove all the unnecessary API’s
An important part of making lldb a more useful “debugger toolkit” as opposed to a C/C++/ObjC/Swift debugger is to have a clean abstraction for language support. We did most, but not all, of the physical separation. We need to finish that. And then by force of necessity the API’s really look like the interface to a C++ type system with a few swift bits added on. How you would go about adding a new language is unclear and much more trouble than it is worth at present. But if we made this nice, we could add a lot of value to other language projects.
Make a more accessible plugin architecture for lldb
Right now, you can only use the Python or SB API’s to extend an extant lldb. You can’t implement any of the actual lldb Plugins as plugins. That means anybody that wants to add new Object file/Process/Language etc support has to build and distribute their own lldb. This is tricky because the API’s the plugins use are currently not stable (and recently have been changing quite a lot.) We would have to define a subset of lldb_private that you could use, and some way of telling whether the plugins were compatible with the lldb. But long-term, making this sort of extension possible will make lldb more appealing for research and 3rd party uses.
Could someone give an update on whether these are still accurate, or if adding a new language is now possible without maintaining a fork? If possible, are there any limitations for features such as adding expression evaluation support for a new language that wouldn’t be possible?
Depending on the scale of the remaining related issues, someone from our research group may contribute to the project in the coming months. Our research goal is to explore the possibilities of making debuggers for new languages, and so far we found LLDB the most suitable. If you know of other technologies that we can learn from, please share them also! Some may provide different levels of debuggability support, and not all new languages may aim for a full expression evaluator, so it would be also interesting to see which approaches come with what tradeoffs.
Relevant Findings
Swift has a full llvm fork, which is not a viable approach for most smaller language maintainers.
Rust uses LLDB as one of its available debuggers, and they have implemented it as a wrapper around lldb. They added type formatters, but other functionality such as expression evaluation is very limited (they implemented expression parsing outside lldb).
@DavidSpickett was looking into Fortran support to LLDB.