[LLVMdev] RFC: debug_line Emission

Evan Cheng evan.cheng at apple.com
Fri Jul 18 10:45:09 PDT 2008


On Jul 17, 2008, at 3:33 PM, Bill Wendling wrote:

> In CodeGen/DwarfWriter.cpp's EmitDebugLine file, these lines are
> causing havoc on Mac OS X systems:
>
>    // If there are no lines to emit (such as when we're using .loc
> directives
>    // to emit .debug_line information) don't emit a .debug_line
> header.
>    if (SectionSourceLines.empty())
>      return;

The fix is to move the early exist to just below this line:  
EmitLabel("line_prolog_end", 0), right?


>
>
> Basically, if there's a file with only data in it, we still need the
> debug_line prologue generated.

Right.

>
> By removing the "early exit" from EmitDebugLine, I got LLVM to
> generate this data. However, Dan pointed out that assemblers that use
> the ".loc" directive can't have their debug_line generated by the
> compiler. My suggestion was to have a flag that indicated that ".loc"

I am not sure I understand this statement?

Evan

>
> was used. If it was, then we would exit out of the EmitDebugLine
> method early. Something like so:
>
>
>    // If there are no lines to emit (such as when we're using .loc
> directives
>    // to emit .debug_line information) don't emit a .debug_line
> header.
>    if (LocDirectiveUsed())
>      return;
>
> Dan wasn't sure if this would work in all cases. We don't have a Linux
> box to test this on. Does this sound like a good idea? Those who work
> with Linux or other OSes, would this idea break things for you?
>
> -bw
> _______________________________________________
> 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