[LLVMdev] Dwarf debugging strangeness, continued...

Devang Patel dpatel at apple.com
Thu Oct 21 13:39:57 PDT 2010


On Oct 21, 2010, at 12:43 PM, Talin wrote:

> On Thu, Oct 21, 2010 at 8:56 AM, Devang Patel <dpatel at apple.com> wrote:
> 
> On Oct 20, 2010, at 10:49 PM, Talin wrote:
> 
>> First, there are a bunch of .bc files that are generated by my frontend, and which contain debugging metadata (I checked using llvm-dis and the metadata appears to be OK). These are then combined by my linker, tartln, which combines the functions of 'opt' and 'llc', as well as having some custom passes for reflection and garbage collection. (In fact, about half of the source code for tartln was lifted directly from opt and llc, although this cut & paste operation occurred somewhere around the 2.5 timeframe, and I've tried to keep the code up to date since then.)
>> The output of this compilation phase is a .o file.
> 
> If you can send me couple of small .bc files and linked .o file (mach-O) created using tartln then I'll try to see if I can find anything suspicious here. 
> 
> OK I'll work on that when I get home. It may take a while to come up with a "small" .bc file, since even a "hello world" type program pulls in a substantial amount of library code (i/o libraries, container classes, root-level exception handling, argv handling, garbage collection runtime code, and so on.)
> 
> It may be something as simple as me doing something stupid in my build script, (although I did remember to use -fno-omit-framepointer).
> 
> I suppose I should mention one odd thing about my current build script: the current optimization level is -O2.

That's big. Debugging optimized code is completely a new chapter.

> I can't use -O0, this causes an assertion failure in the lowering pass for LLVM intrinsics. The problem has to do with inlining and llvm.gcroot(). My frontend insures that all calls to llvm.gcroot() are in the first block of a function, but the inlining pass does not preserve this constraint - which causes the assertion failure. For some reason optimization makes this problem go away.

You may want to press on this and find a solution.

One thing you can try to rule out any link stage bug is -- take your .bc file and generate separate .o file for each .bc file using clang and see if dwarfdump finds any debug info in .o files or not. If it does, then tartln is dropping debug info on the floor somewhere. 

-
Devang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101021/c46547ec/attachment.html>


More information about the llvm-dev mailing list