Community
Participate
Working Groups
If I do a remote attach session and then kill gdbserver before attaching to a process, the CDT session continues and becomes kind of local. To see the problem: 1- start gdbserver on a different machine than here eclipse runs: gdbserver --multi :9999 2- start a remote attach session to that gdbserver on the remote host 4- press the connect button and notice what is running on the remote 5- press cancel (do not attach) 6- kill gdbserver => nothing is seen in eclipse except a very discrete "Remote connection closed" in the gdb console 7- press the connect button and notice that now, the list of processes is from the host and not the remote target! GDB is doing some local debugging! If we kill gdbserver when we are attached to a process, the entire session dies. Maybe we should do the same thing in this case.
I suggest that we simply terminate the debug session if we loose the connection to the target. Since there is no way to re-connect to a target in a running session, the user will need to start a new session anyway. Terminating the current session will make it clear that debugging is no longer working. I'll post a patch.
I posted a patch to gerrit: https://git.eclipse.org/r/20286 The solution looks for "Remote connection closed" or "Ending remote debugging" in an out-of-band message, or as an error result to a command. When such strings are seen we know we lost the remote connection and we terminate the session. I've tested all-stop and non-stop for GDB >= 7.0. A different error message is given for GDB 6.8 which is not covered by this solution. However, this patch does not make this worse for 6.8, so I think it is fine. I don't want to spend time on very old GDB versions.
Committed to master from Gerrit.