From 22b4459a3734e9c1376ee6ae94000efff2b8a96f Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Thu, 24 Jul 2014 16:15:03 -0400 Subject: [PATCH] Bug 440387 - Allow to easily extend ServicesLaunchSequence Change-Id: Ife35c51415fc9a5a07a5327a2eed3e564b3429c8 Signed-off-by: Marc Khouzam Reviewed-on: https://git.eclipse.org/r/30459 Tested-by: Hudson CI Reviewed-by: Mikhail Khodjaiants --- .../dsf/gdb/launching/GdbLaunchDelegate.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java index cdd7e0f2e89..69d52b2482d 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java @@ -26,6 +26,7 @@ import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor; import org.eclipse.cdt.dsf.concurrent.Query; import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress; +import org.eclipse.cdt.dsf.concurrent.Sequence; import org.eclipse.cdt.dsf.concurrent.ThreadSafe; import org.eclipse.cdt.dsf.debug.service.IDsfDebugServicesFactory; import org.eclipse.cdt.dsf.debug.sourcelookup.DsfSourceLookupDirector; @@ -168,8 +169,7 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2 // Create and invoke the launch sequence to create the debug control and services IProgressMonitor subMon1 = new SubProgressMonitor(monitor, 4, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); - final ServicesLaunchSequence servicesLaunchSequence = - new ServicesLaunchSequence(launch.getSession(), launch, subMon1); + Sequence servicesLaunchSequence = getServicesSequence(launch.getSession(), launch, subMon1); launch.getSession().getExecutor().execute(servicesLaunchSequence); boolean succeed = false; @@ -399,6 +399,19 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2 return new GdbLaunch(configuration, mode, locator); } + /** + * Returns a sequence that will create and initialize the different DSF services. + * Subclasses that wish to add/remove services can override this method. + * + * @param session The current DSF session + * @param launch The current launch + * @param rm The progress monitor that is to be used to cancel the sequence if so desired. + * @since 4.5 + */ + protected Sequence getServicesSequence(DsfSession session, ILaunch launch, IProgressMonitor rm) { + return new ServicesLaunchSequence(session, (GdbLaunch)launch, rm); + } + /** * Creates and initializes the source locator for the given launch configuration and dsf session. * @since 4.1