Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 180190 Details for
Bug 326951
[services][launch] Allow to extend ServicesLaunchSequence
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Prototype solution
zpatch.sequence.txt (text/plain), 31.14 KB, created by
Marc Khouzam
on 2010-10-04 14:09:57 EDT
(
hide
)
Description:
Prototype solution
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2010-10-04 14:09:57 EDT
Size:
31.14 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.gdb >Index: src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java,v >retrieving revision 1.9 >diff -u -r1.9 GdbLaunch.java >--- src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java 14 May 2010 19:08:38 -0000 1.9 >+++ src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java 14 Sep 2010 01:51:04 -0000 >@@ -21,6 +21,7 @@ > import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants; > import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor; > import org.eclipse.cdt.dsf.concurrent.RequestMonitor; >+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.concurrent.ThreadSafeAndProhibitedFromDsfExecutor; >@@ -33,6 +34,7 @@ > import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent; > import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; > import org.eclipse.cdt.dsf.gdb.internal.memory.GdbMemoryBlockRetrieval; >+import org.eclipse.cdt.dsf.gdb.launching.GdbServicesSequence.ServiceSequenceOperation; > import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; > import org.eclipse.cdt.dsf.mi.service.IMIProcesses; > import org.eclipse.cdt.dsf.mi.service.MIProcesses; >@@ -44,6 +46,7 @@ > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.MultiStatus; >+import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; > import org.eclipse.debug.core.DebugEvent; >@@ -264,9 +267,8 @@ > } > fShutDown = true; > >- Sequence shutdownSeq = new ShutdownSequence( >- getDsfExecutor(), fSession.getId(), >- new RequestMonitor(fSession.getExecutor(), rm) { >+ Sequence shutdownSeq = getServicesSequence(ServiceSequenceOperation.SHUTDOWN, >+ new RequestMonitorWithProgress(fSession.getExecutor(), new NullProgressMonitor()) { > @Override > public void handleCompleted() { > fSession.removeServiceEventListener(GdbLaunch.this); >@@ -307,4 +309,12 @@ > Platform.getAdapterManager().loadAdapter(this, adapter.getName()); > return super.getAdapter(adapter); > } >+ >+ /** >+ * This method can be overridden by subclasses to allow to change the services sequence. >+ * @since 4.0 >+ */ >+ public Sequence getServicesSequence(ServiceSequenceOperation type, RequestMonitorWithProgress rm) { >+ return new GdbServicesSequence(type, getSession(), this, rm); >+ } > } >Index: src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java,v >retrieving revision 1.18 >diff -u -r1.18 GdbLaunchDelegate.java >--- src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java 30 Jul 2010 20:08:29 -0000 1.18 >+++ src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java 14 Sep 2010 01:51:04 -0000 >@@ -20,12 +20,15 @@ > import org.eclipse.cdt.core.model.ICProject; > import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; > import org.eclipse.cdt.dsf.concurrent.DsfExecutor; >+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; > import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; >+import org.eclipse.cdt.dsf.gdb.launching.GdbServicesSequence.ServiceSequenceOperation; > import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory; > import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactoryNS; > import org.eclipse.cdt.dsf.gdb.service.SessionType; >@@ -140,8 +143,8 @@ > > // 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); >+ final Sequence servicesLaunchSequence = >+ launch.getServicesSequence(ServiceSequenceOperation.INITIALIZE, new RequestMonitorWithProgress(ImmediateExecutor.getInstance(), subMon1)); > > launch.getSession().getExecutor().execute(servicesLaunchSequence); > try { >Index: src/org/eclipse/cdt/dsf/gdb/launching/GdbServicesSequence.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/launching/GdbServicesSequence.java >diff -N src/org/eclipse/cdt/dsf/gdb/launching/GdbServicesSequence.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/gdb/launching/GdbServicesSequence.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,281 @@ >+/******************************************************************************* >+ * Copyright (c) 2006, 2010 Wind River Systems and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Wind River Systems - initial API and implementation >+ * Nokia - handled GDBBackend service. Sep. 2008 >+ * IBM Corporation >+ * Ericsson - Support for Tracing Control service >+ * Ericsson - Converted to use ReflectionSequence to allow for overriding >+ *******************************************************************************/ >+package org.eclipse.cdt.dsf.gdb.launching; >+ >+import java.util.ArrayList; >+import java.util.Arrays; >+import java.util.Collections; >+import java.util.List; >+ >+import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector; >+import org.eclipse.cdt.dsf.concurrent.ReflectionSequence; >+import org.eclipse.cdt.dsf.concurrent.RequestMonitor; >+import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress; >+import org.eclipse.cdt.dsf.debug.service.IBreakpoints; >+import org.eclipse.cdt.dsf.debug.service.IDisassembly; >+import org.eclipse.cdt.dsf.debug.service.IExpressions; >+import org.eclipse.cdt.dsf.debug.service.IMemory; >+import org.eclipse.cdt.dsf.debug.service.IModules; >+import org.eclipse.cdt.dsf.debug.service.IProcesses; >+import org.eclipse.cdt.dsf.debug.service.IRegisters; >+import org.eclipse.cdt.dsf.debug.service.IRunControl; >+import org.eclipse.cdt.dsf.debug.service.ISourceLookup; >+import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext; >+import org.eclipse.cdt.dsf.debug.service.IStack; >+import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService; >+import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; >+import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl; >+import org.eclipse.cdt.dsf.mi.service.CSourceLookup; >+import org.eclipse.cdt.dsf.mi.service.IMIBackend; >+import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager; >+import org.eclipse.cdt.dsf.service.DsfServicesTracker; >+import org.eclipse.cdt.dsf.service.DsfSession; >+import org.eclipse.cdt.dsf.service.IDsfService; >+ >+/** >+ * This class replaces both ServicesLaunchSequence and ShutdownSequence to >+ * allow to easily override this functionality. The two classes have been merged into >+ * a single class since they are so closely related. >+ * >+ * @since 4.0 >+ */ >+public class GdbServicesSequence extends ReflectionSequence { >+ >+ public enum ServiceSequenceOperation { INITIALIZE, SHUTDOWN }; >+ >+ private final static String[] INITIALIZATION_STEPS = new String[] { >+ "handleBackendService", //$NON-NLS-1$ >+ "handleCommandControlService", //$NON-NLS-1$ >+ "handleProcessesService", //$NON-NLS-1$ >+ "handleRunControlService", //$NON-NLS-1$ >+ "handleMemoryService", //$NON-NLS-1$ >+ "handleModuleService", //$NON-NLS-1$ >+ "handleStackService", //$NON-NLS-1$ >+ "handleExpressionsService", //$NON-NLS-1$ >+ "handleSourceLookupService", //$NON-NLS-1$ >+ "handleBreakpointsService", //$NON-NLS-1$ >+ "handleBreakpointsMediatorService", //$NON-NLS-1$ >+ "handleRegistersService", //$NON-NLS-1$ >+ "handleDisassemblyService", //$NON-NLS-1$ >+ "handleTraceControlService", //$NON-NLS-1$ >+ }; >+ >+ private final ServiceSequenceOperation fOperation; >+ private final DsfSession fSession; >+ private final GdbLaunch fLaunch; >+ >+ private ICommandControlService fCommandControl; >+ >+ public GdbServicesSequence(ServiceSequenceOperation operation, DsfSession session, GdbLaunch launch, RequestMonitorWithProgress rm) { >+ super(session.getExecutor(), rm, >+ operation == ServiceSequenceOperation.INITIALIZE ? LaunchMessages.getString("ServicesLaunchSequence_0") : "", //$NON-NLS-1$ //$NON-NLS-2$ >+ operation == ServiceSequenceOperation.INITIALIZE ? LaunchMessages.getString("ServicesLaunchSequence_1") : ""); //$NON-NLS-1$ //$NON-NLS-2$ >+ fSession = session; >+ fLaunch = launch; >+ fOperation = operation; >+ } >+ >+ @Override >+ protected String[] getExecutionOrder(String group) { >+ if (GROUP_TOP_LEVEL.equals(group)) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ return INITIALIZATION_STEPS; >+ } else { >+ // Use the reverse order of the initialization sequence >+ // We need to create a brand new array list or else we'll actually reverse the init_steps array. >+ List<String> orderedList = new ArrayList<String>(Arrays.asList(INITIALIZATION_STEPS)); >+ Collections.reverse(orderedList); >+ return orderedList.toArray(new String[orderedList.size()]); >+ } >+ } >+ return null; >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleBackendService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IMIBackend.class, fSession, fLaunch.getLaunchConfiguration()).initialize(requestMonitor); >+ } else { >+ shutdownService(IMIBackend.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleCommandControlService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fCommandControl = fLaunch.getServiceFactory().createService(ICommandControlService.class, fSession, fLaunch.getLaunchConfiguration()); >+ fCommandControl.initialize(requestMonitor); >+ } else { >+ shutdownService(ICommandControlService.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleProcessesService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IProcesses.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IProcesses.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleRunControlService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IRunControl.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IRunControl.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleMemoryService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IMemory.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IMemory.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleModuleService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IModules.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IModules.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleStackService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IStack.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IStack.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleExpressionsService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IExpressions.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IExpressions.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleSourceLookupService(final RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ final CSourceLookup sourceLookup = (CSourceLookup)fLaunch.getServiceFactory().createService(ISourceLookup.class, fSession); >+ sourceLookup.initialize(new RequestMonitor(getExecutor(), requestMonitor) { >+ @Override >+ protected void handleSuccess() { >+ ISourceLookupDMContext sourceLookupDmc = (ISourceLookupDMContext)fCommandControl.getContext(); >+ sourceLookup.setSourceLookupDirector(sourceLookupDmc, (CSourceLookupDirector)fLaunch.getSourceLocator()); >+ requestMonitor.done(); >+ } >+ }); >+ } else { >+ shutdownService(ISourceLookup.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleBreakpointsService(final RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IBreakpoints.class, fSession).initialize(new RequestMonitor(getExecutor(), requestMonitor)); >+ } else { >+ shutdownService(IBreakpoints.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleBreakpointsMediatorService(final RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(MIBreakpointsManager.class, fSession).initialize(new RequestMonitor(getExecutor(), requestMonitor)); >+ } else { >+ shutdownService(MIBreakpointsManager.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleRegistersService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IRegisters.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IRegisters.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleDisassemblyService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IDisassembly.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IDisassembly.class, requestMonitor); >+ } >+ } >+ >+ /** @since 4.0 */ >+ @Execute >+ public void handleTraceControlService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ IGDBTraceControl traceService = fLaunch.getServiceFactory().createService(IGDBTraceControl.class, fSession, fLaunch.getLaunchConfiguration()); >+ // Note that for older versions of GDB, we don't support tracing, so there is no trace service. >+ if (traceService != null) { >+ traceService.initialize(requestMonitor); >+ } else { >+ requestMonitor.done(); >+ } >+ } else { >+ shutdownService(IGDBTraceControl.class, requestMonitor); >+ } >+ } >+ >+ private <V extends IDsfService> void shutdownService(Class<V> clazz, final RequestMonitor requestMonitor) { >+ DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fSession.getId()); >+ IDsfService service = tracker.getService(clazz); >+ tracker.dispose(); >+ if (service != null) { >+ service.shutdown(new RequestMonitor(getExecutor(), requestMonitor) { >+ @Override >+ protected void handleCompleted() { >+ if (!isSuccess()) { >+ GdbPlugin.getDefault().getLog().log(getStatus()); >+ } >+ requestMonitor.done(); >+ } >+ }); >+ } else { >+ // It is possible that a particular service was not instantiated at all >+ // depending on our backend >+ requestMonitor.done(); >+ } >+ } >+} >Index: src/org/eclipse/cdt/dsf/gdb/launching/ServicesLaunchSequence.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/launching/ServicesLaunchSequence.java >diff -N src/org/eclipse/cdt/dsf/gdb/launching/ServicesLaunchSequence.java >--- src/org/eclipse/cdt/dsf/gdb/launching/ServicesLaunchSequence.java 29 Jan 2010 14:37:01 -0000 1.4 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,148 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2006, 2010 Wind River Systems and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * Wind River Systems - initial API and implementation >- * Nokia - created GDBBackend service. Sep. 2008 >- * IBM Corporation >- * Ericsson - Support for Tracing Control service >- *******************************************************************************/ >-package org.eclipse.cdt.dsf.gdb.launching; >- >-import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector; >-import org.eclipse.cdt.dsf.concurrent.RequestMonitor; >-import org.eclipse.cdt.dsf.concurrent.Sequence; >-import org.eclipse.cdt.dsf.debug.service.IBreakpoints; >-import org.eclipse.cdt.dsf.debug.service.IDisassembly; >-import org.eclipse.cdt.dsf.debug.service.IExpressions; >-import org.eclipse.cdt.dsf.debug.service.IMemory; >-import org.eclipse.cdt.dsf.debug.service.IModules; >-import org.eclipse.cdt.dsf.debug.service.IProcesses; >-import org.eclipse.cdt.dsf.debug.service.IRegisters; >-import org.eclipse.cdt.dsf.debug.service.IRunControl; >-import org.eclipse.cdt.dsf.debug.service.ISourceLookup; >-import org.eclipse.cdt.dsf.debug.service.IStack; >-import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext; >-import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService; >-import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl; >-import org.eclipse.cdt.dsf.mi.service.CSourceLookup; >-import org.eclipse.cdt.dsf.mi.service.IMIBackend; >-import org.eclipse.cdt.dsf.mi.service.IMIProcesses; >-import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager; >-import org.eclipse.cdt.dsf.service.DsfSession; >-import org.eclipse.core.runtime.IProgressMonitor; >- >-public class ServicesLaunchSequence extends Sequence { >- >- Step[] fSteps = new Step[] { >- new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- // Create the back end GDB service. >- // >- fLaunch.getServiceFactory().createService(IMIBackend.class, fSession, fLaunch.getLaunchConfiguration()).initialize(requestMonitor); >- } >- }, >- // Create and initialize the Connection service. >- new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- // >- // Create the connection. >- // >- fCommandControl = fLaunch.getServiceFactory().createService(ICommandControlService.class, fSession, fLaunch.getLaunchConfiguration()); >- fCommandControl.initialize(requestMonitor); >- } >- }, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- fProcService = (IMIProcesses)fLaunch.getServiceFactory().createService(IProcesses.class, fSession); >- fProcService.initialize(requestMonitor); >- }}, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- fLaunch.getServiceFactory().createService(IRunControl.class, fSession).initialize(requestMonitor); >- }}, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- fLaunch.getServiceFactory().createService(IMemory.class, fSession).initialize(requestMonitor); >- }}, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- fLaunch.getServiceFactory().createService(IModules.class, fSession).initialize(requestMonitor); >- }}, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- fLaunch.getServiceFactory().createService(IStack.class, fSession).initialize(requestMonitor); >- }}, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- fLaunch.getServiceFactory().createService(IExpressions.class, fSession).initialize(requestMonitor); >- }}, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- fSourceLookup = (CSourceLookup)fLaunch.getServiceFactory().createService(ISourceLookup.class, fSession); >- fSourceLookup.initialize(requestMonitor); >- }}, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- ISourceLookupDMContext sourceLookupDmc = (ISourceLookupDMContext)fCommandControl.getContext(); >- fSourceLookup.setSourceLookupDirector(sourceLookupDmc, (CSourceLookupDirector)fLaunch.getSourceLocator()); >- requestMonitor.done(); >- }}, >- new Step() { @Override >- public void execute(final RequestMonitor requestMonitor) { >- // Create the low-level breakpoint service >- fLaunch.getServiceFactory().createService(IBreakpoints.class, fSession).initialize(new RequestMonitor(getExecutor(), requestMonitor)); >- }}, >- new Step() { @Override >- public void execute(final RequestMonitor requestMonitor) { >- // Create high-level breakpoint service and install breakpoints >- // for the GDB debug context. >- fLaunch.getServiceFactory().createService(MIBreakpointsManager.class, fSession).initialize(new RequestMonitor(getExecutor(), requestMonitor)); >- }}, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- fLaunch.getServiceFactory().createService(IRegisters.class, fSession).initialize(requestMonitor); >- }}, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- fLaunch.getServiceFactory().createService(IDisassembly.class, fSession).initialize(requestMonitor); >- }}, >- new Step() { @Override >- public void execute(RequestMonitor requestMonitor) { >- IGDBTraceControl traceService = fLaunch.getServiceFactory().createService(IGDBTraceControl.class, fSession, fLaunch.getLaunchConfiguration()); >- // Note that for older versions of GDB, we don't support tracing, so there is no trace service. >- if (traceService != null) { >- traceService.initialize(requestMonitor); >- } else { >- requestMonitor.done(); >- } >- }}, >- }; >- >- DsfSession fSession; >- GdbLaunch fLaunch; >- >- ICommandControlService fCommandControl; >- IMIProcesses fProcService; >- CSourceLookup fSourceLookup; >- >- public ServicesLaunchSequence(DsfSession session, GdbLaunch launch, IProgressMonitor pm) { >- super(session.getExecutor(), pm, LaunchMessages.getString("ServicesLaunchSequence_0"), LaunchMessages.getString("ServicesLaunchSequence_1")); //$NON-NLS-1$ //$NON-NLS-2$ >- fSession = session; >- fLaunch = launch; >- } >- >- @Override >- public Step[] getSteps() { >- return fSteps; >- } >- >- >- >-} >Index: src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java >diff -N src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java >--- src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java 29 Jan 2010 14:37:01 -0000 1.3 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,166 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2006, 2010 Wind River Systems and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * Wind River Systems - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.cdt.dsf.gdb.launching; >- >-import org.eclipse.cdt.dsf.concurrent.DsfExecutor; >-import org.eclipse.cdt.dsf.concurrent.RequestMonitor; >-import org.eclipse.cdt.dsf.concurrent.Sequence; >-import org.eclipse.cdt.dsf.debug.service.IBreakpoints; >-import org.eclipse.cdt.dsf.debug.service.IDisassembly; >-import org.eclipse.cdt.dsf.debug.service.IExpressions; >-import org.eclipse.cdt.dsf.debug.service.IMemory; >-import org.eclipse.cdt.dsf.debug.service.IModules; >-import org.eclipse.cdt.dsf.debug.service.IProcesses; >-import org.eclipse.cdt.dsf.debug.service.IRegisters; >-import org.eclipse.cdt.dsf.debug.service.IRunControl; >-import org.eclipse.cdt.dsf.debug.service.ISourceLookup; >-import org.eclipse.cdt.dsf.debug.service.IStack; >-import org.eclipse.cdt.dsf.debug.service.command.ICommandControl; >-import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; >-import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl; >-import org.eclipse.cdt.dsf.mi.service.IMIBackend; >-import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager; >-import org.eclipse.cdt.dsf.service.DsfServicesTracker; >-import org.eclipse.cdt.dsf.service.IDsfService; >- >-public class ShutdownSequence extends Sequence { >- >- String fSessionId; >- >- String fApplicationName; >- >- String fDebugModelId; >- >- DsfServicesTracker fTracker; >- >- public ShutdownSequence(DsfExecutor executor, String sessionId, RequestMonitor requestMonitor) { >- super(executor, requestMonitor); >- fSessionId = sessionId; >- } >- >- @Override >- public Step[] getSteps() { >- return fSteps; >- } >- >- private final Step[] fSteps = new Step[] { new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- assert GdbPlugin.getBundleContext() != null; >- fTracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fSessionId); >- requestMonitor.done(); >- } >- >- @Override >- public void rollBack(RequestMonitor requestMonitor) { >- fTracker.dispose(); >- fTracker = null; >- requestMonitor.done(); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IGDBTraceControl.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IDisassembly.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IRegisters.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(MIBreakpointsManager.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IBreakpoints.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(ISourceLookup.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IExpressions.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IStack.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IModules.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IMemory.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IRunControl.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IProcesses.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(ICommandControl.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- shutdownService(IMIBackend.class, requestMonitor); >- } >- }, new Step() { >- @Override >- public void execute(RequestMonitor requestMonitor) { >- fTracker.dispose(); >- fTracker = null; >- requestMonitor.done(); >- } >- } }; >- >- @SuppressWarnings("unchecked") >- private void shutdownService(Class clazz, final RequestMonitor requestMonitor) { >- IDsfService service = (IDsfService)fTracker.getService(clazz); >- if (service != null) { >- service.shutdown(new RequestMonitor(getExecutor(), requestMonitor) { >- @Override >- protected void handleCompleted() { >- if (!isSuccess()) { >- GdbPlugin.getDefault().getLog().log(getStatus()); >- } >- requestMonitor.done(); >- } >- }); >- } else { >- // It is possible that a particular service was not instantiated at all >- // depending on our backend >- requestMonitor.done(); >- } >- } >-}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
marc.khouzam
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 326951
: 180190 |
186578
|
189393
|
190711