<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-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;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.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 lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi Davide,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I reread the review, and I see I was confused by two things:
<o:p></o:p></p>
<p class="MsoNormal">(1) the name of the test is static_scope.s even though what it’s testing is the scope of a var with a const_value, nothing to do with `static`;
<o:p></o:p></p>
<p class="MsoNormal">(2) there’s this comment in the review: <a href="https://reviews.llvm.org/D77698#1973122">
https://reviews.llvm.org/D77698#1973122</a> “what’s the DWARF’y way to find out whether a variable is static?” suggesting you did care about static-scope variables.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I suggest renaming the test to better reflect what it’s testing (which has nothing to do with the scope of static vars).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Re your question, DWARF doesn’t explicitly identify variables as static.  Variables have scopes, which might be local or might be file-level or might be global.  Globals are distinguished from file-level locals with the external flag. 
 Locals and file-level vars simply are in the appropriate scope.  A static local should look exactly like a non-static local, except that its location expression(s) would not be frame-based.  Static locals are not exciting, from a DWARF viewpoint.  (LLVM historically
 has had trouble putting them in the correct scope, but that is a compiler problem not a DWARF problem.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I hope this resolves the questions/confusion.<o:p></o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">--paulr<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></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 #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Davidino Italiano <ditaliano@apple.com> <br>
<b>Sent:</b> Thursday, April 16, 2020 5:26 PM<br>
<b>To:</b> Robinson, Paul <paul.robinson@sony.com><br>
<b>Cc:</b> lldb-commits@lists.llvm.org<br>
<b>Subject:</b> Re: [Lldb-commits] [lldb] 1fae85a - [DWARF] Add instructions to regenerate this test, if needed.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Apr 16, 2020, at 2:01 PM, Robinson, Paul <<a href="mailto:paul.robinson@sony.com">paul.robinson@sony.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><br>
<br style="caret-color: rgb(0, 0, 0);font-variant-caps: normal;text-align:start;-webkit-text-stroke-width: 0px;word-spacing:0px">
<br>
</span><o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">-----Original Message-----<br>
From: lldb-commits <<a href="mailto:lldb-commits-bounces@lists.llvm.org">lldb-commits-bounces@lists.llvm.org</a>> On Behalf Of<br>
Davide Italiano via lldb-commits<br>
Sent: Thursday, April 16, 2020 4:32 PM<br>
To:<span class="apple-converted-space"> </span><a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a><br>
Subject: [Lldb-commits] [lldb] 1fae85a - [DWARF] Add instructions to<br>
regenerate this test, if needed.<br>
<br>
<br>
Author: Davide Italiano<br>
Date: 2020-04-16T13:31:32-07:00<br>
New Revision: 1fae85a8534ec51ca893899314bd244b3e9684c7<br>
<br>
URL: <a href="https://urldefense.com/v3/__https:/github.com/llvm/llvm-__;!!JmoZiZGBv3RvKRSx!s_ymEsqOzBkqe8_cPIENEmr3UPzx_qHu9F8NJIhfR752jwNWkGMqXTUjqmmT3K6i_A$">
https://github.com/llvm/llvm-</a><br>
project/commit/1fae85a8534ec51ca893899314bd244b3e9684c7<br>
DIFF: <a href="https://urldefense.com/v3/__https:/github.com/llvm/llvm-__;!!JmoZiZGBv3RvKRSx!s_ymEsqOzBkqe8_cPIENEmr3UPzx_qHu9F8NJIhfR752jwNWkGMqXTUjqmmT3K6i_A$">
https://github.com/llvm/llvm-</a><br>
project/commit/1fae85a8534ec51ca893899314bd244b3e9684c7.diff<br>
<br>
LOG: [DWARF] Add instructions to regenerate this test, if needed.<br>
<br>
Added:<br>
<br>
<br>
Modified:<br>
   lldb/test/Shell/SymbolFile/DWARF/static_scope.s<br>
<br>
Removed:<br>
<br>
<br>
<br>
##########################################################################<br>
######<br>
diff  --git a/lldb/test/Shell/SymbolFile/DWARF/static_scope.s<br>
b/lldb/test/Shell/SymbolFile/DWARF/static_scope.s<br>
index 84a69e08ecfc..02d497ac9ccb 100644<br>
--- a/lldb/test/Shell/SymbolFile/DWARF/static_scope.s<br>
+++ b/lldb/test/Shell/SymbolFile/DWARF/static_scope.s<br>
@@ -3,6 +3,15 @@<br>
<br>
# REQUIRES: x86<br>
<br>
+# Original test case (for future reference), compiled with:<br>
+# $ clang-10 -g -Og test.c -o test<br>
+# $ cat test.c<br>
+# volatile int a;<br>
+# main() {<br>
+#   int b = 3;<o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><br>
Did you mean this to be `static`?<br>
--paulr<br style="caret-color: rgb(0, 0, 0);font-variant-caps: normal;text-align:start;-webkit-text-stroke-width: 0px;word-spacing:0px">
<br>
</span><o:p></o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">No. Read the the review that introduced this test.<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt;font-variant-caps: normal;orphans: auto;text-align:start;widows: auto;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">+#   a;<br>
+# }<br>
+<br>
# RUN: llvm-mc -triple=x86_64-apple-macosx10.15.0 -filetype=obj %s > %t.o<br>
# RUN: lldb-test symbols %t.o | FileCheck %s<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a><br>
<a href="https://urldefense.com/v3/__https:/lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits__;!!JmoZiZGBv3RvKRSx!s_ymEsqOzBkqe8_cPIENEmr3UPzx_qHu9F8NJIhfR752jwNWkGMqXTUjqmldpXSchg$">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><o:p></o:p></span></p>
</blockquote>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>