llvm c++ api - Print x86 assembly instead of getting machine code from ExecutionEngine -
i've seen several conflicting descriptions of how around google results, , haven't been able of them work.
my problem this: call executionengine::getpointertofunction (with llvm::function*), i'd instead pretty-printed x86 assembly produced function.
anybody?
[eta: i'm using llvm 3.3. descriptions i've found seem earlier versions of llvm.]
it turns out can add event listener jit executionengine executionengine::registerjiteventlistener. if provide instance of class, can have callback invoked when machine code generated you, , you'll given pointer machine code , length. this, can call llvm::sys::disassemblebuffer description of machine code buffer.
however, llvm::sys::disassemblebuffer function defers udis library if llvm compiled support. since build of llvm didn't have flag set , can't rebuild it, i'll using udis library directly:
Comments
Post a Comment