[llvm-bugs] [Bug 25653] New: Cannot inspect const static variable

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 26 08:45:14 PST 2015


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

            Bug ID: 25653
           Summary: Cannot inspect const static variable
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: verena at codeplay.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15359
  --> https://llvm.org/bugs/attachment.cgi?id=15359&action=edit
simple test case with a const static

Calling "expr" or "target variable" on a constant static global in C doesn't
work. The error is

error: use of undeclared identifier 'limit'

or

error: can't find global variable 'limit'

It seems the variable is given the 'DW_AT_const_value' DWARF attribute. However
lldb can't find it. If you compile slightly differently so is has a
'DW_AT_location' attribute instead, lldb deals with it okay.

This works in gcc, which produces a 'DW_AT_location' attribute.

To reproduce compile with "clang -g -O0 InspectConstStatic.c"
Then call lldb with the commands:

b main
r
expr limit

-- 
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/20151126/b38d3b44/attachment.html>


More information about the llvm-bugs mailing list