Qingan Li
2011-Jun-14 07:55 UTC
[LLVMdev] How to get an LLVM-compiled executable which could be debugged using gdb
Hi, I need a simple demonstration of compiling a program into a executable which could be debugged using gdb. After looking up the llc.cpp, llvm-ld.cpp, I found that llvm only generated the assemble code, and left the other work to gnu as and gnu ld. Since the information from LLVM into gnu as and gnu ld is limited by the assemble file, I am confusing with how to transfer the debug information to gnu as and gnu ld. Could any one help me? -- Best regards, Li Qingan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110614/97f6a790/attachment.html>
Csaba Raduly
2011-Jun-14 08:41 UTC
[LLVMdev] How to get an LLVM-compiled executable which could be debugged using gdb
Hi, On Tue, Jun 14, 2011 at 10:55 AM, Qingan Li wrote:> Hi,...> Since the information from LLVM into gnu as and gnu ld is limited by the > assemble file, I am confusing with how to transfer the debug information to > gnu as and gnu ld. > Could any one help me?Debug information can be placed in the assembler source. This is what GCC does; you can see for yourself if you run gcc -g -save-temps filename.c Csaba -- GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++ The Tao of math: The numbers you can count are not the real numbers. Life is complex, with real and imaginary parts. "Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds "People disagree with me. I just ignore them." -- Linus Torvalds
陳韋任
2011-Jun-14 08:50 UTC
[LLVMdev] How to get an LLVM-compiled executable which could be debugged using gdb
> Debug information can be placed in the assembler source. This is what > GCC does; you can see for yourself if you run > gcc -g -save-temps filename.cI guess he want to ask if llc can emit debugging information which GDB can use. Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667
Duncan Sands
2011-Jun-14 08:52 UTC
[LLVMdev] How to get an LLVM-compiled executable which could be debugged using gdb
Hi Li Qingan,> I need a simple demonstration of compiling a program into a executable which > could be debugged using gdb. > After looking up the llc.cpp, llvm-ld.cpp, I found that llvm only generated the > assemble code, and left the other work to gnu as and gnu ld. > Since the information from LLVM into gnu as and gnu ld is limited by the > assemble file, I am confusing with how to transfer the debug information to gnu > as and gnu ld. > Could any one help me?I didn't really understand what you are asking. If you are compiling using clang, llvm-gcc or dragonegg then add the -g argument to the command line to get debug info in the final program, exactly like when compiling with gcc. Ciao, Duncan.
Seemingly Similar Threads
- [LLVMdev] How to get an LLVM-compiled executable which could be debugged using gdb
- [LLVMdev] How to get an LLVM-compiled executable which could be debugged using gdb
- [LLVMdev] How to get an LLVM-compiled executable which could be debugged using gdb
- [LLVMdev] Update PTX section in CodeGenerator.html
- [LLVMdev] a problem of jit debug