<DIV><SPAN class=hps>Question 1:<BR>On the windows, I use the code implements a function (see debug_target.cpp) of JIT (see debug_target_process.cpp), but when generating debug information, no production .symtab section for information that leads LLDB get JIT debugging information .symtab failure , and then set a breakpoint to fail.</SPAN></DIV>
<DIV><SPAN class=hps> LLDB command: lldb_result.txt<BR> JIT compilation results: debug_target.ll</SPAN></DIV>
<DIV><SPAN class=hps></SPAN> </DIV>
<DIV><SPAN class=hps> Question 2:<BR> How JIT debugging supported on Linux?</SPAN></DIV>
<DIV><SPAN></SPAN> </DIV>
<DIV>
<DIV>thanks!<BR></DIV>
<DIV><BR></DIV>
<DIV style="FONT-SIZE: 12px; FONT-FAMILY: Arial Narrow; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px">------------------ <SPAN class=hps>The original message</SPAN> ------------------</DIV>
<DIV style="FONT-SIZE: 12px; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px">
<DIV><B>From:</B> "Zachary Turner";<zturner@google.com>;</DIV>
<DIV><B>Data:</B> 2015年11月21日 AM 0:10</DIV>
<DIV><B>Receive:</B> "Tamas Berghammer"<tberghammer@google.com>; " "<haifeng_q@foxmail.com>; "lldb-dev"<lldb-dev@lists.llvm.org>; <WBR></DIV>
<DIV></DIV>
<DIV><B>Title:</B> Re: [lldb-dev] reply: lldb debug jit-compiled code with llvm on windows</DIV></DIV>
<DIV><BR></DIV>
<DIV dir=ltr>Can you also try clang-cl and see if it works?</DIV><BR>
<DIV class=gmail_quote>
<DIV dir=ltr>On Fri, Nov 20, 2015 at 3:02 AM Tamas Berghammer via lldb-dev <<A href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</A>> wrote:<BR></DIV>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex">
<DIV dir=ltr>I don't know how JIT debugging should work on WIndows with MSVC but I don't think LLDB support it in any way. What I wrote should be true on Linux (and on some related) systems. You might be able to get the same results on Windows if you use lli (LLVM based JIT runner) but I have no knowledge if it will work or not.</DIV><BR>
<DIV class=gmail_quote>
<DIV dir=ltr>On Fri, Nov 20, 2015 at 8:56 AM haifeng_q <<A href="mailto:haifeng_q@foxmail.com" target=_blank>haifeng_q@foxmail.com</A>> wrote:<BR></DIV>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex">
<DIV>My analysis of the code, the reasons are:</DIV>
<DIV> </DIV>
<DIV>
<DIV><SPAN>Since the</SPAN> <SPAN>debugging process</SPAN> <SPAN>is</SPAN> <SPAN>MSVC</SPAN> <SPAN>compiler</SPAN><SPAN>,</SPAN> there is <SPAN>no</SPAN> <SPAN>DWARF</SPAN> <SPAN>debugging information. So</SPAN> <SPAN>lldb</SPAN> <SPAN>get</SPAN> <SPAN>__jit_debug_register_code</SPAN> <SPAN>and</SPAN> <SPAN>__it_debug_descriptor</SPAN> <SPAN>symbol</SPAN> <SPAN>debugging process</SPAN> <SPAN>fails</SPAN><SPAN>,</SPAN> <SPAN>and</SPAN> <SPAN>__jit_debug_register_code</SPAN> <SPAN>not</SPAN> <SPAN>support</SPAN> <SPAN>MSVC.</SPAN><BR></DIV>
<DIV>I do not know whether correct?</DIV>
<DIV><BR></DIV>
<DIV style="FONT-SIZE: 12px; FONT-FAMILY: Arial Narrow; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px">------------------ <SPAN style="BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; WHITE-SPACE: normal; BORDER-BOTTOM-WIDTH: 0px; WORD-SPACING: 0px; TEXT-TRANSFORM: none; COLOR: rgb(67,67,67); OUTLINE-WIDTH: 0px; PADDING-BOTTOM: 0px; TEXT-ALIGN: left; PADDING-TOP: 0px; FONT: 12px/24px Tahoma,Arial; OUTLINE-STYLE: none; PADDING-LEFT: 0px; MARGIN: 0px; LETTER-SPACING: normal; OUTLINE-COLOR: invert; PADDING-RIGHT: 0px; BORDER-TOP-WIDTH: 0px; BACKGROUND-COLOR: rgb(242,242,242); TEXT-INDENT: 0px">original</SPAN><SPAN style="WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FLOAT: none; COLOR: rgb(67,67,67); TEXT-ALIGN: left; FONT: 12px/24px Tahoma,Arial; DISPLAY: inline !important; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(242,242,242); TEXT-INDENT: 0px"><SPAN> </SPAN></SPAN><SPAN style="BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; WHITE-SPACE: normal; BORDER-BOTTOM-WIDTH: 0px; WORD-SPACING: 0px; TEXT-TRANSFORM: none; COLOR: rgb(67,67,67); OUTLINE-WIDTH: 0px; PADDING-BOTTOM: 0px; TEXT-ALIGN: left; PADDING-TOP: 0px; FONT: 12px/24px Tahoma,Arial; OUTLINE-STYLE: none; PADDING-LEFT: 0px; MARGIN: 0px; LETTER-SPACING: normal; OUTLINE-COLOR: invert; PADDING-RIGHT: 0px; BORDER-TOP-WIDTH: 0px; BACKGROUND-COLOR: rgb(242,242,242); TEXT-INDENT: 0px">message</SPAN>------------------</DIV>
<DIV style="FONT-SIZE: 12px; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px">
<DIV><B>From:</B>"Tamas Berghammer";<A href="mailto:tberghammer@google.com" target=_blank>tberghammer@google.com</A>;</DIV>
<DIV>Date<STRONG>:</STRONG>2015年11月19日 PM 8:37</DIV>
<DIV><B>receive:</B> " "<<A href="mailto:haifeng_q@foxmail.com" target=_blank>haifeng_q@foxmail.com</A>>; "lldb-dev"<<A href="mailto:lldb-dev@lists.llvm.org" target=_blank>lldb-dev@lists.llvm.org</A>>; </DIV>
<DIV></DIV>
<DIV><B>Subject:</B> Re: [lldb-dev] lldb debug jit-compiled code with llvm on windows</DIV></DIV>
<DIV><BR></DIV>
<DIV dir=ltr>In theory you don't have to do anything special to debug some JIT-ed code as everything should just work (based on the gdb jit interface). In practice I tried it out a few days ago and it wasn't working at all even in the case when the application is launched under LLDB (not with attach). LLDB was understanding the eh_frame for the JIT-ed code but didn't found the debug info for unknown reason. We should investigate it and try to fix it sometime. We (lldb for android developers) plan to do it sometime but if you are interested in it then please feel free to take a look and let us know if you have any question. 
<DIV><BR></DIV>
<DIV>Tamas</DIV></DIV><BR>
<DIV class=gmail_quote>
<DIV dir=ltr>On Thu, Nov 19, 2015 at 8:40 AM haifeng_q via lldb-dev <<A href="mailto:lldb-dev@lists.llvm.org" target=_blank>lldb-dev@lists.llvm.org</A>> wrote:<BR></DIV>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex">
<DIV><SPAN>hi,</SPAN></DIV>
<DIV><SPAN>process <SPAN>A</SPAN> </SPAN><SPAN>generate</SPAN> function Func1 code with llvm jit compiler<SPAN>,</SPAN> <SPAN>and</SPAN> <SPAN>calls </SPAN><SPAN>Func1</SPAN><SPAN>. modeled on</SPAN> <SPAN>"Kaleidoscope: Adding Debug Information"</SPAN> <SPAN>add</SPAN> <SPAN>debug information</SPAN><SPAN>. how</SPAN> <SPAN>to use</SPAN> <SPAN>LLDB</SPAN> to attach process <SPAN>A</SPAN> to <SPAN>debug this</SPAN> <SPAN>function</SPAN><SPAN>,</SPAN> <SPAN>add a breakpoint in the function?</SPAN></DIV>
<DIV><SPAN></SPAN> </DIV>
<DIV><SPAN>thanks!</SPAN></DIV>_______________________________________________<BR>lldb-dev mailing list<BR><A href="mailto:lldb-dev@lists.llvm.org" target=_blank>lldb-dev@lists.llvm.org</A><BR><A href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel=noreferrer target=_blank>http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</A><BR></BLOCKQUOTE></DIV>
<DIV></DIV></DIV></BLOCKQUOTE></DIV>_______________________________________________<BR>lldb-dev mailing list<BR><A href="mailto:lldb-dev@lists.llvm.org" target=_blank>lldb-dev@lists.llvm.org</A><BR><A href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel=noreferrer target=_blank>http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</A><BR></BLOCKQUOTE></DIV>
<DIV></DIV></DIV>