http://llvm.org/bugs/show_bug.cgi?id=11588
authorJohnny Chen <johnny.chen@apple.com>
Fri, 16 Dec 2011 23:04:52 +0000 (23:04 +0000)
committerJohnny Chen <johnny.chen@apple.com>
Fri, 16 Dec 2011 23:04:52 +0000 (23:04 +0000)
commitb456b792e04c178df5ff8fca7c2320b2efdcd31e
tree6d7cb532c878d199d090b610e2527af4c997258f
parent9790187b6c4803fb0f47b6adf03fd5602292c210
http://llvm.org/bugs/show_bug.cgi?id=11588
valobj.AddressOf() returns None when an address is expected in a SyntheticChildrenProvider

Patch from Enrico Granata:

The problem was that the frozen object created by the expression parser was a copy of the contents of the StgClosure, rather than a pointer to it. Thus, the expression parser was correctly computing the result of the arithmetic&cast operation along with its address, but only saving it in the live object. This meant that the frozen copy acted as an address-less variable, hence the problem.

The fix attached to this email lets the expression parser store the "live address" in the frozen copy of the address when the object is built without a valid address of its own.
Doing so, along with delegating ValueObjectConstResult to calculate its own address when necessary, solves the issue. I have also added a new test case to check for regressions in this area, and checked that existing test cases pass correctly.

llvm-svn: 146768
lldb/include/lldb/Core/ValueObject.h
lldb/include/lldb/Core/ValueObjectConstResult.h
lldb/include/lldb/Core/ValueObjectConstResultImpl.h
lldb/source/Core/ValueObjectConstResult.cpp
lldb/source/Core/ValueObjectConstResultImpl.cpp
lldb/source/Expression/ClangExpressionDeclMap.cpp
lldb/test/expression_command/issue_11588/Makefile [new file with mode: 0644]
lldb/test/expression_command/issue_11588/Test11588.py [new file with mode: 0644]
lldb/test/expression_command/issue_11588/main.cpp [new file with mode: 0644]
lldb/test/expression_command/issue_11588/s11588.py [new file with mode: 0644]