We switched from compiling LLVM with gcc to clang (3.3) and it appears that clang (correctly I think) optimizes away the GDBRegistrar’s __jit_debug_register_code() function that’s used to trigger reading debug info from JIT-ted code, breaking GDB support.
This patch forces it to leave the call using the method described here in the ‘noinline’ section:
I’ve made the change you suggested and verified that it still works. I think the noinline is still required though as this function can be called from a couple of places and gdb will want to set its breakpoint on the single function address. Let me know if you think otherwise though.
I don’t have commit access, I wasn’t sure if this was the right protocol to get a patch accepted but just let me know if not and I’ll get it right the next time.