aboutsummaryrefslogtreecommitdiff
path: root/packages/Python
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python')
-rw-r--r--packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py21
-rw-r--r--packages/Python/lldbsuite/test/make/Android.rules1
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py12
3 files changed, 28 insertions, 6 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)
diff --git a/packages/Python/lldbsuite/test/make/Android.rules b/packages/Python/lldbsuite/test/make/Android.rules
index 3e6a093f4bae..058401f425ad 100644
--- a/packages/Python/lldbsuite/test/make/Android.rules
+++ b/packages/Python/lldbsuite/test/make/Android.rules
@@ -63,6 +63,7 @@ endif
GCC_TOOLCHAIN = $(NDK_ROOT)/toolchains/$(TOOLCHAIN_DIR)/prebuilt/$(HOST_TAG)
OBJCOPY ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-objcopy
+ARCHIVER ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-ar
ifeq "$(findstring clang,$(CC))" "clang"
ARCH_CFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN)
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py b/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
index b4e90c71721c..4e03d557b7a9 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
@@ -319,8 +319,16 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase):
# -exec-step can keep us in the g_MyFunction for gcc
self.runCmd("-exec-finish --frame 0")
self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"")
+ it = self.expect(["\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"",
+ "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\""])
+
+ if it == 1:
+ # Call to s_MyFunction may not follow immediately after g_MyFunction.
+ # There might be some instructions in between to restore caller-saved registers.
+ # We need to get past these instructions with a next to reach call to s_MyFunction.
+ self.runCmd("-exec-next --thread 1")
+ self.expect("\^running")
+ self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"")
# Test that -exec-step steps into s_MyFunction
# (and that --frame is optional)