cdt-gdb-adapter
cdt-gdb-adapter copied to clipboard
Continues attempt to connect if GDB server terminated early
Problem
Providing faulty input to a GDB server can cause it to terminate
- after the GDB server was at first successfully spawned...
- but before GDB tries to attempt the remote target connection.
This leaves the CDT GDB adapter in a state where the user sees the connection won't succeed. But they have to wait for the connection timeout.
Proposal
Still learning about the adapter in this area. But we should have information about the gdbserver having exited.
Hence, we should be able to terminate the debug session attempt earlier. Either event-driven or by polling the server state in GDBBackend::sendCommand. This should mitigate the above seen problems.
While at it, we should check the caught exception and see if we can transform the error message into something more useful. I see this on Windows which isn't very helpful to the average user in this situation:
It is understood we need to be extra cautious around the various supported scenarios (web vs desktop, local vs remote debug).