[LLVMdev] interactive llvm interpreter?

Alexei Svitkine alexei.svitkine at gmail.com
Thu Mar 5 11:52:13 PST 2009


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

On Thu, Mar 5, 2009 at 1:45 PM, Jon Harrop <jon at ffconsultancy.com> wrote:
> On Thursday 05 March 2009 17:50:31 Chris Lattner wrote:
>> On Mar 5, 2009, at 8:54 AM, Mattias Holm wrote:
>> > 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.
>>
>> 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.
>
> I think a walkthrough of the source, like the Kaleidoscope tutorials, would
> also be extremely valuable.
>
> --
> Dr Jon Harrop, Flying Frog Consultancy Ltd.
> http://www.ffconsultancy.com/?e
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list