• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2# lldb test suite imports
3from lldbsuite.test.decorators import *
4from lldbsuite.test.lldbtest import TestBase
5
6# gdb-remote-specific imports
7import lldbgdbserverutils
8from gdbremote_testcase import GdbRemoteTestCaseBase
9
10
11class TestGdbRemoteExitCode(GdbRemoteTestCaseBase):
12
13    mydir = TestBase.compute_mydir(__file__)
14
15    def inferior_exit_0(self):
16        self.prep_debug_monitor_and_inferior()
17        self.test_sequence.add_log_lines(
18            ["read packet: $vCont;c#a8",
19             "send packet: $W00#00"],
20            True)
21
22        self.expect_gdbremote_sequence()
23
24    @debugserver_test
25    @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
26    def test_inferior_exit_0_debugserver(self):
27        self.init_debugserver_test()
28        self.build()
29        self.inferior_exit_0()
30
31    @llgs_test
32    def test_inferior_exit_0_llgs(self):
33        self.init_llgs_test()
34        self.build()
35        self.inferior_exit_0()
36
37    def inferior_exit_42(self):
38        RETVAL = 42
39
40        procs = self.prep_debug_monitor_and_inferior(
41            inferior_args=["retval:%d" % RETVAL])
42
43        self.test_sequence.add_log_lines(
44            ["read packet: $vCont;c#a8",
45             "send packet: $W{0:02x}#00".format(RETVAL)],
46            True)
47
48        self.expect_gdbremote_sequence()
49
50    @debugserver_test
51    @skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
52    def test_inferior_exit_42_debugserver(self):
53        self.init_debugserver_test()
54        self.build()
55        self.inferior_exit_42()
56
57    @llgs_test
58    def test_inferior_exit_42_llgs(self):
59        self.init_llgs_test()
60        self.build()
61        self.inferior_exit_42()
62