aboutsummaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/lang/c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-02 18:31:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-02 18:31:19 +0000
commit773dd0e6e632d48d7123a321ba86f50847b9afc0 (patch)
treec6bd992bb1963df11f8de346d12a5a70c2e4deb2 /packages/Python/lldbsuite/test/lang/c
parent5060b64b7d79491d507a75201be161fd0c38fcbb (diff)
downloadsrc-773dd0e6e632d48d7123a321ba86f50847b9afc0.tar.gz
src-773dd0e6e632d48d7123a321ba86f50847b9afc0.zip
Vendor import of lldb trunk r301939:vendor/lldb/lldb-trunk-r301939
Notes
Notes: svn path=/vendor/lldb/dist/; revision=317692 svn path=/vendor/lldb/lldb-trunk-r301939/; revision=317693; tag=vendor/lldb/lldb-trunk-r301939
Diffstat (limited to 'packages/Python/lldbsuite/test/lang/c')
-rw-r--r--packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py b/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
index 61a67dc13987..edc83bf58985 100644
--- a/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
+++ b/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
@@ -13,14 +13,13 @@ class SharedLibTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- def test_expr(self):
- """Test that types work when defined in a shared library and forward-declared in the main executable"""
+ def common_test_expr(self, preload_symbols):
if "clang" in self.getCompiler() and "3.4" in self.getCompilerVersion():
self.skipTest(
"llvm.org/pr16214 -- clang emits partial DWARF for structures referenced via typedef")
self.build()
- self.common_setup()
+ self.common_setup(preload_symbols)
# This should display correctly.
self.expect(
@@ -31,6 +30,18 @@ class SharedLibTestCase(TestBase):
"(sub_foo)",
"other_element = 3"])
+ self.expect(
+ "expression GetMeASubFoo(my_foo_ptr)",
+ startstr="(sub_foo *) $")
+
+ def test_expr(self):
+ """Test that types work when defined in a shared library and forward-declared in the main executable"""
+ self.common_test_expr(True)
+
+ def test_expr_no_preload(self):
+ """Test that types work when defined in a shared library and forward-declared in the main executable, but with preloading disabled"""
+ self.common_test_expr(False)
+
@unittest2.expectedFailure("rdar://problem/10704639")
def test_frame_variable(self):
"""Test that types work when defined in a shared library and forward-declared in the main executable"""
@@ -54,7 +65,7 @@ class SharedLibTestCase(TestBase):
self.line = line_number(self.source, '// Set breakpoint 0 here.')
self.shlib_names = ["foo"]
- def common_setup(self):
+ def common_setup(self, preload_symbols = True):
# Run in synchronous mode
self.dbg.SetAsync(False)
@@ -62,6 +73,8 @@ class SharedLibTestCase(TestBase):
target = self.dbg.CreateTarget("a.out")
self.assertTrue(target, VALID_TARGET)
+ self.runCmd("settings set target.preload-symbols " + str(preload_symbols).lower())
+
# Break inside the foo function which takes a bar_ptr argument.
lldbutil.run_break_set_by_file_and_line(
self, self.source, self.line, num_expected_locations=1, loc_exact=True)