[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / lldb / packages / Python / lldbsuite / test / commands / process / attach-resume / TestAttachResume.py
blobb559f44a6b3df9fb628e0a84c864bad802bc2464
1 """
2 Test process attach/resume.
3 """
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
12 exe_name = "AttachResume" # Must match Makefile
15 class AttachResumeTestCase(TestBase):
17 mydir = TestBase.compute_mydir(__file__)
18 NO_DEBUG_INFO_TESTCASE = True
20 @skipIfRemote
21 @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr19310')
22 @expectedFailureNetBSD
23 @skipIfWindows # llvm.org/pr24778, llvm.org/pr21753
24 def test_attach_continue_interrupt_detach(self):
25 """Test attach/continue/interrupt/detach"""
26 self.build()
27 self.process_attach_continue_interrupt_detach()
29 def process_attach_continue_interrupt_detach(self):
30 """Test attach/continue/interrupt/detach"""
32 exe = self.getBuildArtifact(exe_name)
34 popen = self.spawnSubprocess(exe)
35 self.addTearDownHook(self.cleanupSubprocesses)
37 self.runCmd("process attach -p " + str(popen.pid))
39 self.setAsync(True)
40 listener = self.dbg.GetListener()
41 process = self.dbg.GetSelectedTarget().GetProcess()
43 self.runCmd("c")
44 lldbutil.expect_state_changes(
45 self, listener, process, [
46 lldb.eStateRunning])
48 self.runCmd("process interrupt")
49 lldbutil.expect_state_changes(
50 self, listener, process, [
51 lldb.eStateStopped])
53 # be sure to continue/interrupt/continue (r204504)
54 self.runCmd("c")
55 lldbutil.expect_state_changes(
56 self, listener, process, [
57 lldb.eStateRunning])
59 self.runCmd("process interrupt")
60 lldbutil.expect_state_changes(
61 self, listener, process, [
62 lldb.eStateStopped])
64 # Second interrupt should have no effect.
65 self.expect(
66 "process interrupt",
67 patterns=["Process is not running"],
68 error=True)
70 # check that this breakpoint is auto-cleared on detach (r204752)
71 self.runCmd("br set -f main.cpp -l %u" %
72 (line_number('main.cpp', '// Set breakpoint here')))
74 self.runCmd("c")
75 lldbutil.expect_state_changes(
76 self, listener, process, [
77 lldb.eStateRunning, lldb.eStateStopped])
78 self.expect('br list', 'Breakpoint not hit',
79 substrs=['hit count = 1'])
81 # Make sure the breakpoint is not hit again.
82 self.expect("expr debugger_flag = false", substrs=[" = false"])
84 self.runCmd("c")
85 lldbutil.expect_state_changes(
86 self, listener, process, [
87 lldb.eStateRunning])
89 # make sure to detach while in running state (r204759)
90 self.runCmd("detach")
91 lldbutil.expect_state_changes(
92 self, listener, process, [
93 lldb.eStateDetached])