interactive llvm interpreter?

Hi,

Does any interactive llvm interpreter exist or is there one being developed at the moment? What I am talking about is something like LLI but interactive so that it is possible to step through LLVM code statement by statement and inspect the results of various expressions. This would for example greatly simplify debugging of compiler passes.

We are thinking of having a master's student work on that as a master's thesis project, but it would be good to know whether that would be duplicating anyone else's current ongoing work.

Kind regards,
Mattias

I don't know of anything like that. One implementation approach would be to insert debug information into a .ll file based on the location information of the .ll file itself. That would allow you to compile the code normally and step through "the .ll file" in GDB.

-Chris

I think a walkthrough of the source, like the Kaleidoscope tutorials, would
also be extremely valuable.

I've looked at this a while ago, when I was considering using it for
my clang-based C console.

From what I found, there is no support for it yet. But it shouldn't be

extremely difficult to add.

Basically, right now the Interpreter is only exposed as an
ExecutionEngine. And that interface doesn't have any kind of methods
for stepping through the code. However, the actual Interpeter code
shouldn't be very hard to modify to support something like this. Then
you need to come up with a good API to use it... and a way to get an
object with this API out of an ExecutionEngine (which wouldn't have
these handy methods since it's not guaranteed to be backed by the
Interpreter).

-Alexei