Bug 559590 - "Custom" debug view is not considered in SourceLookupService.debugContextChanged
Summary: "Custom" debug view is not considered in SourceLookupService.debugContextChanged
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.10   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.15 M3   Edit
Assignee: Andrey Loskutov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-27 10:50 EST by Andrey Loskutov CLA
Modified: 2020-02-03 04:41 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2020-01-27 10:50:41 EST
We have now found the case where the patch for bug 540253 in SourceLookupService makes a "custom debug view" use case not work as expected.

In our product we use both Debug and "custom debug" views to control debugger execution. We have our own DebugContextProvider that adds itself to org.eclipse.debug.ui.contexts.IDebugContextService.addDebugContextProvider(IDebugContextProvider) and specifies via org.eclipse.debug.ui.contexts.AbstractDebugContextProvider.getPart() which view is related to the debug context / DebugContextEvent events.

If our "custom" debug view is open (and default Debug view closed), and breakpoint is hit, we want that the debugger opens the related editor and highlights the related line in the source, as if Debug view would be opened. 

This doesn't work now due the patch for bug 540253 and bug 538548, see  https://git.eclipse.org/r/#/c/131127/6/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java@72 .

In SourceLookupService.debugContextChanged(DebugContextEvent) we check isDebugViewActive() only for the "concrete" instance of the LaunchView being active, but we should check if the instance provided via DebugContextEvent.getDebugContextProvider().getPart() is active (*if* there is one of course, and only after that for the LaunchView).

This wasn't noticed yet because usually default Debug view is always opened in Debug perspective, but if user closes it, the bug happens.

I will push the patch.
Comment 1 Eclipse Genie CLA 2020-01-27 11:16:53 EST
New Gerrit change created: https://git.eclipse.org/r/156657