Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / tools / lldb-server / TestGdbRemoteKill.py
blob0a26a9e1fed4de885456a3f5ac8478b04b1feb18
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):
10 self.build()
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(
16 "read packet: $k#6b",
17 {"direction": "send", "regex": reg_expr},
19 True,
22 if self.stub_sends_two_stop_notifications_on_kill:
23 # Add an expectation for a second X result for stubs that send two
24 # of these.
25 self.test_sequence.add_log_lines(
27 {"direction": "send", "regex": reg_expr},
29 True,
32 self.expect_gdbremote_sequence()
34 # Wait a moment for completed and now-detached inferior process to
35 # clear.
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
44 # running.
45 self.assertFalse(
46 lldbgdbserverutils.process_is_running(procs["inferior"].pid, False)