Add a minimal mock server utilizing a pty, and add a client test
connecting to that server.
Details
Diff Detail
Event Timeline
@labath, this is the part where I ask for help ;-).
An exception happened when receiving the response from the gdb server. Closing the client... Traceback (most recent call last): File "/home/mgorny/git/llvm-project/lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py", line 405, in _run data = seven.bitcast_to_string(self._client.recv(4096)) File "/home/mgorny/git/llvm-project/lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py", line 538, in recv return self.read(size) OSError: [Errno 5] Input/output error PASS: LLDB (/home/mgorny/git/llvm-project/build/bin/clang-x86_64) :: test_process_connect_sync_dwarf (TestPty.TestPty)
I think it's getting in the 'controlling terminal' magic and getting EIO when lldb finishes or sth like that. Any suggestion how to avoid this exception?
Catch it and turn it into EOF? (btw, I've found this link to be pretty good at explaining the behavior across different OSs.)
lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py | ||
---|---|---|
618–623 | I think it would be cleaner if we had like a single new interface, which describes what to we expect of the connection, and then a socket- and pty-based implementation of that interface. | |
648–652 | I'm wondering if we should have an overload of SBTarget::ConnectRemote that accepts a file descriptor (or SBFile, SBCommunication, ...). This would make the socket case easier as well, and it seems like it could be generally useful. |
lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py | ||
---|---|---|
648–652 | I'm not saying 'no' but I think we'd still want to explicitly test process connect command somewhere. |
lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py | ||
---|---|---|
409 | Yes, it seems this way. If I close it early, the test hangs. |
Make it easier to override socket class at GDBRemoteTestBase level. Add async test, mark the whole class skipIfWindows.
I think this can be applied at class level