summaryrefslogtreecommitdiffstats
path: root/lldb/test/expression_command
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2015-07-20 16:55:19 +0000
committerSean Callanan <scallanan@apple.com>2015-07-20 16:55:19 +0000
commitabe140cc3169d16be7b35eb3a83d1f5d7c73c246 (patch)
treef6b749ad8163a6d17307bca56b6206a2e33f4400 /lldb/test/expression_command
parent205c333c99fadad177d4e009111978c979ce38ab (diff)
downloadbcm5719-llvm-abe140cc3169d16be7b35eb3a83d1f5d7c73c246.tar.gz
bcm5719-llvm-abe140cc3169d16be7b35eb3a83d1f5d7c73c246.zip
Eliminated a potential infinite recursion in structure layout when the origin
for a CXXRecordDecl gets pointed at that record. This can happen when a type is imported out of and then into the target's AST context without being laid out. Also added a testcase that covers this scenario. <rdar://problem/21844453> llvm-svn: 242687
Diffstat (limited to 'lldb/test/expression_command')
-rw-r--r--lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py b/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py
new file mode 100644
index 00000000000..ced03350b8a
--- /dev/null
+++ b/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py
@@ -0,0 +1,43 @@
+"""
+Test that nested persistent types work.
+"""
+
+import os, time
+import unittest2
+import lldb
+from lldbtest import *
+
+class NestedPersistentTypesTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def test_persistent_types(self):
+ """Test that nested persistent types work."""
+ self.buildDefault()
+
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ self.runCmd("breakpoint set --name main")
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ self.runCmd("expression struct $foo { int a; int b; };")
+
+ self.runCmd("expression struct $bar { struct $foo start; struct $foo end; };")
+
+ self.runCmd("expression struct $bar $my_bar = {{ 2, 3 }, { 4, 5 }};")
+
+ self.expect("expression $my_bar",
+ substrs = ['a = 2', 'b = 3', 'a = 4', 'b = 5'])
+
+ self.expect("expression $my_bar.start.b",
+ substrs = ['(int)', '3'])
+
+ self.expect("expression $my_bar.end.b",
+ substrs = ['(int)', '5'])
+
+if __name__ == '__main__':
+ import atexit
+ lldb.SBDebugger.Initialize()
+ atexit.register(lambda: lldb.SBDebugger.Terminate())
+ unittest2.main()
OpenPOWER on IntegriCloud