debugging Orc JIT'ed code

Greetings, LLVM wizards.

I was just wondering if any progress has been made on this issue in the last few months (using gdb to debug a module compiled by Orc). I had to move to the Orc API in order to be able to call modules’ constructors and destructors as needed, but I would quite like to be able to debug and profile the resulting code as well…


cc'ing Stefan Gränitz, he had some progress on this topic.

Hi Geoff, hi Alex

If you implement the GDB JIT Interface in your Orc JIT, this is in
general possible (at least from the JIT's point of view) with both
debuggers, GDB and LLDB. Please have a look at the example here:

You will probably need to adjust the code depending on the LLVM version
you are using. As described in the readme, however, getting it to work
in practice depends on a few more details. To Keep it short:
* Linux: works out of the box
* macOS: possible, but cumbersome (the example is not up-to-date here)
* Windows: I lost hope (haven't looked at it for a long time though)


That works (on Linux)! Thanks very much for the pointer, Stefan.

Might you be able to point me to any information about getting profiling to work as well?

Thanks again,

(Sorry, I hadn’t seen the recent post by Frank Tetzel asking essentially the same question…)

Might be nice to get your examples as part of the rest of the Orc documentation :slight_smile: