[Bug 25653] New: Cannot inspect const static variable

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@lists.llvm.org
Reporter verena@codeplay.com
CC llvm-bugs@lists.llvm.org
Classification Unclassified

Created attachment 15359 [details]
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

Ewan Crawford changed bug 25653

What | Removed | Added |

  • | - | - |
    Status | NEW | RESOLVED |
    Resolution | — | FIXED |

Comment # 1 on bug 25653 from Ewan Crawford

Fixed in revision r255887