[LLVMdev] How to get an LLVM-compiled executable which could be debugged using gdb

Jim Grosbach grosbach at apple.com
Tue Jun 14 08:59:41 PDT 2011


You're looking to use the wrong tool. LLC isn't where the debug info is from. The debug information is created by the front end, as Duncan pointed out. LLC will propagate that information but will not create it if it's not already there. The debug information is compatible with GDB. Usage is just as with gcc or any other compiler; add the "-g" flag.

For example,

$ clang -g myfile.c -o myfile
$ gdb myfile


-Jim


On Jun 14, 2011, at 2:32 AM, Qingan Li wrote:

> I am sorry for my poor statement of my problem.
> Yes, $)G]sStG6 is right. 
> I want to know whether llvm could emit debugging information which GDB could use directly. Ex, how does the executable file generated from llc  could be debug using gdb?
> A simple demonstration is greatly appreciated. 
> 2011/6/14 $)G]sStG6 <chenwj at iis.sinica.edu.tw>
> > 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
> 
>  I guess he want to ask if llc can emit debugging information which GDB
> can use.
> 
> Regards,
> chenwj
> 
> --
> Wei-Ren Chen ($)G]sStG6)
> Computer Systems Lab, Institute of Information Science,
> Academia Sinica, Taiwan (R.O.C.)
> Tel:886-2-2788-3799 #1667
> 
> 
> 
> -- 
> Best regards,
> 
> Li Qingan
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list