Getting state at interrupt of JIT

Dear All
Here is another question and any help is appreciated.
Is there any way to get the state of the running program interrupt of JIT?
I've managed to interrupt JIT while running some function and direct it to some function that plays as a handler. However, at this function I need to get the exact state of the running function. By state I mean which instruction, which basicblock, variables addresses and values, stack state ... etc.

Regards,
Marwa Yusuf
Teaching Assistant - Computer Engineering Department
Faculty of Engineering - Benha University
E-JUST MSc Student
Computer Science & Engineering Dept.

Hi Marwa,

Are you trying to get the state from within a debugger or do you want to be able to somehow interpret the state from within the program itself?

If you want to find the state within a debugger, then it's mostly a matter of helping the debugger to find and interpret the JITed code. There is support for registering debugging information with GDB in the MCJIT engine. The older JIT engine used to have limited support of this kind, but it was removed at some point.

If you want your program to be able to interpret its own JITed code in some way then you might need to instrument it in some way.

If you need to make a connection in your program between the address of JITed code and the LLVM abstractions that correspond to it, the JITEventListener interface is probably the place to start looking.

-Andy