<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=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
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;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@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 lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I think it's worth repeating a point that dblaikie made a little while back, which is that we want to allow for a DIE with DW_AT_abstract_origin
 that points to a DIE that in turn has DW_AT_specification.  The recursive implementation was an implementation convenience, not a statement that arbitrary-length mix-n-match chains are legal.  (If it was such a statement, I disagree with it.)  I don't think
 I can come up with a case where DW_AT_specification would meaningfully point to a DIE with DW_AT_abstract_origin, or where you'd want chains of DIEs with these attributes.<o:p></o:p></span></a></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""> David Blaikie [mailto:dblaikie@gmail.com]
<br>
<b>Sent:</b> Tuesday, February 13, 2018 11:48 AM<br>
<b>To:</b> Jonas Devlieghere<br>
<b>Cc:</b> Adrian Prantl; reviews+D43092+public+94abba730c8ff6fa@reviews.llvm.org; Robinson, Paul; clayborg@gmail.com; LLVM Commits; hiraditya@msn.com; djordje.todorovic@rt-rk.com; Davis, Matthew; ewan@codeplay.com<br>
<b>Subject:</b> Re: [PATCH] D43092: [DebugInfo] Prevent infinite recursion for malformed DWARF<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2.13.2 says:<br>
<br>
"A debugging information entry that represents a declaration that completes another (earlier) non-defining declaration may have a DW_AT_specification attribute whose value is a reference to the debugging information entry representing the non-defining declaration"<br>
<br>
Seems pretty clear that there's only one defining declaration and that DW_AT_specification is for referencing from that defining declaration to the non-defining declaration.<br>
<br>
And the wording around abstract origins I think is pretty clear too - that there's a concrete definition, an abstract definition, and any number of inline definitions.<br>
<br>
But as always, real world situations somewhat trump any of this, imho - so if there's a compelling use case/existing producer that produces some interesting DWARF related to declarations/definitions specifications/abstract_origins, it'd be great to see to better
 understand what would be useful to support (& to document why it's being supported/what to look for when we're evaluating how that support should work/be maintained in the future)<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Feb 13, 2018 at 11:42 AM Jonas Devlieghere <<a href="mailto:jdevlieghere@apple.com">jdevlieghere@apple.com</a>> wrote:<o:p></o:p></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">
<div>
<p class="MsoNormal">Is there anything in the DWARF standard that would suggest this shouldn’t be possible? If not I think we should support it as is and implement the more advanced loop detection?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">On Feb 9, 2018, at 3:53 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">*nod* Thought so - would be good to know what scenario this is meant to support.<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">On Fri, Feb 9, 2018 at 2:22 AM Jonas Devlieghere via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<o:p></o:p></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" style="margin-bottom:12.0pt">JDevlieghere added a subscriber: clayborg.<br>
JDevlieghere added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D43092#1002677" target="_blank">https://reviews.llvm.org/D43092#1002677</a>, @dblaikie wrote:<br>
<br>
> Could you check the revision history here? I'm pretty sure the first version of this I reviewed from Greg wasn't recursive - and then it became recursive at some point to handle something needed, but maybe those decisions need to be reexamined?<br>
<br>
<br>
It was @clayborg himself that updated the implementation. (<a href="https://reviews.llvm.org/D40156" target="_blank">https://reviews.llvm.org/D40156</a>
<a href="https://reviews.llvm.org/rL319104" target="_blank">https://reviews.llvm.org/rL319104</a>)<br>
<br>
> The previous implementation would only look 1 DW_AT_specification or DW_AT_abstract_origin deep. This means DWARFDie::getName() would fail in certain cases. I ran into such a case while creating a tool that used the LLVM DWARF parser to generate a symbolication
 format so I have seen this in the wild.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D43092" target="_blank">https://reviews.llvm.org/D43092</a><br>
<br>
<br>
<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>