Artur Pietrek
2010-Jun-29 16:02 UTC
[LLVMdev] [patch] DwarfDebug problem with line section
Hi all, While implementing debug info for our backend, we've noticed a problem with debug_line section. We believe that the following code is wrong: // DW_AT_stmt_list is a offset of line number information for this // compile unit in debug_line section. It is always zero when only one // compile unit is emitted in one object file. addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0); After compiling several files and linking them together (not only using our backend, but also x86) debug information was incorrect. I'm not 100% sure if this fix is correct, but patch attached. Artur -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100629/80c941e9/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: section_line_debug.patch Type: text/x-patch Size: 1275 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100629/80c941e9/attachment.bin>
DW_AT_stmt_list attribute's value is a section offset to the line no info for current compilation unit. If there is only one compilation unit generated per .o file then it is always zero. What kind of errors are you seeing ? - Devang On Tue, Jun 29, 2010 at 9:02 AM, Artur Pietrek <pietreka at gmail.com> wrote:> Hi all, > While implementing debug info for our backend, we've noticed a problem with > debug_line section. We believe that the following code is wrong: > // DW_AT_stmt_list is a offset of line number information for this > // compile unit in debug_line section. It is always zero when only one > // compile unit is emitted in one object file. > addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0); > After compiling several files and linking them together (not only using our > backend, but also x86) debug information was incorrect. > I'm not 100% sure if this fix is correct, but patch attached. > Artur > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-- - Devang
I updated DwarfDebug to use section offset, instead of hard coding 0, to handle LTO properly. r107202. Thanks for brining this up. - Devang On Tue, Jun 29, 2010 at 11:27 AM, Devang Patel <devang.patel at gmail.com> wrote:> DW_AT_stmt_list attribute's value is a section offset to the line no > info for current compilation unit. If there is only one compilation > unit generated per .o file then it is always zero. What kind of errors > are you seeing ? > > - > Devang > > On Tue, Jun 29, 2010 at 9:02 AM, Artur Pietrek <pietreka at gmail.com> wrote: >> Hi all, >> While implementing debug info for our backend, we've noticed a problem with >> debug_line section. We believe that the following code is wrong: >> // DW_AT_stmt_list is a offset of line number information for this >> // compile unit in debug_line section. It is always zero when only one >> // compile unit is emitted in one object file. >> addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0); >> After compiling several files and linking them together (not only using our >> backend, but also x86) debug information was incorrect. >> I'm not 100% sure if this fix is correct, but patch attached. >> Artur >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > > > > -- > - > Devang >-- - Devang
Maybe Matching Threads
- [LLVMdev] [patch] DwarfDebug problem with line section
- [LLVMdev] [patch] DwarfDebug problem with line section
- [LLVMdev] [patch] DwarfDebug problem with line section
- [LLVMdev] [patch] Dwarf Debug info support for COFF object files
- [LLVMdev] [patch] DwarfDebug problem with line section