<div dir="ltr"><div style><font face="arial, helvetica, sans-serif">Hi,</font></div><div style><font face="arial, helvetica, sans-serif"><br></font></div><div style><font face="arial, helvetica, sans-serif">How does JIT debugging feature work on Mac OSX? </font></div>
<div style><font face="arial, helvetica, sans-serif"><br></font></div><div style><span style="font-family:arial,helvetica,sans-serif">It seems that some LLVM documents implied lldb supports JIT debugging on Mac OSX.</span><br>
</div><div><font face="arial, helvetica, sans-serif"> 1) "<span style="color:rgb(0,0,0);line-height:21px">LLDB may be a better option for debugging JIT-ed code on Mac OS X." from </span></font><a href="http://llvm.org/docs/DebuggingJITedCode.html">http://llvm.org/docs/DebuggingJITedCode.html</a>.</div>
<div><span style="color:rgb(0,0,0);line-height:21px;font-family:arial,helvetica,sans-serif"> 2) "</span><span style="background-color:rgb(245,245,245);color:rgb(0,0,0);font-family:'Trebuchet MS',verdana,sans-serif;font-size:12.800000190734863px;line-height:22px;text-indent:10px">Upcoming features include JIT debugging, core file support and support of new processor features." in the section of "</span><span style="background-color:rgb(245,245,245);color:rgb(0,0,0);font-family:'Trebuchet MS',verdana,sans-serif;font-size:12.800000190734863px;line-height:22px;text-indent:10px">Recent LLDB packages have closed some of the feature gap with LLDB on Linux relative to Darwin." from </span><a href="http://blog.llvm.org/2013/06/lldb-33-and-beyond.html">http://blog.llvm.org/2013/06/lldb-33-and-beyond.html</a>.</div>
<div style><br></div><div style>I tried to use LLDB to debug the test case mentioned in <a href="http://llvm.org/docs/DebuggingJITedCode.html">http://llvm.org/docs/DebuggingJITedCode.html</a>, but found that the JITed function names are not shown in the stack backtrace. From the LLVM source codes, there is only a gdb register for ELF format in MCJIT, for MachO, the debugger register is {}. Do I need some compiler time or runtime configuration to make lldb debug Jitted code? </div>
<div style><br></div><div style>The discussion I could find in the mailing list was <a href="http://lists.cs.uiuc.edu/pipermail/lldb-dev/2010-December/000314.html">http://lists.cs.uiuc.edu/pipermail/lldb-dev/2010-December/000314.html</a>. The <span style="color:rgb(0,0,0);white-space:pre-wrap">interface in that patch looked like "</span><font color="#000000"><span style="white-space:pre-wrap">__jit_debug_register_code" provided from gdb, but that patch was not merged in master.</span></font></div>
<div style><br></div><div style>Thanks</div><div style>-Haitao</div></div>