Skip to content

Commit 37b2aba

Browse files
authored
Merge pull request #1709 from shafik/66653217_fix_valueobjectvariable_dw_at_const_value_when_dwarf_expr_holds_constant_value
[LLDB] Fix how ValueObjectVariable handles DW_AT_const_value when the DWARFExpression holds the data that represents a constant value
2 parents 4a1c364 + 6f6bd4c commit 37b2aba

File tree

2 files changed

+413
-1
lines changed

2 files changed

+413
-1
lines changed

lldb/source/Core/ValueObjectVariable.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,11 @@ bool ValueObjectVariable::UpdateValue() {
132132
if (variable->GetLocationIsConstantValueData()) {
133133
// expr doesn't contain DWARF bytes, it contains the constant variable
134134
// value bytes themselves...
135-
if (expr.GetExpressionData(m_data))
135+
if (expr.GetExpressionData(m_data)) {
136+
if (m_data.GetDataStart() && m_data.GetByteSize())
137+
m_value.SetBytes(m_data.GetDataStart(), m_data.GetByteSize());
136138
m_value.SetContext(Value::eContextTypeVariable, variable);
139+
}
137140
else
138141
m_error.SetErrorString("empty constant data");
139142
// constant bytes can't be edited - sorry

0 commit comments

Comments
 (0)