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

Eric Christopher echristo at gmail.com
Wed Jun 19 10:06:03 PDT 2013


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?
>

This should be fine though curious if you've run the gdb testsuite before/after?

Or at least pay attention to those bots and we'll work on getting any
fallout fixed. :)

Thanks!

-eric



More information about the llvm-commits mailing list