Vivien Millet via llvm-dev
2017-Mar-02 11:28 UTC
[llvm-dev] [LLVM::IR] How to retrieve llvm::Instruction address after JIT code generation?
Hi LLVM developers, I've posted yesterday a question on StackOverflow here : http://stackoverflow.com/questions/42544386/how-to-retrieve-llvminstruction-address-after-jit-code-generation Is someone knowing the answer ? I would really like to be able to insert manually "int 3" in the generated assembly to add my own JIT software breakpoints. Thank you ! Sincerely, Vivien -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170302/d83a7c64/attachment.html>
Joerg Sonnenberger via llvm-dev
2017-Mar-02 13:56 UTC
[llvm-dev] [LLVM::IR] How to retrieve llvm::Instruction address after JIT code generation?
On Thu, Mar 02, 2017 at 12:28:34PM +0100, Vivien Millet via llvm-dev wrote:> I've posted yesterday a question on StackOverflow here : > > http://stackoverflow.com/questions/42544386/how-to-retrieve-llvminstruction-address-after-jit-code-generation > > Is someone knowing the answer ? I would really like to be able to insert > manually "int 3" in the generated assembly to add my own JIT software > breakpoints.(1) Please post your actual question, not just a link to SO. (2) No, this is generally not possible. LLVM IR doesn't have a 1:1 mapping to assembler and with optimisation, instructions can disappear or be merged with others. By the nature of SSA, the order of instructions even within a Basic Block is often not even defined. You can create debug traps using intrinsics directly. Joerg
Vivien Millet via llvm-dev
2017-Mar-06 16:04 UTC
[llvm-dev] [LLVM::IR] How to retrieve llvm::Instruction address after JIT code generation?
Sorry for posting the SO question but it seems other people are curious of the answer to that question, and i hoped someone would answer there. Anyway thank you for your answer ! If I can't do it that way, I have an alternate question : Is there a way to retrieve assembly memory address from a llvm::DebugLoc after MCJIT code generation ? (I guessed it could be possible because GDB can be used with MCJIT) Thanks! Vivien PS: i haven't got the reply in my mailbox but had to retrieve it in the llvm-dev google group, how can I receive a reply on my mailbox directly ? 2017-03-02 12:28 GMT+01:00 Vivien Millet <vivien.millet at gmail.com>:> Hi LLVM developers, > > I've posted yesterday a question on StackOverflow here : > > http://stackoverflow.com/questions/42544386/how-to- > retrieve-llvminstruction-address-after-jit-code-generation > > Is someone knowing the answer ? I would really like to be able to insert > manually "int 3" in the generated assembly to add my own JIT software > breakpoints. > > Thank you ! > > Sincerely, > > Vivien > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170306/deca1efa/attachment.html>