summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-08-09 23:09:42 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-08-09 23:09:42 +0000
commite9a5627e7ae21d10049352e196ff7469a40c6d06 (patch)
tree97ada238546a6071edbdf67f1ba78bc41ca7f6f0 /lldb/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp
parent637ff0cc0fc79bdd6ccea856835f278e89f79b67 (diff)
downloadbcm5719-llvm-e9a5627e7ae21d10049352e196ff7469a40c6d06.tar.gz
bcm5719-llvm-e9a5627e7ae21d10049352e196ff7469a40c6d06.zip
rdar://problem/11457143 [ER] need "watchpoint command ..."
Add 'watchpoint command add/delete/list' to lldb, plus two .py test files. llvm-svn: 161638
Diffstat (limited to 'lldb/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp')
-rw-r--r--lldb/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp
new file mode 100644
index 00000000000..f4c3527f8af
--- /dev/null
+++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp
@@ -0,0 +1,28 @@
+//===-- main.c --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#include <stdio.h>
+#include <stdint.h>
+
+int32_t global = 0; // Watchpoint variable declaration.
+
+static void modify(int32_t &var) {
+ ++var;
+}
+
+int main(int argc, char** argv) {
+ int local = 0;
+ printf("&global=%p\n", &global);
+ printf("about to write to 'global'...\n"); // Set break point at this line.
+ // When stopped, watch 'global',
+ // for the condition "global == 5".
+ for (int i = 0; i < 10; ++i)
+ modify(global);
+
+ printf("global=%d\n", global);
+}
OpenPOWER on IntegriCloud