[lldb-dev] MCJIT Mach-O JIT debugging

Keno Fischer kfischer at college.harvard.edu
Wed May 28 08:57:24 PDT 2014


Hello,

I'm finally getting back to getting JIT debugging work for MCJIT. This has
worked for ELF for a while in LLVM and support in lldb was added in January
(for ELF). I'm now trying to add support for Mach-O and would appreciate
some feedback (though I'm fighting my way through learning the format, I'm
still just a novice).

My current patchset for llvm is here:
https://gist.github.com/loladiro/8d909ddd04e6d7e9a5d0 . I have a
corresponding patch for lldb and I basically got this working (modulo line
table information, though I'm sure I'm doing something stupid in lldb here).
The basic approach is to, when a section gets allocated rewrite the
sections `addr` and update every symbols `n_value` correspondingly. This is
very much in line with what is done for ELF, but I'm not sure if it's the
right approach, so I'd appreciate if somebody who has more experience with
Mach-O could look at the above patch and give some feedback. If this
approach looks sane in general, I'll finish up and post both the LLVM and
the LLDB patch for formal review.

Thanks,
Keno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140528/495f6e58/attachment.html>


More information about the lldb-dev mailing list