Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change back the perspective after terminating the debugged process in Eclipse?

Tags:

eclipse

Eclipse by default automatically switches to the Debug perspective when you hit a breakpoint.

However, it is annoying me that it doesn't automatically switch back to the previous perspective (say, Java) when terminating the process.

It just stays in the debug perspective even though there is nothing to debug because nothing is running.

like image 984
helifreak Avatar asked Feb 06 '09 18:02

helifreak


People also ask

How do I go back a step in Eclipse debugger?

Yes, Eclipse CDT has support of historical debugger feature. Open Debug Configuration -> Debugger -> Enable Reverse Debugging at startup . Than you can press shift+F5 or shift+F6 for step back like F5 or F6 for step forward.

Can we go back in debugging?

Using the new Step Backward and Forward buttons So, if you've just taken a step in live debugging (F10 or F11), you can use the Step Backward button to quickly navigate to the previous step.

How do I close Java perspective in Eclipse?

To close a perspective, right click on the perspective name in toolbar and select the Close menu item.


1 Answers

To complete mark's answer, that option tells Eclipse when to switch to the associated perspective upon program suspension - meaning when a breakpoint is hit, it will switch to Debug perspective.

Switching back to another perspective after you're done debugging has to be:

  • manual (mouse click)
  • manual ("Switch Perspective" shortcut CTRL F8)
  • automatic: Debug Perspective Auto Closer, which supplements bug 46336. (initially reported by zim)

Debug Perspective Auto Closer

Automatically opens previous perspective when debugging ends.

Behaviors: (configurable: Preferences -> Debug Perspective Auto Closer)

  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

Java perspective

If you want to avoid it switching to Debug in the first place, you can choose "Never" as the option (introduced in Eclipse 3.2 at the time).

(You can find the given Preferences page in Run/Debug > Perspective)

alt text

If you want to switch back in the situation where the debugged program terminates normally (Not when you want to stop debugging it yourself), you may hope Eclipse figures out that your program terminates normally and switch to a "default" perspective at that time...

However, there is no notion of "default" perspective, so how would Eclipse knows which one to switch to ? (the "Preferences/Perspectives/Make default" is only for the "Open Perspective" dialog, but that may not be the same perspective than the one you actually want to switch back to after a debug)

Open perspective

Also, should Eclipse closes the Debug perspective or just changes to a different one ?
What if there is more than one program running -- when one terminates, you might still be interested in debugging the other one, or maybe not.

The point is, the decision about when to change perspective (and what perspective to change to) is not reasonable for the machine to make -- it requires a person knowing what he wants to do next.

like image 72
VonC Avatar answered Oct 04 '22 20:10

VonC