[LLVMdev] Generating DWARF info

Devang Patel dpatel at apple.com
Tue Mar 10 10:15:46 PDT 2009


On Mar 9, 2009, at 8:07 PM, Kyle Jessup wrote:

> I'm using llvm-2.5 on OS X 10.5 and having a problem getting debug
> info from my compiler into a resulting executable.
> My code flow is:
> 	LLVM API -> Assembly file .s -> gcc to .dylib
>
> I'm using DIFactory to generate the debug info, and my usage seems to
> match what clang's CGDebugInfo would do. In my resulting assembly
> file, I see the DWARF sections with apparently valid data:
>
> .section __DWARF,__debug_info,regular,debug
> etc.
>
> As soon as I send my assembly to gcc it disappears. I can call 'as'
> directly as gcc does, and at this point the debug info disappears:
>
> as -g -arch i386 -force_cpusubtype_ALL -o random.o random.s
>
> Am I missing a step or not doing something properly to keep my debug
> info preserved?

Try without adding -g on as command line.

If you're using gcc or llvm-gcc driver to assembler your .s file then  
it is likely that the driver is invoking dsymutil to extract debug  
info out of .o file and create .dSYM.

Otherwise, without complete reproducible test case it is hard to guess.
-
Devang
>
>
> Any tips or pointers would be appreciated!
> Thanks,
> Kyle
> _______________________________________________
> 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