Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334820

Summary: [debug view][launch] ILauchesListener2.launchesTerminated() not triggered for short execution launches.
Product: [Eclipse Project] Platform Reporter: Severin Gehwolf <sgehwolf>
Component: DebugAssignee: Platform-Debug-Inbox <platform-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie, overholt, pawel.1.piech, sgehwolf
Version: 3.6.1Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug
Bug Depends on:    
Bug Blocks: 334826    

Description Severin Gehwolf CLA 2011-01-19 14:04:21 EST
We've code something along the lines of:

        @Override
	protected void postExec(LaunchOptions options, OprofileDaemonEvent[] daemonEvents, ILaunch launch, Process process) {
		//add a listener for termination of the launch
		ILaunchManager lmgr = DebugPlugin.getDefault().getLaunchManager();
		lmgr.addLaunchListener(new LaunchTerminationWatcher(launch));
	}
	
	// A class used to listen for the termination of the current launch, and 
	// run some functions when it is finished. 
	class LaunchTerminationWatcher implements ILaunchesListener2 {
		private ILaunch launch;
		public LaunchTerminationWatcher(ILaunch il) {
			launch = il;
		}
		public void launchesTerminated(ILaunch[] launches) {
                      // do something
                      System.out.println('TERMINATED');
                }
                // other ILauchesListener2 methods required to implement
        }

Code in postExec is executed, but when the execution of the "launch" is quick enough (< 1 sec.) and has finished, the registered listener is never notified. The listener is in notified if execution of the launch lasts longer than a certain threshold.
Comment 1 Pawel Piech CLA 2011-06-08 14:36:05 EDT
This shows up in Wind River product too.
Comment 2 Severin Gehwolf CLA 2011-06-08 14:46:18 EDT
Added Andrew on cc.
Comment 3 Lars Vogel CLA 2019-11-14 03:39:59 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.