| Summary: | Debugging views automatically opened before perspective switch | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jared Burns <jared_burns> | ||||||
| Component: | Debug | Assignee: | Darin Wright <darin.eclipse> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P2 | CC: | chanskw, darin.eclipse | ||||||
| Version: | 3.1 | ||||||||
| Target Milestone: | 3.1 RC1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 21479 [details]
patch to org.eclipse.debug.ui
* Added a class name PerspectiveSwitchLock in Perspective Manager. This class
has one boolean field and is used to indicate if the Perspective may swtich
perspective as a result of some events.
* When the Perspective Manager gets a debug event or launch added event, the
manager sets a the perspective switch lock to true. When the perspective
manager has finished handling the event, it will sets the lock back to false
and will notify all who is waiting on this lock.
* LaunchViewContextListener #contextEnabled(...) method is changed. The method
now define two jobs. One for opening context-enabled views on the UI thread.
Another job for waiting for the perspective manager to finish perspective
switch. When #contextEnabled(...) is called, the listener checks with the
Perspective Manger to see if it may be switching perspective. If the
perspective manager may be switching perspective, the listener schedules a job
to wait. When the perspective manager is done, the listener gets notify and
will schedule an UI job to open context-enabled views. If the perspective
manager is not switching perspective when #contextEnabled(...) is called, the
listener schedules a job to open views immediately.
* This design requires that the Perspective Manager gets the suspend event
before other event handlers. (i.e. LaunchViewEventHandler). Otherwise, the
launch view may enable a context before the perspective manager has a chance to
set up its lock. In DebugUIPlugin, I am creating the Perspective Manager when
the plugin is created. This ensures that the manager is the first listener to
debug events and will process the event before everyone else.
Darin - Please review code and let me know what you think... Thanks... Samantha Created attachment 21515 [details]
patch
Samantha, please review this alternative patch. The design is the same but the
implementation hides the lock in the perspective manager. Clients simple
scheule jobs with the perspective manager, to be run after any ongoing
perspective switch. I think it makes the client code simpler and avoids a
public lock.
Relying on the order of the listener registries is scary and making the listeners so tightly coupled to each other makes this code even more complicated than it already is. What about creating one debug event handler that dispatches debug events to the perspective manager and the context listener in sequence? The context listener is not actually a debug event/launch listener. The debug view explicitly updates the context listener (via the message updateForSelection(...)). So, the important thing is that the perspective manager is a listener before the debug view. I'm not excited about having the debug view register with the perspective manager for events. Verified that the alternative patch is good. Thanks for making the enhancements. Samantha Released patch. I feel this is the simplest/safest fix for 3.1. Verified. |
1. Enable automatic view management in the Java and Debug perspectives. 2. Open the Debug view in the Java perspective. 2. Debug to a breakpoint. 2a. Debugging views are automatically opened in the Java perspective. 3. When you're prompted to switch perspectives, switch to Debug. 4. Do your debugging in the Debug perspective, terminate the launch, and go back to Java. The perspective is now cluttered with debugging views from step 2a ("You're welcome."). Automatic view management should not happen until after the perspective switching code has run.