Open lhames opened 4 years ago
Initial MachO debugging support added in e1933a0488a. You'll need to explicitly enable the plugin in lldb to use it:
(lldb) set set plugin.jit-loader.gdb.enable on
Once the plugin has been enabled you should be able to debug MachO JIT'd code within that session.
Extended Description
We should build an ObjectLinkingLayer plugin to enable debugging of JIT'd code.
MCJIT / RuntimeDyld already has GDBRegistrationListener for this purpose. We may want to look at whether we can re-use the GDB registration protocol for this. See: llvm/llvm-project#1501 , llvm/llvm-project#18002 , and https://sourceware.org/gdb/current/onlinedocs/gdb/JIT-Interface.html.
If we go this route then ideally the plugin will synthesize a new object with the necessary section/segment load commands, nlist entries, and dwarf sections, but without the dead weight of all the actual code and data.