[MC/DWARF] Generate multiple .debug_line entries for adjacent .loc directives

David Blaikie dblaikie at gmail.com
Fri Jun 7 10:23:42 PDT 2013


+Eric

I'm not too familiar with these kinds of low level details of binary
formats, so I'll leave him (or others) to comment.

On Fri, Jun 7, 2013 at 10:10 AM, Ulrich Weigand
<Ulrich.Weigand at de.ibm.com> wrote:
>
> Hello,
>
> The compiler occasionally generates multiple .loc directives in a row
> (at the same instruction address).  These need to be transformed into
> multple actual .debug_line table entries, since they are used to signal
> certain information to the debugger (e.g. if the opening brace of a
> function body is on the same line as the declaration).
>
> The MCAsmStreamer version of EmitDwarfLocDirective handles this
> correctly by emitting a .loc directive every time it is called.
> However, the MCObjectStream version simply defaults to recording
> the information and emitting only a single table entry later,
> e.g. when EmitInstruction is called.
>
> This patch introduces a MCAsmStreamer::EmitDwarfLocDirective
> version that emits a line table entry for a .loc directive
> that may already be pending before recording the new directive.
> (This is similar to how this is handled in GNU as.)
>
> With this patch (and the code alignment factor patch) applied,
> I'm now getting identical DEBUG .debug sections for all test-suite
> object files on PowerPC for the internal and the external assembler.
>
> Does this look OK?
>
> Thanks,
> Ulrich
> (See attached file: diff-llvm-mc-doubleloc)
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list