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 186578 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]
Modified patch.
326951-patch.txt (text/plain), 32.65 KB, created by
Nobody - feel free to take it
on 2011-01-11 17:53:35 EST
(
hide
)
Description:
Modified patch.
Filename:
MIME Type:
Creator:
Nobody - feel free to take it
Created:
2011-01-11 17:53:35 EST
Size:
32.65 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.11 >diff -u -r1.11 GdbLaunch.java >--- src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java 12 Nov 2010 14:07:27 -0000 1.11 >+++ src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java 11 Jan 2011 22:43:15 -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; >@@ -242,6 +245,14 @@ > public boolean isDisconnected() { > return isTerminated(); > } >+ >+ /** >+ * 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); >+ } > > @Override > public void disconnect() throws DebugException { >@@ -270,9 +281,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); >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.20 >diff -u -r1.20 GdbLaunchDelegate.java >--- src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java 27 Sep 2010 15:10:04 -0000 1.20 >+++ src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java 11 Jan 2011 22:43:15 -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; >@@ -136,6 +139,9 @@ > > monitor.worked( 1 ); > >+ fIsNonStopSession = LaunchUtils.getIsNonStopMode(config); >+ fIsPostMortemTracingSession = LaunchUtils.getIsPostMortemTracing(config); >+ > String gdbVersion = getGDBVersion(config); > > // First make sure non-stop is supported, if the user want to use this mode >@@ -151,8 +157,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 { >@@ -276,16 +282,18 @@ > // the adapters will be created for the whole session, including > // the source lookup adapter. > >- fIsNonStopSession = LaunchUtils.getIsNonStopMode(configuration); >- fIsPostMortemTracingSession = LaunchUtils.getIsPostMortemTracing(configuration); >- > GdbLaunch launch = new GdbLaunch(configuration, mode, null); > launch.initialize(); > launch.setSourceLocator(getSourceLocator(configuration, launch.getSession())); > return launch; > } > >- private ISourceLocator getSourceLocator(ILaunchConfiguration configuration, DsfSession session) throws CoreException { >+ /** >+ * Creates and initializes the source locator for >+ * the given launch configuration. >+ * @since 4.0 >+ */ >+ protected ISourceLocator getSourceLocator(ILaunchConfiguration configuration, DsfSession session) throws CoreException { > DsfSourceLookupDirector locator = new DsfSourceLookupDirector(session); > String memento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null); > if (memento == null) { >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,280 @@ >+/******************************************************************************* >+ * 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 >+ */ >+@SuppressWarnings( "restriction" ) >+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; >+ } >+ >+ @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); >+ } >+ } >+ >+ @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); >+ } >+ } >+ >+ @Execute >+ public void handleProcessesService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IProcesses.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IProcesses.class, requestMonitor); >+ } >+ } >+ >+ @Execute >+ public void handleRunControlService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IRunControl.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IRunControl.class, requestMonitor); >+ } >+ } >+ >+ @Execute >+ public void handleMemoryService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IMemory.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IMemory.class, requestMonitor); >+ } >+ } >+ >+ @Execute >+ public void handleModuleService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IModules.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IModules.class, requestMonitor); >+ } >+ } >+ >+ @Execute >+ public void handleStackService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IStack.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IStack.class, requestMonitor); >+ } >+ } >+ >+ @Execute >+ public void handleExpressionsService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IExpressions.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IExpressions.class, requestMonitor); >+ } >+ } >+ >+ @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); >+ } >+ } >+ >+ @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); >+ } >+ } >+ >+ @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); >+ } >+ } >+ >+ @Execute >+ public void handleRegistersService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IRegisters.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IRegisters.class, requestMonitor); >+ } >+ } >+ >+ @Execute >+ public void handleDisassemblyService(RequestMonitor requestMonitor) { >+ if (fOperation == ServiceSequenceOperation.INITIALIZE) { >+ fLaunch.getServiceFactory().createService(IDisassembly.class, fSession).initialize(requestMonitor); >+ } else { >+ shutdownService(IDisassembly.class, requestMonitor); >+ } >+ } >+ >+ @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); >+ } >+ } >+ >+ public <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(); >+ } >+ } >+ >+ protected ServiceSequenceOperation getOperation() { >+ return fOperation; >+ } >+ >+ protected DsfSession getSession() { >+ return fSession; >+ } >+ >+ protected GdbLaunch getLaunch() { >+ return fLaunch; >+ } >+} >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:
nobody
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 326951
:
180190
| 186578 |
189393
|
190711