<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" style="margin-left:.5in">I imagine if [debug_loc] is produced for two distinct inlined variables (from distinct inlined calls to the same function) then their location lists might end up accidentally shared (they'd end up with the same
location list (possibly combining both variable location lists), rather than distinct ones)?<br>
<br>
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The instruction-address ranges for the two instances of the variable will be different, therefore the location lists will be different.
I can't imagine any scenario where location lists could be shared.<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""> llvm-commits-bounces@cs.uiuc.edu [mailto:llvm-commits-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>David Blaikie<br>
<b>Sent:</b> Thursday, April 16, 2015 3:50 PM<br>
<b>To:</b> Duncan P. N. Exon Smith<br>
<b>Cc:</b> llvm-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [llvm] r235050 - DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Apr 16, 2015 at 3:37 PM, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal"><br>
> On 2015-Apr-16, at 14:21, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> wrote:<br>
><br>
>><br>
>> On 2015-Apr-16, at 11:41, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
>><br>
>> (from IRC discussion)<br>
>><br>
>> Looks like this might've caused the GDB buildbot regression seen here: <a href="http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/21390" target="_blank">
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/21390</a><br>
>><br>
>> Specifically, in the below program<br>
>><br>
>> int *g;<br>
>><br>
>> static __attribute__((always_inline)) int f(int a) {<br>
>> int l;<br>
>> g = &l;<br>
>> return a;<br>
>> }<br>
>><br>
>> int main(void) {<br>
>> f(0);<br>
>> f(0);<br>
>> return 0;<br>
>> }<br>
>><br>
>> The inlined_subroutine for 'f' in 'main' has no DW_TAG_formal_parameter (for 'a')<br>
><br>
> I've tracked this down -- UserValue::match() needed to be updated.<br>
<br>
r235140<br>
<br>
><br>
> I fixed what might be an unrelated bug in DebugLocEntry. I'll have<br>
> to separate out the two changes to see if this testcase provides any<br>
> coverage for `DebugLocEntry`; if not I'll maybe need some help from<br>
> you or Adrian coming up with a good testcase for that one.<br>
<br>
This turned out to be unrelated.<br>
<br>
Looking at the code, I'm not even sure what the variables are doing in<br>
`DebugLocEntry` -- they're only used to prevent adjacent locations from<br>
coalescing. I guess the main problem is I don't know what this table is<br>
for (well, `.debug_loc`, but I don't know what that is either).<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
.debug_loc is for variables that don't reside in just a single location for their entire lifetime (much like debug_ranges discussed earlier) - if a variable resides in a single place for its entire scope, then DW_AT_location will have a dwarf expression describing
that location, otherwise it'll have a sec_offset/data4 giving the offset in debug_loc that describes the various locations and ranges for the variable.<br>
<br>
You might look for existing test cases that produce debug_loc sections? But I don't have a canonical way to produce one off-hand. I imagine if one is produced for two distinct inlined variables (from distinct inlined calls to the same function) then their location
lists might end up accidentally shared (they'd end up with the same location list (possibly combining both variable location lists), rather than distinct ones)?<br>
<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"><br>
By inspection, r235050 caused a behaviour change here (and the attached<br>
patch would revert the behaviour change), but I honestly have no idea<br>
what to test.<br>
<br>
Adrian, you seem to have touched this code most recently. Any ideas?<o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>