Re: [lldb-dev] reply: reply?? lldb debug jit-compiled code with llvm on windows
Problem solved. JIT debugging can be performed On the windows. thank you very much! -- The original message -- From: "Oleksiy Vyalov";<ovya...@google.com>; Data: 2015??12??3??AM 10:16 Receive: " "<haifen...@foxmail.com>; Cc: "Zachary Turner"<ztur...@google.com>; "lldb-dev"<lldb-dev@lists.llvm.org>; "Tamas Berghammer"<tbergham...@google.com>; Title: Re: [lldb-dev] reply: reply?? lldb debug jit-compiled code with llvm on windows Could you re-build lldb with http://reviews.llvm.org/D15172 and try to hit a breakpoint in jit code? I'm using following setup to compile and run JIT code: ./build_release/bin/clang -c -O0 -g -emit-llvm ./jit_test.cpp ./build_release/bin/lli -debugger-tune=lldb -jit-kind=mcjit ~/projects/lldb/test/jit_test.bc On Mon, Nov 30, 2015 at 3:47 AM, Tamas Berghammer via lldb-dev <lldb-dev@lists.llvm.org> wrote: On Mon, Nov 30, 2015 at 10:18 AM haifeng_q <haifen...@foxmail.com> wrote: Question 1: 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. LLDB command: lldb_result.txt JIT compilation results: debug_target.ll Question 2: How JIT debugging supported on Linux? I theory when a new function is JIT-ed then __jit_debug_register_code function is called where LLDB have a breakpoint set. When that breakpoint is hit then LLDB reads the JIT-ed elf file based on the information in __it_debug_descriptor and processes all debug info in it. In practice when I last tried JIT debugging with lldb and lli (few weeks ago) it get the notification for the new JIT-ed elf file but it processed only the eh_frame from it even though symtab and full debug info was also provided. Most likely there is some issue around the JIT breakpoint handling or around the elf file parsing code in LLDB what needs some investigation. thanks! -- The original message -- From: "Zachary Turner";<ztur...@google.com>; Data: 2015??11??21?? AM 0:10 Receive: "Tamas Berghammer"<tbergham...@google.com>; " "<haifen...@foxmail.com>; "lldb-dev"<lldb-dev@lists.llvm.org>; Title: Re: [lldb-dev] reply?? lldb debug jit-compiled code with llvm on windows Can you also try clang-cl and see if it works? On Fri, Nov 20, 2015 at 3:02 AM Tamas Berghammer via lldb-dev <lldb-dev@lists.llvm.org> wrote: 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. On Fri, Nov 20, 2015 at 8:56 AM haifeng_q <haifen...@foxmail.com> wrote: My analysis of the code, the reasons are: Since the debugging process is MSVC compiler, there is no DWARF debugging information. So lldb get __jit_debug_register_code and __it_debug_descriptor symbol debugging process fails, and __jit_debug_register_code not support MSVC. I do not know whether correct? -- original message-- From:"Tamas Berghammer";tbergham...@google.com; Date:2015??11??19?? PM 8:37 receive: " "<haifen...@foxmail.com>; "lldb-dev"<lldb-dev@lists.llvm.org>; Subject: Re: [lldb-dev] lldb debug jit-compiled code with llvm on windows 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. Tamas On Thu, Nov 19, 2015 at 8:40 AM haifeng_q via lldb-dev <lldb-dev@lists.llvm.org> wrote: hi, process A generate function Func1 code with llvm jit compiler, and calls Func1. modeled on "Kaleidoscope: Adding Debug Information" add debug information. how to use LLDB to attach process A to debug this function, add a breakpoint in the function? thanks! ___ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lld
[lldb-dev] reply: reply?? lldb debug jit-compiled code with llvm on windows
Question 1: 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. LLDB command: lldb_result.txt JIT compilation results: debug_target.ll Question 2: How JIT debugging supported on Linux? thanks! -- The original message -- From: "Zachary Turner";<ztur...@google.com>; Data: 2015??11??21?? AM 0:10 Receive: "Tamas Berghammer"<tbergham...@google.com>; " "<haifen...@foxmail.com>; "lldb-dev"<lldb-dev@lists.llvm.org>; Title: Re: [lldb-dev] reply?? lldb debug jit-compiled code with llvm on windows Can you also try clang-cl and see if it works? On Fri, Nov 20, 2015 at 3:02 AM Tamas Berghammer via lldb-dev <lldb-dev@lists.llvm.org> wrote: 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. On Fri, Nov 20, 2015 at 8:56 AM haifeng_q <haifen...@foxmail.com> wrote: My analysis of the code, the reasons are: Since the debugging process is MSVC compiler, there is no DWARF debugging information. So lldb get __jit_debug_register_code and __it_debug_descriptor symbol debugging process fails, and __jit_debug_register_code not support MSVC. I do not know whether correct? -- original message-- From:"Tamas Berghammer";tbergham...@google.com; Date:2015??11??19?? PM 8:37 receive: " "<haifen...@foxmail.com>; "lldb-dev"<lldb-dev@lists.llvm.org>; Subject: Re: [lldb-dev] lldb debug jit-compiled code with llvm on windows 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. Tamas On Thu, Nov 19, 2015 at 8:40 AM haifeng_q via lldb-dev <lldb-dev@lists.llvm.org> wrote: hi, process A generate function Func1 code with llvm jit compiler, and calls Func1. modeled on "Kaleidoscope: Adding Debug Information" add debug information. how to use LLDB to attach process A to debug this function, add a breakpoint in the function? thanks! ___ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev ___ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev debug_target.cpp Description: Binary data debug_target.ll Description: Binary data debug_target_process.cpp Description: Binary data lldb_result.txt Description: Binary data lldb_stack.txt Description: Binary data ___ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
[lldb-dev] reply?? lldb debug jit-compiled code with llvm on windows
My analysis of the code, the reasons are: Since the debugging process is MSVC compiler, there is no DWARF debugging information. So lldb get __jit_debug_register_code and __it_debug_descriptor symbol debugging process fails, and __jit_debug_register_code not support MSVC. I do not know whether correct? -- original message-- From:"Tamas Berghammer";tbergham...@google.com; Date:2015??11??19?? PM 8:37 receive: " "<haifen...@foxmail.com>; "lldb-dev"<lldb-dev@lists.llvm.org>; Subject: Re: [lldb-dev] lldb debug jit-compiled code with llvm on windows 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. Tamas On Thu, Nov 19, 2015 at 8:40 AM haifeng_q via lldb-dev <lldb-dev@lists.llvm.org> wrote: hi, process A generate function Func1 code with llvm jit compiler, and calls Func1. modeled on "Kaleidoscope: Adding Debug Information" add debug information. how to use LLDB to attach process A to debug this function, add a breakpoint in the function? thanks! ___ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev___ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev