[llvm-dev] LLVM JIT Compilation

Stefan Gränitz via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 17 06:48:51 PDT 2017


Hi Harmeeza

> On 16 August 2017 at 12:05, hameeza ahmed via llvm-dev
>> now how to obtain assembly file generated at run time. and do a detailed
>> debugging of this code.
Debugging JITed code can be hairy. I think atm it's only supported for
ELF object files on Linux. If you really want to do that, you could
follow this guide:
https://llvm.org/docs/DebuggingJITedCode.html

It should work if you pass -jit-kind=mcjit (the guide mentions the old
flag -use-mcjit) to use the "old" monolithic MCJIT.
For an ORC-based JIT you need to implement the GDB JIT Interface
yourself. I have an example for this on GitHub:
https://github.com/weliveindetail/JitFromScratch/tree/jit-debug/gdb-interface

There is also another example that shows how to implement your own
optimization chain in a ORC-Jit and dump raw vs. optimized IR code:
https://github.com/weliveindetail/JitFromScratch/tree/jit-optimization

Cheers
Stefan

-- 
https://weliveindetail.github.io/blog/
https://cryptup.org/pub/stefan.graenitz@gmail.com




More information about the llvm-dev mailing list