Bug 538548 - [debug view] Debug View in another perspective causes editor to pop-up
Summary: [debug view] Debug View in another perspective causes editor to pop-up
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.8   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.10 M3   Edit
Assignee: Simeon Andreev CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks: 540253
  Show dependency tree
 
Reported: 2018-09-03 07:57 EDT by Simeon Andreev CLA
Modified: 2020-01-27 10:57 EST (History)
2 users (show)

See Also:


Attachments
Video showing the undesired Debug View behaviour. (1.94 MB, video/mp4)
2018-09-03 07:57 EDT, Simeon Andreev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simeon Andreev CLA 2018-09-03 07:57:34 EDT
Created attachment 275659 [details]
Video showing the undesired Debug View behaviour.

Steps to reproduce:


1. Open a new window.
2. Open debug perspective in both windows.
3. Set perspective to default Java perspective in second window.
4. Debug a snippet in the first window.
5. Observe that the second window also reacts to debug events, and e.g. shows source.
6. Restart Eclipse.
7. Debug snippet in the first window.
8. Observe that the second window no longer reacts to debug events. Likewise if the Debug View is closed in the debug perspective of the second window.

This interferes with use-case for using one one window with a debug-related perspective and another window with a non-debug related perspective.

Can also be reproduced with one window, as the problem is not window related:

1. Open the debug perspective.
2. Go back to default Java perspective.
3. Use previous launches to debug the snippet.
4. Observe that the source editor is still popping up, despite having no Debug View in the perspective.
5. Restart Eclipse.
6. Observe that no source editor is popping up.

Of course without a second window this is a clinical case and not an actual problem.

Seen with:

Eclipse SDK
Version: 4.9
Build id: I20180807-2000
Comment 1 Eclipse Genie CLA 2018-09-03 11:01:03 EDT
New Gerrit change created: https://git.eclipse.org/r/128569
Comment 3 Simeon Andreev CLA 2018-10-19 07:11:02 EDT
Looks like this fix causes other problems, see bug 540253.
Comment 4 Simeon Andreev CLA 2018-10-26 11:29:24 EDT
To fix the regression described in bug 540253 we'll need to restrict the fix for this bug. See https://git.eclipse.org/r/#/c/131127/, patch set 6.

The editor will not pop up only under somewhat ham-handed guarantee that the Debug View will not pop-up after the source location serve reacts to the debug activation event.

The conditions are:

1. If the Debug View was not open in the current perspective.
2. Preferences to switch to a debug perspective on a breakpoint hit or on launch are set to "never".
3. Preference to activate the Debug View on a breakpoint hit is set to "disabled".

Unfortunately, the switch perspective dialog (see 2.) comes after 2 asynchronous jobs and a sync on the SWT display. So knowing what the user chose during the source lookup service code on debug event is very difficult, if not impossible.
Comment 5 Simeon Andreev CLA 2018-10-29 10:12:26 EDT
Fixed with bug 540253, which also fixes the regression here. See bug 540253 comment 9.
Comment 6 Sarika Sinha CLA 2018-11-20 01:59:09 EST
@Siemon,
I still the same behavior with 1 and 2 windows, is it resolved  ?

I disabled the 2 preferences -
1. Don't activate Debug View on breakpoint hit (Window -> Preferences -> Run/Debug.
2. Never swtich to a perspective on launch or on a breakpoint hit (Window -> Preferences -> Run/Debug -> Perspectives).
Comment 7 Simeon Andreev CLA 2018-11-20 02:25:14 EST
(In reply to Sarika Sinha from comment #6)
> @Siemon,
> I still the same behavior with 1 and 2 windows, is it resolved  ?
> 
> I disabled the 2 preferences -
> 1. Don't activate Debug View on breakpoint hit (Window -> Preferences ->
> Run/Debug.
> 2. Never swtich to a perspective on launch or on a breakpoint hit (Window ->
> Preferences -> Run/Debug -> Perspectives).

Please ensure you don't have the Debug View in the active perspective of the window in which an editor should not be popping up.

If so, please provide some reproduction steps; I don't see the issue with a simple setup.


To recap:

If the Debug View is not open/hidden in the current perspective of a window, we don't expect an editor to pop up in that window, once a breakpoint is hit.
Comment 8 Sarika Sinha CLA 2018-11-21 02:23:11 EST
Ok, I understand that now!!

But, somehow it looks odd that from Java Perspective, I launched the prohram in debug mode and actually it is suspending on some breakpoint but it is not highlighted in the Java Editor. When I open the Debug view, the stack appears selected but still I need to re select the stack to get the line in Java Editor highlighted on the breakpoint.
Comment 9 Simeon Andreev CLA 2018-11-21 04:09:08 EST
> But, somehow it looks odd that from Java Perspective, I launched the prohram
> in debug mode and actually it is suspending on some breakpoint but it is not
> highlighted in the Java Editor.

I think this behaviour didn't change. E.g. try setting the same preferences (no activation of Debug View and no perspective switching on launch/breakpoint hit) and then debugging some snippet. If the Debug View was not open at all in the Eclipse session, you should be seeing the same behaviour.

The fix here aims to improve the situation when the Debug View is open in *some perspective* that is not active.

>  When I open the Debug view, the stack
> appears selected but still I need to re select the stack to get the line in
> Java Editor highlighted on the breakpoint.

Which part of the stack is selected? When I open the Debug View I do see the editor source pop-up with the breakpoint line highlighted. Do note bug 540243, there is still a remaining problem with selection if the Debug View was neither open nor hidden at the time of the breakpoint hit.