1*8fa2394bSMichał Górnyimport lldb 2*8fa2394bSMichał Górnyfrom lldbsuite.test.lldbtest import * 3*8fa2394bSMichał Górnyfrom lldbsuite.test.decorators import * 4*8fa2394bSMichał Górnyfrom gdbclientutils import * 5*8fa2394bSMichał Górny 6*8fa2394bSMichał Górny 7*8fa2394bSMichał Górny@skipIfWindows 8*8fa2394bSMichał Górnyclass TestPty(GDBRemoteTestBase): 9*8fa2394bSMichał Górny mydir = TestBase.compute_mydir(__file__) 10*8fa2394bSMichał Górny server_socket_class = PtyServerSocket 11*8fa2394bSMichał Górny 12*8fa2394bSMichał Górny def test_process_connect_sync(self): 13*8fa2394bSMichał Górny """Test the process connect command in synchronous mode""" 14*8fa2394bSMichał Górny try: 15*8fa2394bSMichał Górny self.dbg.SetAsync(False) 16*8fa2394bSMichał Górny self.expect("platform select remote-gdb-server", 17*8fa2394bSMichał Górny substrs=['Platform: remote-gdb-server', 'Connected: no']) 18*8fa2394bSMichał Górny self.expect("process connect " + self.server.get_connect_url(), 19*8fa2394bSMichał Górny substrs=['Process', 'stopped']) 20*8fa2394bSMichał Górny finally: 21*8fa2394bSMichał Górny self.dbg.GetSelectedPlatform().DisconnectRemote() 22*8fa2394bSMichał Górny 23*8fa2394bSMichał Górny def test_process_connect_async(self): 24*8fa2394bSMichał Górny """Test the process connect command in asynchronous mode""" 25*8fa2394bSMichał Górny try: 26*8fa2394bSMichał Górny self.dbg.SetAsync(True) 27*8fa2394bSMichał Górny self.expect("platform select remote-gdb-server", 28*8fa2394bSMichał Górny substrs=['Platform: remote-gdb-server', 'Connected: no']) 29*8fa2394bSMichał Górny self.expect("process connect " + self.server.get_connect_url(), 30*8fa2394bSMichał Górny matching=False, 31*8fa2394bSMichał Górny substrs=['Process', 'stopped']) 32*8fa2394bSMichał Górny lldbutil.expect_state_changes(self, self.dbg.GetListener(), 33*8fa2394bSMichał Górny self.process(), [lldb.eStateStopped]) 34*8fa2394bSMichał Górny finally: 35*8fa2394bSMichał Górny self.dbg.GetSelectedPlatform().DisconnectRemote() 36