<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Mar 29, 2018 at 8:27 AM <<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">
<div class="m_5985999377823968226WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">To pass the MD5 checksum to the assembler, I added a new optional clause to the .file directive:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">md5 "checksum"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">where checksum is the 16-byte checksum in hex.  It's quoted because the assembler doesn't have a way to parse a 16-byte integer.</span></p></div></div></blockquote><div><br>I'd guess, long-term, that's probably not a great motivation for choosing pseudo-standardized syntax.<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"><div class="m_5985999377823968226WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">  Also this is the same syntax
 Reid invented for the CodeView equivalent.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">To convey the root source filename, I allow the file number on the .file directive to have file number 0.  There is special handling in the AsmParser to allow
 accepting ".file 0" when we're not actually emitting DWARF 5, the root source file is kept in a separate field and not in the normal file table.  If MC does emit a v5 .debug_line section, then it dumps that file entry first before the rest of the file table.</span></p></div></div></blockquote><div><br>So .file 0 is accepted and ignored pre-5? & that's to support some weird/old assembly?<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"><div class="m_5985999377823968226WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> </span><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt">I've addressed the latest can't-build-Linux revert of my patch by suppressing both the md5 clause and '.file 0' for pre-v5.  That way the feature is there for
 people experimenting with v5, but should not interfere with anybody else.  I'll commit that later this morning.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Regarding the discussion, it might be that dwarf-discuss is a better venue, because GCC people will be on that list who care about DWARF.  Let me know what
 you think.</span></p></div></div></blockquote><div><br>Yeah, I'm guessing that might be useful - could see how this conversation goes for a little bit.<br><br>- Dave<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"><div class="m_5985999377823968226WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--paulr<u></u><u></u></span></p>
<p class="MsoNormal"><a name="m_5985999377823968226__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></a></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> David Blaikie [mailto:<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>]
<br>
<b>Sent:</b> Thursday, March 29, 2018 10:59 AM<br>
<b>To:</b> Robinson, Paul; Eric Christopher; Adrian Prantl; Jonas Devlieghere<br>
<b>Cc:</b> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<b>Subject:</b> Re: [llvm-dev] [DWARFv5] Assembler syntax for new line-table features<u></u><u></u></span></p>
</div>
</div></div></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_5985999377823968226WordSection1"><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><a href="mailto:echristo@gmail.com" target="_blank">+Eric Christopher</a>  <a href="mailto:aprantl@apple.com" id="m_5985999377823968226IloFPc-1" target="_blank">+Adrian Prantl</a> <a href="mailto:jdevlieghere@apple.com" id="m_5985999377823968226IloFPc-2" target="_blank">+Jonas Devlieghere</a> (seems
 Jonas is doing a bunch of debug info work - guessing he's working with you, Adrian?)<br>
<br>
I'm guessing Eric's the most likely to have contacts over in GCC land to maybe bridge the gap when talking about assembly syntax across the two. Eric - any ideas how best to negotiate this pseudo-standard? (there's another feature or two I'd like to propose
 too - at least to standardize what the syntax /should/ be, even if gas doesn't support it immediately)<br>
<br>
Paul - perhaps a brief description of the proposed syntax would be helpful to get the ball rolling (even if it's just discussing it amongst ourselves before it ends up in a cross-project discussion).<br>
<br>
- Dave<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, Mar 28, 2018 at 11:16 AM via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">TL;DR: If I'm trying to define new assembler directive syntax to<br>
support DWARF v5, it seems like a good idea for all the various<br>
assemblers out there in the world to support the same syntax.<br>
How would I go about negotiating that syntax with other assembler<br>
providers?  Is GNU as the only really relevant one?<br>
<br>
Long version:<br>
<br>
DWARF v5 introduces a couple of new features in the .debug_line section<br>
that require assembler syntax, because the information relates to the<br>
files read by the compiler and there's no other way to inform the<br>
assembler.<br>
<br>
The two bits of information are:<br>
(1) the MD5 checksum of each source file; and<br>
(2) the primary source filename.<br>
<br>
The primary source filename is given in the .debug_info section. In<br>
DWARF v5 this is repeated in the .debug_line section; prior to DWARF v5<br>
it is not.  In both cases, file number 0 refers to this file.  Because<br>
the compiler emits the .debug_info section directly, the assembler is<br>
not aware of the name of the primary source file without some new syntax<br>
to provide that information.  And, it needs the MD5 checksum as well, so<br>
relying on the old-format '.file' directive is insufficient.<br>
<br>
I've added support in LLVM for both of these features, but somewhat<br>
arbitrarily defined assembler syntax to support them.  Obviously if<br>
implementers of other assemblers also want to support DWARF v5, the same<br>
information will have to be represented with assembler syntax somehow,<br>
and of course it would be best if all assemblers supporting DWARF v5<br>
used the same syntax.  But I don't know how to go about doing that.<br>
<br>
Any advice would be welcome.<br>
Thanks,<br>
--paulr<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div></div></div></blockquote></div></div>