cdt-gdb-adapter icon indicating copy to clipboard operation
cdt-gdb-adapter copied to clipboard

Continues attempt to connect if GDB server terminated early

Open jreineckearm opened this issue 6 months ago • 0 comments

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: Image

It is understood we need to be extra cautious around the various supported scenarios (web vs desktop, local vs remote debug).

jreineckearm avatar Apr 25 '25 10:04 jreineckearm