<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 28, 2016, at 4:57 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">+Adrian for Apple/LLDB perspective<br class=""><br class="">One way to merge the tests would be to add another command line argument into DwarfDebug (see the way the split-dwarf command line argument is used), just for testing purposes. The command line argument can override the value specified in the metadata - so you can have one input file for the 3 different versions.<br class=""></div></div></blockquote><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Jan 28, 2016 at 4:28 PM, Katya Romanova via cfe-commits <span dir="ltr" class=""><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">kromanova created this revision.<br class="">
kromanova added reviewers: dblaikie, echristo, probinson.<br class="">
kromanova added a subscriber: cfe-commits.<br class="">
kromanova set the repository for this revision to rL LLVM.<br class="">
<br class="">
Hello,<br class="">
The compiler always emits .debug_line version 2, though some opcodes from DWARF 3 (e.g. DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin or DW_LNS_set_isa) and from DWARF 4 could be emitted by the compiler. That's not exactly right.<br class="">
<br class="">
This patch changes version information of .debug_line to exactly match the DWARF version (which is 4 by default).<br class="">
For .debug_line version 4, a new field maximum_operations_per_instruction is emitted. I'm not exactly sure how to set this field correctly for VLIW architectures. Hopefully, there are some experts in the community that could help out (any Hexagon debuginfo developers out there?).</blockquote></div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
I’ve tried a few tools to check if they could handle .debug_line version 4.<br class="">
On a simple testcase, I verified that GDB debugger 7.7 understands .debug_line version 4.<br class="">
Sony’s proprietary debugger can understand it too.<br class="">
I don't have LLDB built, so I haven’t tried it.</blockquote></div></div></div></blockquote><div><br class=""></div>There is now a public bot that runs the LLDB testsuite on Darwin (<a href="http://lab.llvm.org:8080/green/job/LLDB/" class="">http://lab.llvm.org:8080/green/job/LLDB/</a>) so you’ll find out immediately :-)</div><div>LLDB can be fixed, I’m not too worried about it.</div><div><br class=""></div><div>There are, however, also DWARF consumers that are not debuggers that will read the line table, such as CoreSymbolication (atos(1)). I’ll investigate whether it can digest the newer version and follow up here.</div><div>If it doesn’t it would be best to either make this a separate option or to special-case Darwin.</div><div><br class=""></div><div>-- adrian<br class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
GCC (older version 4.8.2) still emits version 2 for the .debug_line section, even though the DWARF version is set to 4. I'm not sure about the latest GCC.<br class="">
GNU's readelf (version 2.24) can handle .debug_line version 4.<br class="">
<br class="">
I added 3 new tests debug-line-version2.ll, debug-line-version3.ll and debug-line-version4.ll. The IR is generated from one source using different options (-gdwarf-2, -gdwarf-3 and –gdwarf-4). Any idea how to merge these three tests into one?<br class="">
<br class="">
Let me know what do you think about the patch.<br class="">
<br class="">
<br class="">
Repository:<br class="">
  rL LLVM<br class="">
<br class="">
<a href="http://reviews.llvm.org/D16697" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D16697</a><br class="">
<br class="">
Files:<br class="">
  lib/MC/MCDwarf.cpp<br class="">
  test/DebugInfo/AArch64/line-header.ll<br class="">
  test/DebugInfo/Generic/debug-line-version2.ll<br class="">
  test/DebugInfo/Generic/debug-line-version3.ll<br class="">
  test/DebugInfo/Generic/debug-line-version4.ll<br class="">
  test/DebugInfo/Generic/empty.ll<br class="">
  test/DebugInfo/X86/empty.ll<br class="">
  test/DebugInfo/X86/stmt-list-multiple-compile-units.ll<br class="">
  test/MC/ELF/debug-line.s<br class="">
  test/MC/ELF/debug-line2.s<br class="">
  test/MC/ELF/debug-loc.s<br class="">
  test/MC/ELF/discriminator.s<br class="">
  test/MC/ELF/empty-dwarf-lines.s<br class="">
  test/MC/MachO/file.s<br class="">
  test/MC/MachO/gen-dwarf.s<br class="">
  test/MC/MachO/loc.s<br class="">
<br class="">
<br class="">_______________________________________________<br class="">
cfe-commits mailing list<br class="">
<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>