1
2import gdbremote_testcase
3from lldbsuite.test.decorators import *
4from lldbsuite.test.lldbtest import *
5from lldbsuite.test import lldbutil
6
7
8class TestGdbRemote_vCont(gdbremote_testcase.GdbRemoteTestCaseBase):
9
10    mydir = TestBase.compute_mydir(__file__)
11
12    def vCont_supports_mode(self, mode, inferior_args=None):
13        # Setup the stub and set the gdb remote command stream.
14        procs = self.prep_debug_monitor_and_inferior(
15            inferior_args=inferior_args)
16        self.add_vCont_query_packets()
17
18        # Run the gdb remote command stream.
19        context = self.expect_gdbremote_sequence()
20        self.assertIsNotNone(context)
21
22        # Pull out supported modes.
23        supported_vCont_modes = self.parse_vCont_query_response(context)
24        self.assertIsNotNone(supported_vCont_modes)
25
26        # Verify we support the given mode.
27        self.assertTrue(mode in supported_vCont_modes)
28
29    def vCont_supports_c(self):
30        self.vCont_supports_mode("c")
31
32    def vCont_supports_C(self):
33        self.vCont_supports_mode("C")
34
35    def vCont_supports_s(self):
36        self.vCont_supports_mode("s")
37
38    def vCont_supports_S(self):
39        self.vCont_supports_mode("S")
40
41    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
42    @debugserver_test
43    def test_vCont_supports_c_debugserver(self):
44        self.init_debugserver_test()
45        self.build()
46        self.vCont_supports_c()
47
48    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
49    @llgs_test
50    def test_vCont_supports_c_llgs(self):
51        self.init_llgs_test()
52        self.build()
53        self.vCont_supports_c()
54
55    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
56    @debugserver_test
57    def test_vCont_supports_C_debugserver(self):
58        self.init_debugserver_test()
59        self.build()
60        self.vCont_supports_C()
61
62    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
63    @llgs_test
64    def test_vCont_supports_C_llgs(self):
65        self.init_llgs_test()
66        self.build()
67        self.vCont_supports_C()
68
69    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
70    @debugserver_test
71    def test_vCont_supports_s_debugserver(self):
72        self.init_debugserver_test()
73        self.build()
74        self.vCont_supports_s()
75
76    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
77    @llgs_test
78    def test_vCont_supports_s_llgs(self):
79        self.init_llgs_test()
80        self.build()
81        self.vCont_supports_s()
82
83    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
84    @debugserver_test
85    def test_vCont_supports_S_debugserver(self):
86        self.init_debugserver_test()
87        self.build()
88        self.vCont_supports_S()
89
90    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
91    @llgs_test
92    def test_vCont_supports_S_llgs(self):
93        self.init_llgs_test()
94        self.build()
95        self.vCont_supports_S()
96
97    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
98    @debugserver_test
99    def test_single_step_only_steps_one_instruction_with_Hc_vCont_s_debugserver(
100            self):
101        self.init_debugserver_test()
102        self.build()
103        self.set_inferior_startup_launch()
104        self.single_step_only_steps_one_instruction(
105            use_Hc_packet=True, step_instruction="vCont;s")
106
107    @skipIfWindows # No pty support to test O* & I* notification packets.
108    @llgs_test
109    @skipIf(triple='^mips')
110    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
111    def test_single_step_only_steps_one_instruction_with_Hc_vCont_s_llgs(self):
112        self.init_llgs_test()
113        self.build()
114        self.set_inferior_startup_launch()
115        self.single_step_only_steps_one_instruction(
116            use_Hc_packet=True, step_instruction="vCont;s")
117
118    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
119    @debugserver_test
120    def test_single_step_only_steps_one_instruction_with_vCont_s_thread_debugserver(
121            self):
122        self.init_debugserver_test()
123        self.build()
124        self.set_inferior_startup_launch()
125        self.single_step_only_steps_one_instruction(
126            use_Hc_packet=False, step_instruction="vCont;s:{thread}")
127
128    @skipIfWindows # No pty support to test O* & I* notification packets.
129    @llgs_test
130    @skipIf(triple='^mips')
131    @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337")
132    def test_single_step_only_steps_one_instruction_with_vCont_s_thread_llgs(
133            self):
134        self.init_llgs_test()
135        self.build()
136        self.set_inferior_startup_launch()
137        self.single_step_only_steps_one_instruction(
138            use_Hc_packet=False, step_instruction="vCont;s:{thread}")
139