From 6ec9ba5a97b30c068dd27acb63a0ce53b8c3f225 Mon Sep 17 00:00:00 2001 From: Ilia K Date: Fri, 6 Mar 2015 22:25:12 +0000 Subject: Fix -var-create and -var-update (MI) Summary: This patch includes: * Fix -var-create command for global/static variables * Fix -var-update command: remove m_strValueName/m_eVarInfoFormat/m_bValueChanged{Array,Composite,Normal}Type; clean CMICmdCmdVarUpdate::Execute and CMICmdCmdVarUpdate::Acknowledge; improve CMICmdCmdVarUpdate::MIFormResponse; Complete the value after -var-create using the CMICmdCmdVarCreate::CompleteSBValue to get SBValue::GetValueDidChange work. * Add non-constant version of CMICmnLLDBDebugSessionInfoVarObj::GetValue * Add MiVarTestCase.test_lldbmi_var_update test All tests pass on OS X. Reviewers: abidh, emaste, clayborg Reviewed By: clayborg Subscribers: lldb-commits, emaste, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8110 llvm-svn: 231525 --- lldb/test/tools/lldb-mi/variable/main.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lldb/test/tools/lldb-mi/variable/main.cpp') diff --git a/lldb/test/tools/lldb-mi/variable/main.cpp b/lldb/test/tools/lldb-mi/variable/main.cpp index c077c4078a4..5a80817478c 100644 --- a/lldb/test/tools/lldb-mi/variable/main.cpp +++ b/lldb/test/tools/lldb-mi/variable/main.cpp @@ -7,6 +7,33 @@ // //===----------------------------------------------------------------------===// +#include + +struct complex_type +{ + int i; + struct { long l; } inner; + complex_type *complex_ptr; +}; + +void +var_update_test(void) +{ + long l = 1; + complex_type complx = { 3, { 3L }, &complx }; + complex_type complx_array[2] = { { 4, { 4L }, &complx_array[1] }, { 5, { 5 }, &complx_array[0] } }; + // BP_var_update_test_init + + l = 0; + // BP_var_update_test_l + + complx.inner.l = 2; + // BP_var_update_test_complx + + complx_array[1].inner.l = 4; + // BP_var_update_test_complx_array +} + int g_MyVar = 3; static int s_MyVar = 4; @@ -15,5 +42,6 @@ main(int argc, char const *argv[]) { int a = 10, b = 20; s_MyVar = a + b; + var_update_test(); return 0; // BP_return } -- cgit v1.2.3