_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
...The LLVM documentation has a page at
llvm.org/docs/DebuggingJITedCode.html
showing an example of using gdb to debug MCJIT’ed code, but has no mention of ORC JIT.
I'm pretty sure that's not the case, at least not with any simple
orcjit tutorials I've seen.
The GDB support is provided by `GDBJITRegistrationListener` which is
registered to MCJIT directly in the constructor and AFAICT no where
else. Also, since there doesn't seem to be a default (non-noop)
implementation of `ExecutionEngine::RegisterJITEventListener` I
believe you can't just call `RegisterJITEventListener` on non-MCJIT
and expect it to work.
So while I totally believe one can use
`JITEventListener::createGDBRegistrationListener()` to hook the JIT
with the the gdb registration function, it won't work without writing
code to explicitly do that (in additional to actually writing code to
interface with the event listener directly). OTOH though when using
MCJIT, this is done by default and one don't need to write any code
for it to work.
> but not well documented anywhere yet. :/
Right. That's exactly what we (julia) do although we don't use
`GDBRegistrationListener` directly. I just mean that this has to be
done manually (so no "builtin" support for some meaning of "builtin")
and it can't be accomplished just by reading the mcjit doc. :/
So while I totally believe one can use `JITEventListener::createGDBRegistrationListener()` to hook the JIT with the the gdb registration function, it won't work without writing code to explicitly do that
I’m wondering if it’s possible to debug code JIT’ed with the newer ORC JIT. The LLVM documentation has a page at llvm.org/docs/DebuggingJITedCode.html