[LLVMdev] [Help needed] How to get __LLVM_StackMaps section using MCJIT?

Philip Reames listmail at philipreames.com
Wed Jun 10 18:03:22 PDT 2015



On 06/10/2015 04:45 AM, Dmitry Borisenkov wrote:
> Dear llvm developers,
>
> I've just started to work with MCJIT and I'll appreciate if you help 
> me answering the question.
>
> I jitted code with llvm.experimental.patchpoint and I'd like to get 
> address of the code corresponded to the patchpoint. Having 
> ExecutionEngine instance (how) can I obtain some wrapper over stackmap 
> section to query address I need?
To get the address of the start of the section, you will need to use a 
custom memory manager to capture the address of the section when 
allocated.  See allocateDataSection. There may be a better way to do 
this, but since you probably need a custom memory manager anyway, this 
works pretty well.

Once you have the address of the stackmap section, you can parse it 
using a parser like the one I just posted for review:
http://reviews.llvm.org/D10377
>
> P.S. I started familiarizing myself with MCJIT using documentation and 
> examples, and I'd like to notice that HowToUseJIT might be confusing 
> for a novice (as it was for me) beacuse it's actually demonstrate how 
> to use the interpreter.
>
> -- 
> Kind regards, Dmitry Borisenkov
> _______________________________________________
> 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