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 ------------------

Receive: "Tamas Berghammer"tberghammer@google.com; " "haifeng_q@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?

debug_target.cpp (143 Bytes)

debug_target.ll (2.03 KB)

debug_target_process.cpp (12.1 KB)

lldb_result.txt (6.46 KB)

lldb_stack.txt (1.15 KB)

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.

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

Problem solved. JIT debugging can be performed On the windows.

thank you very much!

------------------ The original message ------------------

Receive: " "haifeng_q@foxmail.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