<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 15, 2017 at 7:53 AM George Rimar <<a href="mailto:grimar@accesssoftek.com">grimar@accesssoftek.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>​Hi !<br>
</p>
<p><br>
</p>
<p>I have a question about code used for collecting ranges. I was trying to fix PR35199. <br>
</p>
<p>Its issue that it calls unreachable when calls DWARFObject::getFileName().<br>
</p>
<p>We do not implement this method in LLD and it fails.</p>
<p>Issue appears when we start to provide .debug_str</p>
<p>section to DWARF parser. And it is relative to following code (lines 335-339):<br>
</p>
<p><br>
</p>
<p><a href="https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/DWARF/DWARFUnit.cpp#L335" target="_blank">https://github.com/llvm-mirror/llvm/blob/master/lib/DebugInfo/DWARF/DWARFUnit.cpp#L335</a><br>
</p>
<p><br>
</p>
<p>Object I used for debugging parser is following:<br>
</p>
<pre class="m_1749186685424838288bz_comment_text" id="m_1749186685424838288comment_text_4" style="font-size:small;white-space:pre-wrap;width:50em;background-color:rgb(255,255,255)">t.ii:
int a;<br></pre>
<pre class="m_1749186685424838288bz_comment_text" id="m_1749186685424838288comment_text_4" style="font-size:small;white-space:pre-wrap;width:50em;background-color:rgb(255,255,255)">clang++ -gsplit-dwarf -c t.ii -o t.o<br><br></pre>
<pre class="m_1749186685424838288bz_comment_text" id="m_1749186685424838288comment_text_4" style="white-space:pre-wrap;width:50em;background-color:rgb(255,255,255)"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)"></span><span style="font-family:Calibri,Arial,Helvetica,sans-serif">When parser tries to read this object it attemps to extract address ranges from dwo. </span></pre>
<pre class="m_1749186685424838288bz_comment_text" id="m_1749186685424838288comment_text_4" style="white-space:pre-wrap;width:50em;background-color:rgb(255,255,255)"><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">When we don't give it .debug_str it fails to extract dwo name, exits early and "works" fine, but with<br></p><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">.debug_str provided it tries to take ranges from there, tries to get DWO name to open it and fails. <br></p><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br></p><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">Though I did not find why it tries to scan .dwo. I tried to comment these lines (335-339) and no tests</p><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">were failing for me, at least I tried running tests from \llvm\test\DebugInfo and</p><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">running DebugInfoDWARFTests. It seems to me these lines are either untested or useless (?).<br></p><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br></p><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">So my question is probably next: what is the case when we need to scan .dwo for extracting ranges,<br></p><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">should not address data be accessible from main object always ?<br></p><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">I wonder if these lines really do useful job ?​<br></p></pre></div></blockquote><div>There's no requirement that DW_AT_ranges (or high/low_pc) appear on the skeleton CU rather than the DWO CU. So it's quite possible that to get the address ranges covered by the CU one would need to look in the DWO, I think?<br><br>Is that not correct/have I misunderstood something there?<br><br>Though, admittedly - the presence of debug_str shouldn't be the deciding factor that leads to an error. If it's an error not to find the .dwo file, it seems it should be an error not to find the debug_str that's needed to get there... but I haven't looked at the code to check - maybe this does make sense/perhaps there are aspects I haven't considered.<br><br>- Dave </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif"><pre class="m_1749186685424838288bz_comment_text" id="m_1749186685424838288comment_text_4" style="white-space:pre-wrap;width:50em;background-color:rgb(255,255,255)"><p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"></p></pre>
<div id="m_1749186685424838288Signature">
<div name="divtagdefaultwrapper">
<div class="m_1749186685424838288BodyFragment"><font size="2">
<div class="m_1749186685424838288PlainText">Best regards,<br>
George | Developer | <span style="background-color:rgb(255,255,255);color:rgb(33,33,33);font-family:Calibri,sans-serif;font-size:13.3333px">Access Softek, Inc</span></div>
</font></div>
</div>
</div>
</div>

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