[llvm-bugs] [Bug 51559] New: Variable not visible at Og

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 20 07:59:58 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51559

            Bug ID: 51559
           Summary: Variable not visible at Og
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: artuso at diag.uniroma1.it
                CC: jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com

Comment:
When stepping on line 4 the variable g_3012 is not visible.

Steps to reproduce bug:

root at e60e0a2bba1a:/home/stepping/output# clang -v
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
957334382cd12ec07b46c0ddfdcc220731f6d80f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Selected multilib: .;@m64

root at e60e0a2bba1a:/home/stepping/output# lldb -v
lldb version 14.0.0 (https://github.com/llvm/llvm-project.git revision
957334382cd12ec07b46c0ddfdcc220731f6d80f)
  clang revision 957334382cd12ec07b46c0ddfdcc220731f6d80f
  llvm revision 957334382cd12ec07b46c0ddfdcc220731f6d80f

root at e60e0a2bba1a:/home/stepping/output# cat a.c
int g_97 ;
       static short g_3012 ;
       void  func_30() {
         g_97 = g_3012;
       }
       int main()      {
             {
              func_30();
            }
           }

root at e60e0a2bba1a:/home/stepping/output# cat -n a.c
     1  int g_97 ;
     2         static short g_3012 ;
     3         void  func_30() {
     4           g_97 = g_3012;
     5         }
     6         int main()      {
     7               {
     8                func_30();
     9              }
    10             }

root at e60e0a2bba1a:/home/stepping/output# clang -g -Og a.c -o opt

root at e60e0a2bba1a:/home/stepping/output# lldb opt
(lldb) target create "opt"
Current executable set to '/home/stepping/output/opt' (x86_64).
(lldb) b main
Breakpoint 1: where = opt`main [inlined] func_30 at a.c:4:15, address =
0x0000000000400490
(lldb) r
Process 68731 launched: '/home/stepping/output/opt' (x86_64)
Process 68731 stopped
* thread #1, name = 'opt', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400490 opt`main [inlined] func_30 at a.c:4:15
   1    int g_97 ;
   2           static short g_3012 ;
   3           void  func_30() {
-> 4             g_97 = g_3012;
   5           }
   6           int main()      {
   7                 {
(lldb) p g_3012
error: expression failed to parse:
error: <user expression 0>:1:1: use of undeclared identifier 'g_3012'
g_3012

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210820/3aa14af1/attachment-0001.html>


More information about the llvm-bugs mailing list