summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2017-04-28 00:51:06 +0000
committerJim Ingham <jingham@apple.com>2017-04-28 00:51:06 +0000
commit7fca8c0757a5ee5f290844376c7f8c5f3c1ffcfe (patch)
tree8ffa218d59b3457f715da90aa94da0d32c87cd15 /lldb/packages/Python/lldbsuite/test
parentb242e93541f2332cd89ea7a919eec1ade7b57dc7 (diff)
downloadbcm5719-llvm-7fca8c0757a5ee5f290844376c7f8c5f3c1ffcfe.tar.gz
bcm5719-llvm-7fca8c0757a5ee5f290844376c7f8c5f3c1ffcfe.zip
Provide a mechanism to do some pre-loading of symbols up front.
Loading a shared library can require a large amount of work; rather than do that serially for each library, this patch will allow parallelization of the symbols and debug info name indexes. From scott.smith@purestorage.com https://reviews.llvm.org/D32598 llvm-svn: 301609
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py b/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
index 61a67dc1398..edc83bf5898 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
+++ b/lldb/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)
OpenPOWER on IntegriCloud