Community
Participate
Working Groups
After debugging a java application it would be nice to switch back automaticly from the debug perspective to the java perspective.
I think the heuristic is as follows: * If a launch causes a perspective change, then when the launch terminates, we should return the user to the original perspective (that the launch occurred from) * this should only happen if the user has checked the preference to do so (on a config by config type basis, which could be displayed with the perspective switching info on the "perspective" tab of the launch config) * this should only happen when all launches are terminated Marking as a P4 enhancement (may not happen in 3.0). Contributions welcome :-)
Deferred
*** Bug 76899 has been marked as a duplicate of this bug. ***
I would find this feature very useful. A few people at work have commented about it too. Any chance of reopening it? Channing
We won't have the resources to do this in 3.2
*** Bug 175621 has been marked as a duplicate of this bug. ***
Can we get this reopened for future considerations?
This won't happen in 3.3, so it will be left as resolve LATER. It is still open for consideration in later releases (as it is not marked WONTFIX or INVALID).
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.
Re-opening
*** Bug 327983 has been marked as a duplicate of this bug. ***
Created attachment 192129 [details] patch to switch to initial perspective when all launches are termianted We have the same issue raised by our customer using CDT, so this is not a JDT specific issue and this bug should be assigned to platform debug. Can any committer take a look at this patch, I would like to have this included for Indigo.
It's funny that we're looking at another perspective-related preference: bug 341559. Out of curiosity. Is this a preference you expect users to tinkle with, or you want it to be a product customization option?
Testing the patch I found that it does not ever switch back to the initial perspective. The steps I tried: 1. start existing target workspace (in the Java perspective) 2. set preferences 1) prompt to switch on suspend 2) prompt to switch back on terminate 3. create simple HelloWorld class with bp in it 4. hit the debug button Expected: That I would be prompted to switch to the debug perspective and then prompted to switch back when HelloWorld terminates Happens: I am prompted to switch to the debug perspective [OK], but no matter how I terminate HelloWorld - via resuming or the terminate button - I am never prompted to switch back to the Java perspective where I started from.
I think Darin's algorithm in comment #1 was the right idea.
Seems like there's some logistical problems of what to do when one launch takes you to one perspective then another launch to another.... you may not end up where you started when all said and done. To me that's an edge case though and shouldn't stop us from implementing it. (In reply to comment #15) > I think Darin's algorithm in comment #1 was the right idea. As far as I can tell the only difference is that Darin suggested to make the preference per launch config type, the given patch has a global preference. Personally, I'm neutral on it.
The patch didn't seem to do anything for me either. I agree with Darin that this should be per launch config type. There are other things that need to be considered: - Should it really only happen when the last launch is terminated? If so, a long running launch might render the feature useless. - What if the user manually changed perspective while the launch was running? Do we still restore the originating perspective which might no longer be interesting at this point? - Do we only switch when the launch is terminated manually or also when the launched program exits? If we do the latter, we might end up with a very disruptive/unpredictable UI. - Should we record the originating perspective and return to that one or is it maybe more useful to be able to specify the perspective that gets opened once a launch is terminated?
(In reply to comment #13) > Out of curiosity. Is this a preference you expect users to tinkle with, or > you want it to be a product customization option? I think this should be included in the platform debug and not a product customization option. In this bug, people requested to have this feature in JDT as well. Do you see products that don't want this feature included? (In reply to comment #14) > Testing the patch I found that it does not ever switch back to the initial > perspective. The steps I tried: I have tested this patch with CDT-GDB launch type and TI-Debugger launch type, but hasn't try JDT yet. I'll give it a try. (In reply to comment #17) > The patch didn't seem to do anything for me either. I guess you are doing what Michael is doing, I'll take a look. > - Should it really only happen when the last launch is terminated? If so, a > long running launch might render the feature useless. I believe so, wouldn’t you terminate non interested launch and free up the Debug view? For example, I have two debug launch types, JDT and CDT. I launch JDT from java perspective and then switch to C/C++ Perspective and launch CDT. Than few minutes later, I terminate JDT in Debug perspective, I wouldn’t want it to switch back to Java perspective yet. Someone might want to switch back for every launch terminated. In this case, we can have an option (checkbox) to enable always switch back. > - What if the user manually changed perspective while the launch was running? Gets ignored, only applies to the perspective where you launch a debug session. > Do we still restore the originating perspective which might no longer be > interesting at this point? I would say no, which is what this patch does, it switch back to perspective where the last launch was terminated. > - Do we only switch when the launch is terminated manually or also when the > launched program exits? If we do the latter, we might end up with a very > disruptive/unpredictable UI. I agree. This is also problematic for forward switch as well, where I have a program runs to completion very fast and I can't see anything in the Debug view. > - Should we record the originating perspective and return to that one or is it > maybe more useful to be able to specify the perspective that gets opened > once a launch is terminated? I would say the original perspective should be open. Does people want to switch to a different perspective when terminate debug session?
(In reply to comment #14) > Testing the patch I found that it does not ever switch back to the initial > perspective. The steps I tried: > 1. start existing target workspace (in the Java perspective) > 2. set preferences 1) prompt to switch on suspend 2) prompt to switch back on > terminate > 3. create simple HelloWorld class with bp in it > 4. hit the debug button > Expected: > That I would be prompted to switch to the debug perspective and then prompted > to switch back when HelloWorld terminates > Happens: > I am prompted to switch to the debug perspective [OK], but no matter how I > terminate HelloWorld - via resuming or the terminate button - I am never > prompted to switch back to the Java perspective where I started from. Are you prompted to switch perspective due to breakpoint hit and not due to launching a debug session? This patch doesn't remember perspective switch due to breakpoint hit? If this is what we want, I can update the patch.
> (In reply to comment #17) > > The patch didn't seem to do anything for me either. > I guess you are doing what Michael is doing, I'll take a look. I guess so. > > - Should it really only happen when the last launch is terminated? If so, a > > long running launch might render the feature useless. > I believe so, wouldn’t you terminate non interested launch and free up the > Debug view? Not really. I often keep terminated launches to reach their console again. > > - What if the user manually changed perspective while the launch was running? > Gets ignored, only applies to the perspective where you launch a debug session. What gets ignored: the auto-switch or my manual change? > > Do we still restore the originating perspective which might no longer be > > interesting at this point? > I would say no, which is what this patch does, it switch back to perspective > where the last launch was terminated. You probably meant "launch was STARTED"? > > - Do we only switch when the launch is terminated manually or also when the > > launched program exits? If we do the latter, we might end up with a very > > disruptive/unpredictable UI. > I agree. This is also problematic for forward switch as well, where I have a > program runs to completion very fast and I can't see anything in the Debug > view. I disagree with that. Forward search is predictable in the sense that it activates exactly the specified perspective (or prompts). > > - Should we record the originating perspective and return to that one or is it > > maybe more useful to be able to specify the perspective that gets opened > > once a launch is terminated? > I would say the original perspective should be open. I agree with that assuming no manual perspective switching too place between launch and termination.
(In reply to comment #20) > What gets ignored: the auto-switch or my manual change? Manual switch. > You probably meant "launch was STARTED"? Yes, I meant STARTED. > I disagree with that. Forward search is predictable in the sense that it > activates exactly the specified perspective (or prompts). After thinking a bit more about this, I think we should swtich back when the user manually terminate and when the program run to exit. What do you think? > I agree with that assuming no manual perspective switching too place between > launch and termination. Are you suggesting we need a similar approach as forward switch? i.e let the user pick which perspective to switch back when all launches are terminated. And perhaps have an additional choice to switch back to where the last terminated debug session is launched from.
(In reply to comment #21) > After thinking a bit more about this, I think we should swtich back when the > user manually terminate and when the program run to exit. What do you think? > I agree, we should switch back on terminate, regardless of how the terminate occurs. > Are you suggesting we need a similar approach as forward switch? i.e let the > user pick which perspective to switch back when all launches are terminated. > And perhaps have an additional choice to switch back to where the last > terminated debug session is launched from. It would be nice to give the user a bit of control over this process, so I can see the utility in having the "switch back" case behave identically to the "switch forward" case.
To summarize what we want. 1) Switch back when all launches are terminated and does not tied to launch type. 2) Create an option similar to the forward switch and place it at the bottom of the Perspectives preferences. User can select which perspective to switch back (same as forward switch). Did I missed anything? I’ll try to rework the patch. I guess this feature is too late for Indigo, right? If it is, than can we get this in for post Indigo? Thanks.
See also http://wiki.eclipse.org/Debug/Phone_7-Apr-2011
Created attachment 193086 [details] patch with perspective selection This patch provides the UI to select the desired perspective for backward switching per launch type. By default, when all launches of the "same type" are terminated, than the perspective will switch back according to the configured perspective. You can also override the backward switch to occur when all launches are terminated, and the perspective that is configured for the last terminated launch type will be use. Please provide better wording in the dialog if you can think of better one. Let me know whether this patch works for you guys. Thanks for giving suggestions and testing the patches.
I am trying to use plugin_customization.ini to set default values for both forward and backward switch for some of the launch type/delegate. However it works the first time, but the restore to default doesn't pickup the values from the ini file. Is this a bug? Another question, should we define the backward switch (terminate) as another mode (i.e terminateMode)? Right now, there are run, debug and profile launchMode. Does it make sense to have terminate as another mode? With terminate beening a mode, I should be able to provide the default perspective for launchMode and terminateMode. And I wouldn't need the plugin_customization.ini to set the default value.
Bump! I'd expect the functionality to simply save the perspective active before debug was started, and return to the saved perspective upon termination, in blatant disregard of user perspective changes in between.
> Another question, should we define the backward switch (terminate) as another > mode (i.e terminateMode)? Right now, there are run, debug and profile > launchMode. Does it make sense to have terminate as another mode? With > terminate beening a mode, I should be able to provide the default perspective > for launchMode and terminateMode. And I wouldn't need the > plugin_customization.ini to set the default value. As Leonard Ritter pointed out, it would be enough to (automatically) change back to the "saved" perspective that was shown before you started the run/debug/profile operation. A preconfigured stwich-back shouldn't be the default one, any kind of other perspective-changes-back should really be only "on" (and therefore somehow prioritized) if you actually set them to be on. To your question, no I can't see the point in having an "on-terminate" switch. In what cases would you use that? An avarage user starts the debug/run session and after that (usually) expects the application to return to where he has been before.
(In reply to comment #28) > As Leonard Ritter pointed out, it would be enough to (automatically) change > back to the "saved" perspective that was shown before you started the > run/debug/profile operation. A preconfigured stwich-back shouldn't be the > default one, any kind of other perspective-changes-back should really be only > "on" (and therefore somehow prioritized) if you actually set them to be on. > To your question, no I can't see the point in having an "on-terminate" switch. > In what cases would you use that? An avarage user starts the debug/run session > and after that (usually) expects the application to return to where he has been > before. Hi Johan, can you give the current patch a try and let me know what you think? The previous patch that I have created, marked as absoleted, simply switch back to the perspective before a launch happend. Can you also try that patch out?
Currently being worked on.
*** Bug 312762 has been marked as a duplicate of this bug. ***
I looked at how the patch works (no code review). It goes into the right direction. There are some unexpected issues: - The 'Open associated perspective when all ...' checkbox seems to do nothing. I don't see why we need this. - The dialog that asks after all launches are terminated talks about switching back to the "initial" perspective. This is not what I see. It switches to the one selected in the [Terminate]: drop down.
> - The dialog that asks after all launches are terminated talks about switching > back to the "initial" perspective. This is not what I see. It switches to the > one selected in the [Terminate]: drop down. Which is good. Going back to some "initial" perspective is not predictable.
This is probably one of the biggest drawbacks and the sole reason I'm not using the debug perspective at all. By comparison NetBeans, Delphi, MonoDevelop, SharpDevelop and VisualStudio are all doing a good job in switching back and forth between a debug and "normal" perspective. I agree that there might be some difficulties in defining which is actually the "original" perspective but what that really is is an edge case that's been brought before the audience to stop the development of this feature for 10 years.
I've been using a buggy third party plugin. Most of the time it manages to switch the perspective back to the perspective before debugging. This is good enough for me to keep using it. Occasionally, I have to manually switch the perspective. That is far better than having to manually switch it every time. So what if there are bugs. There will always be bugs and corner cases in all software. It is better to have a low-risk feature that mostly works than none at all. As bugs and corner cases arise, they can be dealt with and fixed.
Can you share which plugin does it?
(In reply to comment #36) > Can you share which plugin does it? Here's a link to the blog entry describing the plugin and a download link. http://www.richinternet.de/blog/index.cfm?entry=1758AACF-910C-DE52-368E1421BEFDA19B
This problem seems to affect PDT too. I can choose between getting the Debug view opened automatically or getting back to the PHP view automatically, but I didn't manage to get both simultaneously.
I've written a plugin for this: https://marketplace.eclipse.org/content/debug-perspective-auto-closer It has two possible behaviors: 1) [default] when all debug launches have terminated, changes to perspective active on first launch 2) when any debug launch has terminated, changes to perspective active on that launch The preferred behavior can be selected on a preference page. Source: https://github.com/GammaWolf/eclipse-debug-perspective-auto-closer-plugin
As previously mentioned, I still believe this should be part of the IDE rather than a separate plugin. :)
(In reply to Pierre-Yves B. from comment #40) > As previously mentioned, I still believe this should be part of the IDE > rather than a separate plugin. :) I agree. Is there an agreement how the integrated feature should work exactly? What would be the correct place(s) in the code to add this feature?
(In reply to Francesco * from comment #41) > (In reply to Pierre-Yves B. from comment #40) > > As previously mentioned, I still believe this should be part of the IDE > > rather than a separate plugin. :) > > I agree. > > Is there an agreement how the integrated feature should work exactly? > What would be the correct place(s) in the code to add this feature? Dani Megert would probably be able to provide more guidance. I'm just an occasional contributor to Eclipse, I'm not familiar with Platform Debug. :)
(In reply to Francesco * from comment #41) > (In reply to Pierre-Yves B. from comment #40) > > As previously mentioned, I still believe this should be part of the IDE > > rather than a separate plugin. :) > > I agree. > > Is there an agreement how the integrated feature should work exactly? > What would be the correct place(s) in the code to add this feature? You see the attached patch for reference, PerspectiveManager is the place which will handle all this.
Any update on this Francesco? :)
I have moved on. The first question (as to the how it should work exactly) has not been answered. I've also had some trouble setting up a dev environment for it in a reasonable amount of time.
Strange, this feature is not implemented and not a part of standard Eclipse yet. Additionally want to mention radio-boxes "Open the associated perspective when launching" and "Open the associated perspective when an application suspends": 1) Ideally... we need 2 separate radio-boxes for each pair of "Application Type/Launchers" and "Modes/Perspectives". That is for each combo-box which can appear during configuration. 2) At least... we need 2 separate radio-boxes for each "Application Type/Launchers". Less flexible, but easier-to-understand interface. 3) Right now... 2 radio-boxes configure all possible launchers and modes. Not flexible at all. Separate radio-boxes are necessary for example if I want to always switch perspective for local debug, but ask for remote debug (where Expressions window can freeze eclipse because of traffic lags).
PS. To underline the relation between switching-back and those radio-boxes... the switch-back functionality can be implemented with brand new radio-box (let's say "Switch back to original perspective upon termination" with options e.g.: "Always", "Never", "Prompt", "For selected perspectives:" etc.