summaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/functionalities/thread
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/thread')
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py31
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/main.cpp13
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py25
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py2
13 files changed, 72 insertions, 24 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/Makefile
new file mode 100644
index 000000000000..f0bcf9752de2
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/Makefile
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+CXXFLAGS += -std=c++11
+CXX_SOURCES := main.cpp
+ENABLE_THREADS := YES
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py b/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py
new file mode 100644
index 000000000000..4e595ea4c5f6
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py
@@ -0,0 +1,31 @@
+"""
+Test that the target.process.thread.max-backtrace-depth setting works.
+"""
+
+import unittest2
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class BacktraceLimitSettingTest(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ def test_backtrace_depth(self):
+ """Test that the max-backtrace-depth setting limits backtraces."""
+ self.build()
+ self.main_source_file = lldb.SBFileSpec("main.cpp")
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ "Set a breakpoint here", self.main_source_file)
+ interp = self.dbg.GetCommandInterpreter()
+ result = lldb.SBCommandReturnObject()
+ interp.HandleCommand("settings set target.process.thread.max-backtrace-depth 30", result)
+ self.assertEqual(True, result.Succeeded())
+ self.assertEqual(30, thread.GetNumFrames())
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/main.cpp b/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/main.cpp
new file mode 100644
index 000000000000..eca1eadc8e45
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/main.cpp
@@ -0,0 +1,13 @@
+int bottom () {
+ return 1; // Set a breakpoint here
+}
+int foo(int in) {
+ if (in > 0)
+ return foo(--in) + 5;
+ else
+ return bottom();
+}
+int main()
+{
+ return foo(500);
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py b/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
index b20b738825a2..fa96db06a59d 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
@@ -20,7 +20,6 @@ class CrashDuringStepTestCase(TestBase):
TestBase.setUp(self)
self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
# IO error due to breakpoint at invalid address
@expectedFailureAll(triple=re.compile('^mips'))
def test_step_inst_with(self):
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py b/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
index 3f26d8c76579..2afa77d34b5e 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
@@ -23,7 +23,6 @@ class CreateAfterAttachTestCase(TestBase):
# Occasionally hangs on Windows, may be same as other issues.
@skipIfWindows
@skipIfiOSSimulator
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_create_after_attach_with_popen(self):
"""Test thread creation after process attach."""
self.build(dictionary=self.getBuildFlags(use_cpp11=False))
@@ -34,7 +33,6 @@ class CreateAfterAttachTestCase(TestBase):
@skipIfRemote
@skipIfWindows # Windows doesn't have fork.
@skipIfiOSSimulator
- @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_create_after_attach_with_fork(self):
"""Test thread creation after process attach."""
self.build(dictionary=self.getBuildFlags(use_cpp11=False))
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
index c62990ccc93a..76c2c47da2cf 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
@@ -23,9 +23,6 @@ class ExitDuringBreakpointTestCase(TestBase):
# Find the line number for our breakpoint.
self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
- @expectedFailureAll(
- oslist=["linux"],
- bugnumber="llvm.org/pr15824 thread states not properly maintained")
def test(self):
"""Test thread exit during breakpoint handling."""
self.build(dictionary=self.getBuildFlags())
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
index 0343a888a0f1..76488a7185de 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
@@ -18,6 +18,7 @@ class ExitDuringStepTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIfFreeBSD # llvm.org/pr21411: test is hanging
+ @skipIfWindows # This is flakey on Windows: llvm.org/pr38373
def test(self):
"""Test thread exit during step handling."""
self.build(dictionary=self.getBuildFlags())
@@ -27,6 +28,7 @@ class ExitDuringStepTestCase(TestBase):
True)
@skipIfFreeBSD # llvm.org/pr21411: test is hanging
+ @skipIfWindows # This is flakey on Windows: llvm.org/pr38373
def test_step_over(self):
"""Test thread exit during step-over handling."""
self.build(dictionary=self.getBuildFlags())
@@ -36,6 +38,7 @@ class ExitDuringStepTestCase(TestBase):
False)
@skipIfFreeBSD # llvm.org/pr21411: test is hanging
+ @skipIfWindows # This is flakey on Windows: llvm.org/pr38373
def test_step_in(self):
"""Test thread exit during step-in handling."""
self.build(dictionary=self.getBuildFlags())
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py b/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
index 3300078e8c60..7194dafe0ac1 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
@@ -17,7 +17,6 @@ class ThreadJumpTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test(self):
"""Test thread jump handling."""
self.build(dictionary=self.getBuildFlags())
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
index cff9b5a8d5e5..3d7e26816f84 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
@@ -32,9 +32,7 @@ class MultipleBreakpointTestCase(TestBase):
@expectedFailureAll(
oslist=["freebsd"],
bugnumber="llvm.org/pr18190 thread states not properly maintained")
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
+ @skipIfWindows # This is flakey on Windows: llvm.org/pr24668, llvm.org/pr38373
def test(self):
"""Test simultaneous breakpoints in multiple threads."""
self.build(dictionary=self.getBuildFlags())
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py b/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
index 724b9d8be907..9aa4a831a745 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
@@ -64,7 +64,7 @@ class NumberOfThreadsTestCase(TestBase):
'Number of expected threads and actual threads do not match.')
@skipIfDarwin # rdar://33462362
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37658")
+ @skipIfWindows # This is flakey on Windows: llvm.org/pr37658, llvm.org/pr38373
def test_unique_stacks(self):
"""Test backtrace unique with multiple threads executing the same stack."""
self.build()
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py b/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
index 0cbd94e199dc..4b1247316e18 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
@@ -52,17 +52,6 @@ class ThreadStateTestCase(TestBase):
self.thread_state_after_expression_test()
# thread states not properly maintained
- @unittest2.expectedFailure("llvm.org/pr16712")
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
- @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and <rdar://problem/28557237>
- def test_process_interrupt(self):
- """Test process interrupt."""
- self.build(dictionary=self.getBuildFlags(use_cpp11=False))
- self.process_interrupt_test()
-
- # thread states not properly maintained
@unittest2.expectedFailure("llvm.org/pr15824 and <rdar://problem/28557237>")
@expectedFailureAll(
oslist=["windows"],
@@ -198,13 +187,19 @@ class ThreadStateTestCase(TestBase):
# Let the process run to completion
self.runCmd("process continue")
- def process_interrupt_test(self):
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
+ @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and <rdar://problem/28557237>
+ @no_debug_info_test
+ def test_process_interrupt(self):
"""Test process interrupt and continue."""
+ self.build(dictionary=self.getBuildFlags(use_cpp11=False))
exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
- lldbutil.run_break_set_by_file_and_line(
+ bpno = lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.break_1, num_expected_locations=1)
# Run the program.
@@ -218,6 +213,10 @@ class ThreadStateTestCase(TestBase):
process, lldb.eStopReasonBreakpoint)
self.assertIsNotNone(thread)
+ # Remove the breakpoint to avoid the single-step-over-bkpt dance in the
+ # "continue" below
+ self.assertTrue(target.BreakpointDelete(bpno))
+
# Continue, the inferior will go into an infinite loop waiting for
# 'g_test' to change.
self.dbg.SetAsync(True)
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py b/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py
index 238b18837884..e786e8d7ff1e 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py
@@ -25,6 +25,7 @@ class ThreadStepOutTestCase(TestBase):
@expectedFailureAll(
oslist=["freebsd"],
bugnumber="llvm.org/pr18066 inferior does not exit")
+ @skipIfWindows # This test will hang on windows llvm.org/pr21753
@expectedFailureAll(oslist=["windows"])
def test_step_single_thread(self):
"""Test thread step out on one thread via command interpreter. """
@@ -39,6 +40,7 @@ class ThreadStepOutTestCase(TestBase):
@expectedFailureAll(
oslist=["freebsd"],
bugnumber="llvm.org/pr19347 2nd thread stops at breakpoint")
+ @skipIfWindows # This test will hang on windows llvm.org/pr21753
@expectedFailureAll(oslist=["windows"])
@expectedFailureAll(oslist=["watchos"], archs=['armv7k'], bugnumber="rdar://problem/34674488") # stop reason is trace when it should be step-out
def test_step_all_threads(self):
@@ -54,6 +56,7 @@ class ThreadStepOutTestCase(TestBase):
@expectedFailureAll(
oslist=["freebsd"],
bugnumber="llvm.org/pr19347 2nd thread stops at breakpoint")
+ @skipIfWindows # This test will hang on windows llvm.org/pr21753
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24681")
def test_python(self):
"""Test thread step out on one thread via Python API (dwarf)."""
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py b/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
index 07ceb3f5f6b7..c8b6e675b8a9 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
@@ -8,6 +8,7 @@ from __future__ import print_function
import os
import time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
@@ -25,6 +26,7 @@ class ThreadExitTestCase(TestBase):
self.break_3 = line_number('main.cpp', '// Set third breakpoint here')
self.break_4 = line_number('main.cpp', '// Set fourth breakpoint here')
+ @skipIfWindows # This is flakey on Windows: llvm.org/pr38373
def test(self):
"""Test thread exit handling."""
self.build(dictionary=self.getBuildFlags())