[LLVMdev] Debugging of LLVM-IR

Garrison Venn gvenn.cfe.dev at gmail.com
Thu Feb 11 02:50:52 PST 2010

This is cool. It would seem nice if we had IRBuilder<...> conditionally do this for every instruction.
Is this way out there?


On Feb 11, 2010, at 5:39, Timo Juhani Lindfors wrote:

> Sebastian Schlunke <schlunki at cs.tu-berlin.de> writes:
>> I suspected something like that.  :(
>> I was hoping i could run the program and step throught IR-Code line by line, maybe even have a look at the variables.
>> Well, what about compiling it into assembler-code. Is there any way
>> to know which IR-line generated which assembler line(s)? (I do not
>> need any optimizations or whatever, if that helps...)
> What if you write a program that
> 1) adds a new GlobalVariable
> 2) prepends each instruction in the program with a volatile store to
> that GlobalVariable using a unique value (line number or instruction
> count).
> When the program crashes you can use gdb to read the contents of that
> GlobalVariable to see the last IR instruction that was executed? ;-)
> _______________________________________________
> 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