1 import gdbremote_testcase
2 import lldbgdbserverutils
3 from lldbsuite
.test
.decorators
import *
4 from lldbsuite
.test
.lldbtest
import *
5 from lldbsuite
.test
import lldbutil
8 class TestGdbRemoteKill(gdbremote_testcase
.GdbRemoteTestCaseBase
):
9 def test_attach_commandline_kill_after_initial_stop(self
):
11 self
.set_inferior_startup_attach()
12 reg_expr
= r
"^\$[XW][0-9a-fA-F]+([^#]*)#[0-9A-Fa-f]{2}"
13 procs
= self
.prep_debug_monitor_and_inferior()
14 self
.test_sequence
.add_log_lines(
17 {"direction": "send", "regex": reg_expr
},
22 if self
.stub_sends_two_stop_notifications_on_kill
:
23 # Add an expectation for a second X result for stubs that send two
25 self
.test_sequence
.add_log_lines(
27 {"direction": "send", "regex": reg_expr
},
32 self
.expect_gdbremote_sequence()
34 # Wait a moment for completed and now-detached inferior process to
36 time
.sleep(self
.DEFAULT_SLEEP
)
38 if not lldb
.remote_platform
:
39 # Process should be dead now. Reap results.
40 poll_result
= procs
["inferior"].poll()
41 self
.assertIsNotNone(poll_result
)
43 # Where possible, verify at the system level that the process is not
46 lldbgdbserverutils
.process_is_running(procs
["inferior"].pid
, False)