[LLVMdev] [patch] Dwarf Debug info support for COFF object files

Nathan Jeffords blunted2night at gmail.com
Thu Feb 24 19:45:58 PST 2011


Thanks for taking the time to review this and get it into the mainline.

[snip]

This is because of
>
> @@ -1903,7 +1912,8 @@
>      addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_addr,
>               Asm->GetTempSymbol("section_line"));
>    else
> -    addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
> +    addSectionOffset(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_addr,
> +             Asm->GetTempSymbol("section_line"));
>
>    if (!Dir.empty())
>      addString(Die, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string, Dir);
>
>
> You probably wanted  to do...
>
> @@ -1904,8 +1913,8 @@
>    // DW_AT_stmt_list is a offset of line number information for this
>    // compile unit in debug_line section.
>    if (Asm->MAI->doesDwarfUsesAbsoluteLabelForStmtList())
> -    addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_addr,
> -             Asm->GetTempSymbol("section_line"));
> +    addSectionOffset(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_addr,
> +                     Asm->GetTempSymbol("section_line"));
>    else
>      addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
>
>

I am not sure about this, Looking at it now I don't understand what the
return value of doesDwarfUsesAbsoluteLabelForStmtList is supposed to mean. I
know that when I allowed the COFF's MCAsmInfo to use this line:

     addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);

I got a relocation that caused an absolute pointer to the debug_line section
instead of the offset from the beginning of the section. This looked like a
bug too me. To me it doesn't matter: I can
change DwarfUsesAbsoluteLabelForStmtList to true for MCAsmInfoCOFF and get
the correct behavior for COFF output.

[snip]

-Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110224/1b91218c/attachment.html>


More information about the llvm-dev mailing list