[Lldb-commits] [lldb] 1fae85a - [DWARF] Add instructions to regenerate this test, if needed.

Robinson, Paul via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 17 04:51:38 PDT 2020


Hi Davide,

I reread the review, and I see I was confused by two things:
(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`;
(2) there's this comment in the review: https://reviews.llvm.org/D77698#1973122 "what's the DWARF'y way to find out whether a variable is static?" suggesting you did care about static-scope variables.

I suggest renaming the test to better reflect what it's testing (which has nothing to do with the scope of static vars).

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.)

I hope this resolves the questions/confusion.
Thanks,
--paulr

From: Davidino Italiano <ditaliano at apple.com>
Sent: Thursday, April 16, 2020 5:26 PM
To: Robinson, Paul <paul.robinson at sony.com>
Cc: lldb-commits at lists.llvm.org
Subject: Re: [Lldb-commits] [lldb] 1fae85a - [DWARF] Add instructions to regenerate this test, if needed.




On Apr 16, 2020, at 2:01 PM, Robinson, Paul <paul.robinson at sony.com<mailto:paul.robinson at sony.com>> wrote:




-----Original Message-----
From: lldb-commits <lldb-commits-bounces at lists.llvm.org<mailto:lldb-commits-bounces at lists.llvm.org>> On Behalf Of
Davide Italiano via lldb-commits
Sent: Thursday, April 16, 2020 4:32 PM
To: lldb-commits at lists.llvm.org<mailto:lldb-commits at lists.llvm.org>
Subject: [Lldb-commits] [lldb] 1fae85a - [DWARF] Add instructions to
regenerate this test, if needed.


Author: Davide Italiano
Date: 2020-04-16T13:31:32-07:00
New Revision: 1fae85a8534ec51ca893899314bd244b3e9684c7

URL: https://github.com/llvm/llvm-<https://urldefense.com/v3/__https:/github.com/llvm/llvm-__;!!JmoZiZGBv3RvKRSx!s_ymEsqOzBkqe8_cPIENEmr3UPzx_qHu9F8NJIhfR752jwNWkGMqXTUjqmmT3K6i_A$>
project/commit/1fae85a8534ec51ca893899314bd244b3e9684c7
DIFF: https://github.com/llvm/llvm-<https://urldefense.com/v3/__https:/github.com/llvm/llvm-__;!!JmoZiZGBv3RvKRSx!s_ymEsqOzBkqe8_cPIENEmr3UPzx_qHu9F8NJIhfR752jwNWkGMqXTUjqmmT3K6i_A$>
project/commit/1fae85a8534ec51ca893899314bd244b3e9684c7.diff

LOG: [DWARF] Add instructions to regenerate this test, if needed.

Added:


Modified:
   lldb/test/Shell/SymbolFile/DWARF/static_scope.s

Removed:



##########################################################################
######
diff  --git a/lldb/test/Shell/SymbolFile/DWARF/static_scope.s
b/lldb/test/Shell/SymbolFile/DWARF/static_scope.s
index 84a69e08ecfc..02d497ac9ccb 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/static_scope.s
+++ b/lldb/test/Shell/SymbolFile/DWARF/static_scope.s
@@ -3,6 +3,15 @@

# REQUIRES: x86

+# Original test case (for future reference), compiled with:
+# $ clang-10 -g -Og test.c -o test
+# $ cat test.c
+# volatile int a;
+# main() {
+#   int b = 3;

Did you mean this to be `static`?
--paulr


No. Read the the review that introduced this test.


+#   a;
+# }
+
# RUN: llvm-mc -triple=x86_64-apple-macosx10.15.0 -filetype=obj %s > %t.o
# RUN: lldb-test symbols %t.o | FileCheck %s




_______________________________________________
lldb-commits mailing list
lldb-commits at lists.llvm.org<mailto:lldb-commits at lists.llvm.org>
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits<https://urldefense.com/v3/__https:/lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits__;!!JmoZiZGBv3RvKRSx!s_ymEsqOzBkqe8_cPIENEmr3UPzx_qHu9F8NJIhfR752jwNWkGMqXTUjqmldpXSchg$>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200417/b7476b65/attachment-0001.html>


More information about the lldb-commits mailing list