<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Feb 21, 2017 at 10:59 AM Robinson, Paul <<a href="mailto:paul.robinson@sony.com">paul.robinson@sony.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_3637410255609823232WordSection1 gmail_msg">
<p class="MsoNormal gmail_msg" style="margin-left:.5in">aprantl wrote:<br class="gmail_msg">
> This should probably be tested by a llvm-dwarfdump test?<br class="gmail_msg">
Are there llvm-dwarfdump tests?<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
<p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p>
<p class="MsoNormal gmail_msg" style="margin-left:.5in">There are some - using checked in binary/object files.<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
<p class="MsoNormal gmail_msg"> <u class="gmail_msg"></u><u class="gmail_msg"></u></p>
<p class="MsoNormal gmail_msg" style="margin-left:.5in">  I couldn't find any.  There is a test/tools/llvm-dwarfdump directory (with AArch64 and ARM subdirectories) but not actual files.<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
<p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p>
<p class="MsoNormal gmail_msg" style="margin-left:.5in">There are some in test/DebugInfo/dwarfdump* I think.<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
<p class="MsoNormal gmail_msg"> <u class="gmail_msg"></u><u class="gmail_msg"></u></p>
</div></div><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_3637410255609823232WordSection1 gmail_msg"><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg">okay….  I can see an argument for having them there, as it's really the DebugInfo library and llvm-dwarfdump is basically just a frontend for the library. 
 If that's where people want them, okay.<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg">Checked-in binaries seems like overkill in some cases.  For .debug_info stuff I'd be more inclined to start with assembler source, run llvm-mc, and dump the
 result.  Can't do that for things the assembler actually produces, like line tables, but for a lot of things it would be easier to deal with.<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p></div></div><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_3637410255609823232WordSection1 gmail_msg">
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg" style="margin-left:.5in"><a name="m_3637410255609823232__MailEndCompose" class="gmail_msg">This code was needed because there are a couple of debug-info tests that specify version 5 in the IR, and then use llvm-dwarfdump in their RUN lines.  Having done this change, I had to
 fix the unit-test DWARF generator because the unit tests were failing.<u class="gmail_msg"></u><u class="gmail_msg"></u></a></p>
<p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p>
<p class="MsoNormal gmail_msg" style="margin-left:5.35pt">What was it that caused breakage in the DwarfGenerator once llvm-dwarfdump had v5 support?<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></span></p>
</div></div><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_3637410255609823232WordSection1 gmail_msg"><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg">Some of the unit tests (I think these are ones that Greg Clayton added relatively recently) are designed to run on both v4 and v5. </span></p></div></div></blockquote><div><br></div><div>Oh, right, now I remember those going in when someone wanted a DWARF5 attribute. Thanks for the reminder!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_3637410255609823232WordSection1 gmail_msg"><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg"> Once the DebugInfo APIs
 started treating the v5 header differently, the unit tests broke for v5 because the generator emitted a v4-format header with version=5.  This meant the generator put the abbrev table pointer at offset 6 in the header, but DebugInfo was looking for it at offset
 8.  With a bogus abbrev table pointer, the DIEs didn't decode as expected, and the tests failed. So I fixed the generator to emit the correct v5 format.<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" class="gmail_msg">--paulr<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt" class="gmail_msg">
<div class="gmail_msg">
<div class="gmail_msg">
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in" class="gmail_msg">
<p class="MsoNormal gmail_msg" style="margin-bottom:12.0pt"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>

</blockquote></div></div>