[LLVMdev] No DWARF line number info with HasDotLocAndDotFile = true

Devang Patel devang.patel at gmail.com
Wed Oct 21 10:26:15 PDT 2009


Hi Richard,

On Tue, Oct 20, 2009 at 9:52 AM, Richard Osborne <richard at xmos.com> wrote:
> Richard Osborne wrote:
>> It seems to me that emitting DWARF line number information using .loc
>> directives is currently broken. CellSPU is currently the only in tree
>> target that sets HasDotLocAndDotFile in its MCAsmInfo and I can't get it
>> to produce any line number information.
>>
> I think I understand why this is happening. Since HasDotLocAndDotFile is
> set the DwarfDebug class doesn't emit the line number table as a series
> of bytes:
>
>  // If the target is using .loc/.file, the assembler will be emitting the
>  // .debug_line table automatically.
>  if (MAI->hasDotLocAndDotFile())
>    return;
>
> Previously .loc directives are printed by selecting ISD::DEBUG_LOC nodes
> to pseudo instructions which print as the directive. For example:
>
> def DWARF_LOC : Pseudo<(outs), (ins i32imm:$line, i32imm:$col,
> i32imm:$file),
>           ".loc $file, $line, $col",
>           [(dwarf_loc (i32 imm:$line), (i32 imm:$col), (i32 imm:$file))]>;
>
> ISD::DEBUG_LOC nodes are produced when debug stoppoints are expanded.
> However debug stoppoints are no longer produced by the frontend since
> debug info is now encoded using metadata. Therefore there are no .loc
> directives in the output and no line number information.
>
> It looks like AsmPrinter::processDebugLoc function should be updated to
> check whether HasDotLocAndDotFile is set and if it is emit the .loc
> directive.
>
> Does this make sense?

Yes, it makes sense to emit .loc in processDebugLoc if the DebugLoc has changed.

>
> --
> Richard Osborne | XMOS
> http://www.xmos.com
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 
-
Devang




More information about the llvm-dev mailing list