Index: include/lldb/Core/ValueObjectVariable.h =================================================================== --- include/lldb/Core/ValueObjectVariable.h +++ include/lldb/Core/ValueObjectVariable.h @@ -82,6 +82,10 @@ private: ValueObjectVariable (ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp); + + static void + UpdateValueObjectAndChildren(lldb::ValueObjectSP &valobj_sp); + //------------------------------------------------------------------ // For ValueObject only //------------------------------------------------------------------ Index: source/Core/ValueObjectVariable.cpp =================================================================== --- source/Core/ValueObjectVariable.cpp +++ source/Core/ValueObjectVariable.cpp @@ -38,7 +38,25 @@ lldb::ValueObjectSP ValueObjectVariable::Create (ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp) { - return (new ValueObjectVariable (exe_scope, var_sp))->GetSP(); + lldb::ValueObjectSP valobj_sp((new ValueObjectVariable (exe_scope, var_sp))->GetSP()); + UpdateValueObjectAndChildren(valobj_sp); + return valobj_sp; +} + +void +ValueObjectVariable::UpdateValueObjectAndChildren(lldb::ValueObjectSP &valobj_sp) +{ + valobj_sp->UpdateValueIfNeeded(); + + if (!valobj_sp->IsPointerOrReferenceType()) + { + const size_t valobj_child_num = valobj_sp->GetNumChildren(); + for (size_t i = 0; i < valobj_child_num; ++i) + { + lldb::ValueObjectSP child = valobj_sp->GetChildAtIndex(i, true); + UpdateValueObjectAndChildren(child); + } + } } ValueObjectVariable::ValueObjectVariable (ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp) : Index: test/python_api/value_var_update/TestValueVarUpdate.py =================================================================== --- test/python_api/value_var_update/TestValueVarUpdate.py +++ test/python_api/value_var_update/TestValueVarUpdate.py @@ -52,6 +52,7 @@ i = self.frame().FindVariable("i") i_val = i.GetValueAsUnsigned(0) + c = self.frame().FindVariable("c") if self.TraceOn(): self.runCmd("frame variable") @@ -62,6 +63,9 @@ self.assertTrue(i_val != i.GetValueAsUnsigned(0), "GetValue() is saying a lie") self.assertTrue(i.GetValueDidChange(), "GetValueDidChange() is saying a lie") + # Check complex type + self.assertTrue(c.GetChildAtIndex(0).GetChildAtIndex(0).GetValueDidChange() and + not c.GetChildAtIndex(1).GetValueDidChange(), "GetValueDidChange() is saying a lie") if __name__ == '__main__': import atexit Index: test/python_api/value_var_update/main.c =================================================================== --- test/python_api/value_var_update/main.c +++ test/python_api/value_var_update/main.c @@ -1,8 +1,14 @@ +struct complex_type { + struct { long l; } inner; + struct complex_type *complex_ptr; +}; + int main() { int i = 0; + struct complex_type c = { { 1L }, &c }; for (int j = 3; j < 20; j++) { - i += j; + c.inner.l += (i += j); i = i - 1; // break here } return i;