199451b44SJordan Rupprechtimport gdbremote_testcase 299451b44SJordan Rupprechtfrom lldbsuite.test.decorators import * 399451b44SJordan Rupprechtfrom lldbsuite.test.lldbtest import * 499451b44SJordan Rupprechtfrom lldbsuite.test import lldbutil 599451b44SJordan Rupprecht 699451b44SJordan Rupprecht 7*2238dcc3SJonas Devlieghereclass TestGdbRemote_vCont(gdbremote_testcase.GdbRemoteTestCaseBase): 899451b44SJordan Rupprecht def vCont_supports_mode(self, mode, inferior_args=None): 999451b44SJordan Rupprecht # Setup the stub and set the gdb remote command stream. 10*2238dcc3SJonas Devlieghere procs = self.prep_debug_monitor_and_inferior(inferior_args=inferior_args) 1199451b44SJordan Rupprecht self.add_vCont_query_packets() 1299451b44SJordan Rupprecht 1399451b44SJordan Rupprecht # Run the gdb remote command stream. 1499451b44SJordan Rupprecht context = self.expect_gdbremote_sequence() 1599451b44SJordan Rupprecht self.assertIsNotNone(context) 1699451b44SJordan Rupprecht 1799451b44SJordan Rupprecht # Pull out supported modes. 1899451b44SJordan Rupprecht supported_vCont_modes = self.parse_vCont_query_response(context) 1999451b44SJordan Rupprecht self.assertIsNotNone(supported_vCont_modes) 2099451b44SJordan Rupprecht 2199451b44SJordan Rupprecht # Verify we support the given mode. 223cc37622SDave Lee self.assertIn(mode, supported_vCont_modes) 2399451b44SJordan Rupprecht 2454a1c861SPavel Labath def test_vCont_supports_c(self): 2554a1c861SPavel Labath self.build() 2699451b44SJordan Rupprecht self.vCont_supports_mode("c") 2799451b44SJordan Rupprecht 2854a1c861SPavel Labath def test_vCont_supports_C(self): 2954a1c861SPavel Labath self.build() 3099451b44SJordan Rupprecht self.vCont_supports_mode("C") 3199451b44SJordan Rupprecht 3254a1c861SPavel Labath def test_vCont_supports_s(self): 3354a1c861SPavel Labath self.build() 3499451b44SJordan Rupprecht self.vCont_supports_mode("s") 3599451b44SJordan Rupprecht 3654a1c861SPavel Labath def test_vCont_supports_S(self): 3754a1c861SPavel Labath self.build() 3899451b44SJordan Rupprecht self.vCont_supports_mode("S") 3999451b44SJordan Rupprecht 40f1dcc6afSMichał Górny @add_test_categories(["llgs"]) 41b4f2d7cdSMichał Górny def test_vCont_supports_t(self): 42b4f2d7cdSMichał Górny self.build() 43b4f2d7cdSMichał Górny self.vCont_supports_mode("t") 44b4f2d7cdSMichał Górny 4554a1c861SPavel Labath @skipIfWindows # No pty support to test O* & I* notification packets. 46*2238dcc3SJonas Devlieghere @skipIf(triple="^mips") 4754a1c861SPavel Labath def test_single_step_only_steps_one_instruction_with_Hc_vCont_s(self): 4899451b44SJordan Rupprecht self.build() 4999451b44SJordan Rupprecht self.set_inferior_startup_launch() 5099451b44SJordan Rupprecht self.single_step_only_steps_one_instruction( 51*2238dcc3SJonas Devlieghere use_Hc_packet=True, step_instruction="vCont;s" 52*2238dcc3SJonas Devlieghere ) 5399451b44SJordan Rupprecht 5499451b44SJordan Rupprecht @skipIfWindows # No pty support to test O* & I* notification packets. 55*2238dcc3SJonas Devlieghere @skipIf(triple="^mips") 5654a1c861SPavel Labath def test_single_step_only_steps_one_instruction_with_vCont_s_thread(self): 5799451b44SJordan Rupprecht self.build() 5899451b44SJordan Rupprecht self.set_inferior_startup_launch() 5999451b44SJordan Rupprecht self.single_step_only_steps_one_instruction( 60*2238dcc3SJonas Devlieghere use_Hc_packet=False, step_instruction="vCont;s:{thread}" 61*2238dcc3SJonas Devlieghere ) 62