Community
Participate
Working Groups
Test case: in the Debugger tab, change gdb to gdb1. Launch the configuration. It starts gdbserver, and later fails on starting gdb. Launch doesn't get created, but gdbserver is still running on the remote host. Maybe anyone has an idea how to fix this issue properly? In our current implementation, we just launch gdbserver and our application and forget about them.
This could probably also happen for other reason, like if a wrong version of GDB is used and it fails to connect to gdbserver; or maybe GDB will start but something else will fail in the launch before GDB connects to gdbserver. I think the launch should kill gdbserver using RSE when it shutsdown.
Mark, do you have any idea maybe how to implement it properly? Because in the remote launcher we launch the gdbserver and give control to the DSF/CDI CDT launcher and that's it.
(In reply to comment #2) > Mark, do you have any idea maybe how to implement it properly? > Because in the remote launcher we launch the gdbserver and give control to the > DSF/CDI CDT launcher and that's it. Can you store the remote pid? Then you could use RSE to kill it. But I've never really used RSE much, so I don't know what is possible
We can create a wrapper around the command and read the PID back, I just thought maybe you have a better idea. (In reply to comment #3) > (In reply to comment #2) > > Mark, do you have any idea maybe how to implement it properly? > > Because in the remote launcher we launch the gdbserver and give control to the > > DSF/CDI CDT launcher and that's it. > > Can you store the remote pid? Then you could use RSE to kill it. But I've > never really used RSE much, so I don't know what is possible
Created attachment 196466 [details] proposed solution Here is the solution via "ps x". Marc, could you please take a look? Thanks!
Created attachment 196606 [details] Another suggestion How about this? It simply destroys the process created by RSE. I haven't done detailed tests, but it seems to work for simple tests at least. I just did it for DSF-GDB as you can see. What do you think?
(In reply to comment #6) > Created attachment 196606 [details] > Another suggestion > > How about this? It simply destroys the process created by RSE. I haven't done > detailed tests, but it seems to work for simple tests at least. > > I just did it for DSF-GDB as you can see. > > What do you think? Works for me, let's go this route.
Created attachment 196681 [details] Final fix (In reply to comment #6) > Created attachment 196606 [details] > Another suggestion > > How about this? It simply destroys the process created by RSE. I haven't done > detailed tests, but it seems to work for simple tests at least. > > I just did it for DSF-GDB as you can see. > > What do you think? Funny, the solution was already done for CDI. I committed the attached patch to HEAD.
Ted, can you review?
*** cdt cvs genie on behalf of mkhouzam *** Bug 320839 - If gdb cannot be started for some reason, gdbserver doesn't get killed on target. [*] RemoteGdbLaunchDelegate.java 1.3 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java?root=Tools_Project&r1=1.2&r2=1.3