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.build() 45 self.vCont_supports_c() 46 47 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 48 @llgs_test 49 def test_vCont_supports_c_llgs(self): 50 self.build() 51 self.vCont_supports_c() 52 53 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 54 @debugserver_test 55 def test_vCont_supports_C_debugserver(self): 56 self.build() 57 self.vCont_supports_C() 58 59 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 60 @llgs_test 61 def test_vCont_supports_C_llgs(self): 62 self.build() 63 self.vCont_supports_C() 64 65 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 66 @debugserver_test 67 def test_vCont_supports_s_debugserver(self): 68 self.build() 69 self.vCont_supports_s() 70 71 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 72 @llgs_test 73 def test_vCont_supports_s_llgs(self): 74 self.build() 75 self.vCont_supports_s() 76 77 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 78 @debugserver_test 79 def test_vCont_supports_S_debugserver(self): 80 self.build() 81 self.vCont_supports_S() 82 83 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 84 @llgs_test 85 def test_vCont_supports_S_llgs(self): 86 self.build() 87 self.vCont_supports_S() 88 89 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 90 @debugserver_test 91 def test_single_step_only_steps_one_instruction_with_Hc_vCont_s_debugserver( 92 self): 93 self.build() 94 self.set_inferior_startup_launch() 95 self.single_step_only_steps_one_instruction( 96 use_Hc_packet=True, step_instruction="vCont;s") 97 98 @skipIfWindows # No pty support to test O* & I* notification packets. 99 @llgs_test 100 @skipIf(triple='^mips') 101 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 102 def test_single_step_only_steps_one_instruction_with_Hc_vCont_s_llgs(self): 103 self.build() 104 self.set_inferior_startup_launch() 105 self.single_step_only_steps_one_instruction( 106 use_Hc_packet=True, step_instruction="vCont;s") 107 108 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 109 @debugserver_test 110 def test_single_step_only_steps_one_instruction_with_vCont_s_thread_debugserver( 111 self): 112 self.build() 113 self.set_inferior_startup_launch() 114 self.single_step_only_steps_one_instruction( 115 use_Hc_packet=False, step_instruction="vCont;s:{thread}") 116 117 @skipIfWindows # No pty support to test O* & I* notification packets. 118 @llgs_test 119 @skipIf(triple='^mips') 120 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://27005337") 121 def test_single_step_only_steps_one_instruction_with_vCont_s_thread_llgs( 122 self): 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