summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools/lldb-mi/variable/main.cpp
diff options
context:
space:
mode:
authorIlia K <ki.stfu@gmail.com>2015-03-06 22:25:12 +0000
committerIlia K <ki.stfu@gmail.com>2015-03-06 22:25:12 +0000
commit6ec9ba5a97b30c068dd27acb63a0ce53b8c3f225 (patch)
tree40f1a4ab8d2fb5e33389354af4b2a97e47a45030 /lldb/test/tools/lldb-mi/variable/main.cpp
parent3fee49b236664ce8d8fa753ebf4ea74354635052 (diff)
downloadbcm5719-llvm-6ec9ba5a97b30c068dd27acb63a0ce53b8c3f225.tar.gz
bcm5719-llvm-6ec9ba5a97b30c068dd27acb63a0ce53b8c3f225.zip
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
Diffstat (limited to 'lldb/test/tools/lldb-mi/variable/main.cpp')
-rw-r--r--lldb/test/tools/lldb-mi/variable/main.cpp28
1 files changed, 28 insertions, 0 deletions
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 <cstdint>
+
+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
}
OpenPOWER on IntegriCloud