summaryrefslogtreecommitdiffstats
path: root/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-01-06 20:12:03 +0000
committerdim <dim@FreeBSD.org>2016-01-06 20:12:03 +0000
commit78b9749c0a4ea980a8b934645da6ae98fcc665e8 (patch)
treedd2a1ddf0476664c2b823409c36cbccd52662ca7 /packages/Python/lldbsuite/test/expression_command/persistent_ptr_update
parent60cb593f9d55fa5ca7a5372b731f2330345b4b9a (diff)
downloadFreeBSD-src-78b9749c0a4ea980a8b934645da6ae98fcc665e8.zip
FreeBSD-src-78b9749c0a4ea980a8b934645da6ae98fcc665e8.tar.gz
Vendor import of lldb trunk r256945:
https://llvm.org/svn/llvm-project/lldb/trunk@256945
Diffstat (limited to 'packages/Python/lldbsuite/test/expression_command/persistent_ptr_update')
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py41
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/main.c11
3 files changed, 59 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/Makefile b/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/Makefile
new file mode 100644
index 0000000..db5f575
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/Makefile
@@ -0,0 +1,7 @@
+LEVEL = ../../make
+
+C_SOURCES := main.c
+
+include $(LEVEL)/Makefile.rules
+
+
diff --git a/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py b/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
new file mode 100644
index 0000000..9d7359fb
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
@@ -0,0 +1,41 @@
+"""
+Test that we can have persistent pointer variables
+"""
+
+from __future__ import print_function
+
+
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+
+class PersistentPtrUpdateTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ def test(self):
+ """Test that we can have persistent pointer variables"""
+ self.build()
+
+ def cleanup():
+ pass
+
+ # Execute the cleanup function during test case tear down.
+ self.addTearDownHook(cleanup)
+
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ self.runCmd('break set -p here')
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ self.runCmd("expr void* $foo = 0")
+
+ self.runCmd("continue")
+
+ self.expect("expr $foo", substrs=['$foo','0x0'])
diff --git a/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/main.c b/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/main.c
new file mode 100644
index 0000000..7334696
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/main.c
@@ -0,0 +1,11 @@
+void* foo(void *p)
+{
+ return p; // break here
+}
+
+int main() {
+ while (1) {
+ foo(0);
+ }
+ return 0;
+}
OpenPOWER on IntegriCloud