Community
Participate
Working Groups
Created attachment 186797 [details] Fix. This problem is caused by the race condition between the shutdown sequence and the threads that monitor the inferior and gdb processes. The easiest way to reproduce it is to set breakpoints: 1. at the beginning of "handleCompleted()" call in "GdbLaunch.shutdownSession()" 2. at the beginning of "RuntimeProcess.terminated()" Start a session and let it run to the end. Both breakpoints will hit at the same time. Resume the thread for "handleCompleted()" first and then two other threads. The launch's label is not marked as terminated and the toolbar actions are not updated: "Terminate" is enabled and "RemoveAllTerminated" is disabled.
Nice! Half of the fix is in DSF so Pawel should probably have a look.
Pawel, please take a look.
Marc, not sure what to do with this patch. Pawel seems to be busy. I can modify the patch by fixing it for DSF/GDB only, or we can go ahead with the existing one.
(In reply to comment #3) > Marc, not sure what to do with this patch. Pawel seems to be busy. > I can modify the patch by fixing it for DSF/GDB only, or we can go ahead with > the existing one. I don't fully understand the delta stuff, so let me ask a couple of questions: - how come we need to check for DebugEvent.TERMINATE although we also check for LaunchesEvent.Type.TERMINATED? - if we need to check for DebugEvent.TERMINATE, how come you don't need to set the IModelDelta.CONTENT flag like it is done in the case of LaunchesEvent.Type.TERMINATED? I think the change is safe, so I think it is ok for DSF. The worst case is probably some unnecessary refreshes.
Created attachment 187669 [details] Modified patch.
(In reply to comment #4) > I don't fully understand the delta stuff, so let me ask a couple of questions: > - how come we need to check for DebugEvent.TERMINATE although we also check for > LaunchesEvent.Type.TERMINATED? You're right. I changed the delta part first, to update the launch label, but it didn't fix the actions issue. The GdbLaunch fix is sufficient.
Applied to the HEAD.
(In reply to comment #6) > I changed the delta part first, to update the launch label, but > it didn't fix the actions issue. The GdbLaunch fix is sufficient. It's nice when things work out so easily :-)
*** cdt cvs genie on behalf of mkhodjai *** Bug 334329 - Launch is not marked as 'terminated' when program exits. [*] GdbLaunch.java 1.12 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java?root=Tools_Project&r1=1.11&r2=1.12