<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
h3
        {mso-style-priority:9;
        mso-style-link:"Heading 3 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:13.5pt;
        font-family:"Times New Roman","serif";
        font-weight:bold;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.Heading3Char
        {mso-style-name:"Heading 3 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 3";
        font-family:"Cambria","serif";
        color:#4F81BD;
        font-weight:bold;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I said much the same thing in my review.  Although it occurs to me now, perhaps
<a name="_MailEndCompose">a unittest?  Conjure up a correctly formed unit header with a 64-bit length (that is >32-bits wide), but actually has no DIEs in it; call the parser (which will fail, but I think still fill in the header info), then call dump() with
 a raw_ostream pointing to a local buffer; then you can validate the content of the buffer, which should have the 64-bit length in it.<o:p></o:p></a></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Worth a shot.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">--paulr<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></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""> llvm-commits [mailto:llvm-commits-bounces@lists.llvm.org]
<b>On Behalf Of </b>Igor Kudrin via llvm-commits<br>
<b>Sent:</b> Wednesday, September 04, 2019 9:49 PM<br>
<b>To:</b> David Blaikie<br>
<b>Cc:</b> llvm-commits<br>
<b>Subject:</b> Re: [llvm] r369529 - [DWARF] Adjust return type of DWARFUnit::getLength().<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><span style="font-family:"Calibri","sans-serif";color:black">I agree with you. I tried but could not devise a sample for a positive scenario which would not be enormously big. Any suggestions?<o:p></o:p></span></p>
<p><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<div id="Signature">
<div name="divtagdefaultwrapper">
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#212121">Best Regards,</span><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#212121">Igor Kudrin</span><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#212121">C++ Developer,</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#212121"> Access Softek, Inc.</span><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-family:"Calibri","sans-serif";color:#212121">
<hr size="3" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black"> David Blaikie <dblaikie@gmail.com><br>
<b>Sent:</b> Thursday, September 5, 2019 07:55<br>
<b>To:</b> Igor Kudrin<br>
<b>Cc:</b> llvm-commits<br>
<b>Subject:</b> Re: [llvm] r369529 - [DWARF] Adjust return type of DWARFUnit::getLength().</span><span style="font-family:"Calibri","sans-serif";color:#212121">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#212121"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<div style="mso-element:para-border-div;border:dotted #003333 1.0pt;padding:10.0pt 10.0pt 10.0pt 10.0pt;background:white">
<h3 style="background:white;border:none;padding:0in"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#FF6600">CAUTION:<strong><span style="font-family:"Calibri","sans-serif""> </span></strong></span><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#212121">This
 email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.  If you suspect potential phishing or spam email, report it to ReportSpam@accesssoftek.com<o:p></o:p></span></h3>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#212121">Ideally test cases would be good to cover this functionality and demonstrate the length is no longer truncated.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#212121"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#212121">On Wed, Aug 21, 2019 at 7:09 AM Igor Kudrin via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<o:p></o:p></span></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"><span style="font-family:"Calibri","sans-serif";color:#212121">Author: ikudrin<br>
Date: Wed Aug 21 07:10:57 2019<br>
New Revision: 369529<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=369529&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=369529&view=rev</a><br>
Log:<br>
[DWARF] Adjust return type of DWARFUnit::getLength().<br>
<br>
DWARFUnitHeader::getLength() returns uint64_t.<br>
DWARFUnit::getLength() should do the same.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D66472" target="_blank">
https://reviews.llvm.org/D66472</a><br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h<br>
    llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp<br>
    llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h?rev=369529&r1=369528&r2=369529&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h?rev=369529&r1=369528&r2=369529&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h (original)<br>
+++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h Wed Aug 21 07:10:57 2019<br>
@@ -286,7 +286,7 @@ public:<br>
   uint8_t getDwarfOffsetByteSize() const {<br>
     return Header.getDwarfOffsetByteSize();<br>
   }<br>
-  uint32_t getLength() const { return Header.getLength(); }<br>
+  uint64_t getLength() const { return Header.getLength(); }<br>
   uint8_t getUnitType() const { return Header.getUnitType(); }<br>
   bool isTypeUnit() const { return Header.isTypeUnit(); }<br>
   uint64_t getNextUnitOffset() const { return Header.getNextUnitOffset(); }<br>
<br>
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp?rev=369529&r1=369528&r2=369529&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp?rev=369529&r1=369528&r2=369529&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp (original)<br>
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp Wed Aug 21 07:10:57 2019<br>
@@ -16,7 +16,7 @@ using namespace llvm;<br>
<br>
 void DWARFCompileUnit::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {<br>
   OS << format("0x%08" PRIx64, getOffset()) << ": Compile Unit:"<br>
-     << " length = " << format("0x%08x", getLength())<br>
+     << " length = " << format("0x%08" PRIx64, getLength())<br>
      << " version = " << format("0x%04x", getVersion());<br>
   if (getVersion() >= 5)<br>
     OS << " unit_type = " << dwarf::UnitTypeString(getUnitType());<br>
<br>
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp?rev=369529&r1=369528&r2=369529&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp?rev=369529&r1=369528&r2=369529&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp (original)<br>
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp Wed Aug 21 07:10:57 2019<br>
@@ -24,12 +24,12 @@ void DWARFTypeUnit::dump(raw_ostream &OS<br>
   if (DumpOpts.SummarizeTypes) {<br>
     OS << "name = '" << Name << "'"<br>
        << " type_signature = " << format("0x%016" PRIx64, getTypeHash())<br>
-       << " length = " << format("0x%08x", getLength()) << '\n';<br>
+       << " length = " << format("0x%08" PRIx64, getLength()) << '\n';<br>
     return;<br>
   }<br>
<br>
   OS << format("0x%08" PRIx64, getOffset()) << ": Type Unit:"<br>
-     << " length = " << format("0x%08x", getLength())<br>
+     << " length = " << format("0x%08" PRIx64, getLength())<br>
      << " version = " << format("0x%04x", getVersion());<br>
   if (getVersion() >= 5)<br>
     OS << " unit_type = " << dwarf::UnitTypeString(getUnitType());<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><o:p></o:p></span></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>