[Lldb-commits] [PATCH] D13350: [lldb] Fix evaluation of global variables

Eugene Leviant via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 1 08:48:40 PDT 2015


evgeny777 created this revision.
evgeny777 added reviewers: clayborg, paulherman.
evgeny777 added subscribers: lldb-commits, KLapshin.

Current revision contains bug, related to evaluation of global variables. Imagine you have the following code

```
int _g = 1;
int func(void) {
    int _g = 2;
    return _g; // BP here and evaluate ::_g
}
```
evaluation of ::_g will return 2, while the correct value is 1

Another example:


```
namespace test {
    int test_var = 1;
}

int test_var = 2;
int func(void) {
     using namespace test;
     return ::test_var;  // BP here and try to evaluate ::test_var
}

```
Evaluation will return error (multiple candidates), while correct behaviour is to return '2'

http://reviews.llvm.org/D13350

Files:
  clang/include/clang/AST/DeclBase.h
  clang/lib/Sema/SemaLookup.cpp
  lldb/include/lldb/Symbol/ClangASTContext.h
  lldb/include/lldb/Symbol/CompilerDeclContext.h
  lldb/include/lldb/Symbol/TypeSystem.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/CompilerDeclContext.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13350.36249.patch
Type: text/x-patch
Size: 8523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151001/06772a9a/attachment.bin>


More information about the lldb-commits mailing list