Fixed a bug where the DWARF location expression
parser was creating malformed resuls. When the
location of a variable is computed by reading a
register and adding an offset, we shouldn't say
that the variable's value is located in that
register. This was confusing the expression
parser when trying to read a variable captured
by a block.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147668 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index 3555c41..88ce130 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -2433,6 +2433,7 @@
{
int64_t breg_offset = opcodes.GetSLEB128(&offset);
tmp.ResolveValue(exe_ctx, ast_context) += (uint64_t)breg_offset;
+ tmp.ClearContext();
stack.push_back(tmp);
stack.back().SetValueType (Value::eValueTypeLoadAddress);
}
@@ -2456,6 +2457,7 @@
{
int64_t breg_offset = opcodes.GetSLEB128(&offset);
tmp.ResolveValue(exe_ctx, ast_context) += (uint64_t)breg_offset;
+ tmp.ClearContext();
stack.push_back(tmp);
stack.back().SetValueType (Value::eValueTypeLoadAddress);
}