Bug 569082 - AbstractSourceLookupDirector purges ISourceLookupParticpant list on session end
Summary: AbstractSourceLookupDirector purges ISourceLookupParticpant list on session end
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.15   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-23 17:08 EST by Jonathan Williams CLA
Modified: 2020-11-23 17:53 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 Jonathan Williams CLA 2020-11-23 17:08:14 EST
The default behavior of AbstractSourceLookupDirector (and thus DSFSourceLookupDirector) when a launchConfigurationChanged event occurs for the associated launch configuration is to re-initialize the class to defaults (or from momento). This includes the the ISourceLookupParticipant array it maintains. 

Previously we worked around this by adding our ISourceLookupParticpant implementations during the launch sequence after any other modifications to the launch configuration had been made.

An update to o.e.debug.core.Launch.java (https://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java?id=296b2b78ef97e1aecb6e46e0eb45e4aed37c0ffb) to add the termination time to the launch configuration now means anything applying AbstractSourceLookupDirector's default behaviors purges the ISourceLookupParticipant array at termination time also.

I could potentially work around this issue by re-adding them after the terminate, but the reset to defaults/momento behavior seems like a bug/unintended behavior in the first place - so here we are.
Comment 1 Andrey Loskutov CLA 2020-11-23 17:17:43 EST
(In reply to Jonathan Williams from comment #0)
> The default behavior of AbstractSourceLookupDirector (and thus
> DSFSourceLookupDirector) when a launchConfigurationChanged event occurs for
> the associated launch configuration is to re-initialize the class to
> defaults (or from momento). This includes the the ISourceLookupParticipant
> array it maintains. 
> 
> Previously we worked around this by adding our ISourceLookupParticpant
> implementations during the launch sequence after any other modifications to
> the launch configuration had been made.

Could you please elaborate why is this a problem and why do you need a workaround? Do you keep some state in ISourceLookupParticpant?
Comment 2 Jonathan Williams CLA 2020-11-23 17:53:19 EST
We have a PlatformObject that represents the concept of a 'session' to persist information about the launch and information gathered during and after, in the context of application profiling. Part of this is our own ISourceLookupParticpant contribution we wish to pass to the DSFSourceLookupDirector, so when certain profiling information is clicked on for an active or terminated session, we can link to the relevant line of source.

Since the DSFSourceLookupDirector purges it's list of ISourceLookupParticipants when the launch configuration is changed, we were previously forced to add the participant in a custom DSFFinalLaunchSequence step immediately prior to to releasing the application to run.

I find it odd that the DSFSourceLookupDirector has the capacity to maintain a list of participants only to discard them any time the launch configuration changes, with no way of persisting the information.