Bug 434245 - Failed to launch run / debug configurations are not added to the "Run/Debug History"
Summary: Failed to launch run / debug configurations are not added to the "Run/Debug H...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.4 RC2   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 437122
  Show dependency tree
 
Reported: 2014-05-06 13:16 EDT by Thirumala Reddy Mutchukota CLA
Modified: 2014-06-11 08:20 EDT (History)
5 users (show)

See Also:
Michael_Rennie: review+
curtis.windatt.public: review+


Attachments
Even the failed launch configuration is added to history (1.29 KB, patch)
2014-05-09 02:10 EDT, Sarika Sinha CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thirumala Reddy Mutchukota CLA 2014-05-06 13:16:58 EDT
When I run a "run configuration", it takes the first position in the "Run history", and I can run it again by clicking the "Run" button or pressing CTRL-F11.

However, if the "Build before launch" is failed and the run configuration is failed to launch, then the Run history remain unchanged. I would prefer if it always went into the history, regardless of the outcome of the build. Indeed, if the build failed, I'm going to try to fix it and run again. I cannot count the number of times that I fixed an error, press CTRL+F11, and see that what is running is not what I wanted.

Please add the "run configuration" to the history irrespective of the outcome of the launch.
Comment 1 Sarika Sinha CLA 2014-05-09 02:10:15 EDT
Created attachment 242879 [details]
Even the failed launch configuration is added to history

Launch Configuration was getting added to history only if launch happens, moved it before the final check of build and launch check. Now the launch gets added to the history just after its initialization.
Comment 2 Thirumala Reddy Mutchukota CLA 2014-05-09 02:39:54 EDT
Thanks for the quick response Sarika.
Comment 3 Curtis Windatt CLA 2014-05-21 10:36:51 EDT
+1 Works great when the build is cancelled/failed.  Pushed to master.

http://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=c10f25b68cf60b1a0100f98eab3041619c3262cb
Comment 4 Thirumala Reddy Mutchukota CLA 2014-05-21 15:30:30 EDT
Thanks you very much Sarika for taking care of it.
Comment 5 Sarika Sinha CLA 2014-05-23 02:26:47 EDT
Verified using:
Eclipse SDK

Version: Luna (4.4)
Build id: I20140522-1330
Comment 6 Dobrin Alexiev CLA 2014-06-09 16:51:59 EDT
I believe this change introduced the issue I've just reported in the platform-debug mailing list:


In the latest Luna RC3 If I modify a Java Source file and click on the “Debug” button, a dialog “Save and Launch” is popped up asking me to save the file before the debug session starts. If I click on the “cancel” button there is a left over node in my debug view. If I do that few times my debug view becomes pretty cluttered and there is no way to remove these launches. 

After spending some time debugging the issue I believe that the odd behavior is due to a recent (three weeks ago) change in LaunchConfiguration.java: the code that adds the new launch is moved earlier inside the launch() function. Is this intentional?  It looks like if preLaunchCheck() returns false, the new launch is kept in the list of launches. Before the change if preLaunchCheck() returns false, the new launch was not added to that list. 

Other that the strange behavior that I am reporting (left over launches in the debug view) I wander if adding the launch before preLaunchCheck() is a incompatible code change. My launch delegate was surprised to see that the new launch object is already in that collection. In that case if there is a need for the newly object to be in the list of launches that early, how would the launch configuration know that this is the newly created launch. 

Please advise. 
Dobrin
Comment 7 Sarika Sinha CLA 2014-06-10 09:37:30 EDT
(In reply to Dobrin Alexiev from comment #6)
> I believe this change introduced the issue I've just reported in the
> platform-debug mailing list:
> 
> 
> In the latest Luna RC3 If I modify a Java Source file and click on the
> “Debug” button, a dialog “Save and Launch” is popped up asking me to save
> the file before the debug session starts. If I click on the “cancel” button
> there is a left over node in my debug view. If I do that few times my debug
> view becomes pretty cluttered and there is no way to remove these launches. 
> 
> After spending some time debugging the issue I believe that the odd behavior
> is due to a recent (three weeks ago) change in LaunchConfiguration.java: the
> code that adds the new launch is moved earlier inside the launch() function.
> Is this intentional?  It looks like if preLaunchCheck() returns false, the
> new launch is kept in the list of launches. Before the change if
> preLaunchCheck() returns false, the new launch was not added to that list. 
> 
> Other that the strange behavior that I am reporting (left over launches in
> the debug view) I wander if adding the launch before preLaunchCheck() is a
> incompatible code change. My launch delegate was surprised to see that the
> new launch object is already in that collection. In that case if there is a
> need for the newly object to be in the list of launches that early, how
> would the launch configuration know that this is the newly created launch. 
> 
> Please advise. 
> Dobrin

I tried reproducing the steps with 
Eclipse SDK
Version: Luna (4.4)
Build id: I20140604-2000,
 Debug view does add a new launch configuration when we cancel the "Save and Launch" dialog. But after repeating this act it doesn't add the launch multiple times and I was able to delete the new launch configuration from Run and Debug Configuration Dialog.
It will be great if you elaborate on the step or some special environment in which this is happening.
Comment 8 Dobrin Alexiev CLA 2014-06-10 10:11:08 EDT
Thank you for the prompt response!

Here are the steps to reproduce the issue:
On Windows 7 download and unzip Eclipse “Standard 4.4 RC3 Windows 32 bit” from the site: http://www.eclipse.org/downloads/index-developer.php?Luna
Start eclipse.exe 
Create a new plugin project. 
Open and modify of the java source files. Do not save it. 
Open the “Debug Configuration” dialog. 
Select “Eclipse Application” on the left pane and create a new instance of it. 
Select the new instance and click on the “Debug” button at the bottom of the dialog. 
When prompted with the “Save and Launch” dialog say Cancel. 
Switch to “debug” perspective. See how there is one node in the “Debug View”. 
The “Remove All” button and most of the context menu for that launch are disabled. 
Click on the Debug drop down and try launching the same launch configuration few more times, but make sure you do not save the file. 
See how the debug view accumulates launches that are not useful for anything and I don’t know how to get rid of them. 
I was able to remove the launch configuration from the Debug Configuration dialog, but all items still remain the debug view. They change to <unknown> after I’ve deleted their launch configuration.
Comment 9 Markus Keller CLA 2014-06-11 08:20:31 EDT
(In reply to Dobrin Alexiev from comment #8)
Thanks for the steps, I've opened bug 437122.