<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 21, 2013 at 11:55 AM, Ed Maste <span dir="ltr"><<a href="mailto:emaste@freebsd.org" target="_blank">emaste@freebsd.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  I compiled the existing dwarfdump-inl-test.cc for FreeBSD mips64:<br>
<br>
  % g++ --version<br>
  g++ (GCC) 4.2.1 20070831 patched [FreeBSD]<br>
  Copyright (C) 2007 Free Software Foundation, Inc.<br>
  This is free software; see the source for copying conditions.  There is NO<br>
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br>
  % g++ -g dwarfdump-inl-test.cc -o dwarfdump-inl-test.freebsd-elf-mips64<br>
<br>
  current state:<br>
  ```<br>
  % bin/llvm-dwarfdump --debug-dump=line dwarfdump-inl-test.freebsd-elf-mips64<br>
  dwarfdump-inl-test.freebsd-elf-mips64:  file format ELF64-unknown<br>
<br>
<br>
  .debug_line contents:<br>
  %<br>
  ```<br>
  with this patch:<br>
  ```<br>
  % bin/llvm-dwarfdump --debug-dump=line dwarfdump-inl-test.freebsd-elf-mips64<br>
  dwarfdump-inl-test.freebsd-elf-mips64:  file format ELF64-unknown<br>
<br>
<br>
  .debug_line contents:<br>
  Line table prologue:<br>
     total_length: 0x00000212<br>
          version: 2<br>
  prologue_length: 0x000001ab<br>
  min_inst_length: 1<br>
  default_is_stmt: 1<br>
        line_base: -5<br>
       line_range: 14<br>
      opcode_base: 13<br>
  ...<br>
  ```<br>
<br>
  this only outputs the first CompileUnit though, perhaps because the parsing fails in another section in DWARFContext::parseCompileUnits().  Is it reasonable to add this dwarfdump-inl-test.freebsd-elf-mips64 binary and a basic test, fleshing it out when DWARF64 parsing for other sections is added?<br>
</blockquote><div><br></div><div>One option might be to take the assembly and hand-hack it (in the simplest case, just removing the sections dwarfdump doesn't support at the moment?) <br><br>But really it doesn't matter too much if there's buggy behavior in other sections - assuming it was buggy without your patch, this is nothing new. The test case only needs to test (using FileCheck to verify the parts of the file you expect your patch to make correct) the intentional functionality that we intend to be correct with this patch - it can silently ignore other parts (or you can put comments in and checks that test for the broken behavior, so the test will fail when the bugs are fixed and the test case can be updated to test the correct behavior).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
  (the test file is 15638 bytes -- larger than the clang-compiled version, due to the lack of -gline-tables-only)<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1988" target="_blank">http://llvm-reviews.chandlerc.com/D1988</a><br>
</blockquote></div><br></div></div>