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

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?

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.

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