Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 243611 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/dd/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java (-4 / +4 lines)
Lines 16-27 Link Here
16
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.LaunchRootVMNode;
16
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.LaunchRootVMNode;
17
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.StackFramesVMNode;
17
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.StackFramesVMNode;
18
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.StandardProcessVMNode;
18
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.StandardProcessVMNode;
19
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent;
20
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlInitializedDMEvent;
19
import org.eclipse.dd.dsf.service.DsfSession;
21
import org.eclipse.dd.dsf.service.DsfSession;
20
import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMAdapter;
22
import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMAdapter;
21
import org.eclipse.dd.dsf.ui.viewmodel.IRootVMNode;
23
import org.eclipse.dd.dsf.ui.viewmodel.IRootVMNode;
22
import org.eclipse.dd.dsf.ui.viewmodel.IVMNode;
24
import org.eclipse.dd.dsf.ui.viewmodel.IVMNode;
23
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
24
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendStartedEvent;
25
import org.eclipse.dd.mi.service.command.MIInferiorProcess.InferiorExitedDMEvent;
25
import org.eclipse.dd.mi.service.command.MIInferiorProcess.InferiorExitedDMEvent;
26
import org.eclipse.dd.mi.service.command.MIInferiorProcess.InferiorStartedDMEvent;
26
import org.eclipse.dd.mi.service.command.MIInferiorProcess.InferiorStartedDMEvent;
27
import org.eclipse.debug.core.DebugPlugin;
27
import org.eclipse.debug.core.DebugPlugin;
Lines 75-82 Link Here
75
        // Never skip the process lifecycle events.
75
        // Never skip the process lifecycle events.
76
        if (eventToSkip instanceof InferiorExitedDMEvent || 
76
        if (eventToSkip instanceof InferiorExitedDMEvent || 
77
            eventToSkip instanceof InferiorStartedDMEvent ||
77
            eventToSkip instanceof InferiorStartedDMEvent ||
78
            eventToSkip instanceof BackendStartedEvent ||
78
            eventToSkip instanceof ICommandControlInitializedDMEvent ||
79
            eventToSkip instanceof BackendExitedEvent) 
79
            eventToSkip instanceof ICommandControlShutdownDMEvent) 
80
        {
80
        {
81
            return false;
81
            return false;
82
        }
82
        }
(-)src/org/eclipse/dd/gdb/internal/ui/viewmodel/launch/ContainerVMNode.java (-6 / +6 lines)
Lines 25-38 Link Here
25
import org.eclipse.dd.dsf.debug.service.IProcesses.IProcessDMContext;
25
import org.eclipse.dd.dsf.debug.service.IProcesses.IProcessDMContext;
26
import org.eclipse.dd.dsf.debug.service.IProcesses.IThreadDMData;
26
import org.eclipse.dd.dsf.debug.service.IProcesses.IThreadDMData;
27
import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext;
27
import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext;
28
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent;
29
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlInitializedDMEvent;
28
import org.eclipse.dd.dsf.service.DsfSession;
30
import org.eclipse.dd.dsf.service.DsfSession;
29
import org.eclipse.dd.dsf.ui.concurrent.ViewerDataRequestMonitor;
31
import org.eclipse.dd.dsf.ui.concurrent.ViewerDataRequestMonitor;
30
import org.eclipse.dd.dsf.ui.viewmodel.VMDelta;
32
import org.eclipse.dd.dsf.ui.viewmodel.VMDelta;
31
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider;
33
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider;
32
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.IDMVMContext;
34
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.IDMVMContext;
33
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl;
35
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl;
34
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
35
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendStartedEvent;
36
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
36
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
37
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
37
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
38
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
38
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
Lines 127-135 Link Here
127
127
128
	@Override
128
	@Override
129
	public int getDeltaFlags(Object e) {
129
	public int getDeltaFlags(Object e) {
130
		if (e instanceof BackendExitedEvent) {
130
		if (e instanceof ICommandControlShutdownDMEvent) {
131
	        return IModelDelta.CONTENT;
131
	        return IModelDelta.CONTENT;
132
	    } else if (e instanceof BackendStartedEvent) {
132
	    } else if (e instanceof ICommandControlInitializedDMEvent) {
133
	        return IModelDelta.EXPAND;
133
	        return IModelDelta.EXPAND;
134
	    }
134
	    }
135
	    return super.getDeltaFlags(e);
135
	    return super.getDeltaFlags(e);
Lines 137-145 Link Here
137
137
138
	@Override
138
	@Override
139
	public void buildDelta(Object e, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor requestMonitor) {
139
	public void buildDelta(Object e, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor requestMonitor) {
140
		if (e instanceof BackendExitedEvent) {
140
		if (e instanceof ICommandControlShutdownDMEvent) {
141
	        parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.CONTENT);
141
	        parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.CONTENT);
142
	    } else if (e instanceof BackendStartedEvent) {
142
	    } else if (e instanceof ICommandControlInitializedDMEvent) {
143
	        parentDelta.addNode(createVMContext(((IDMEvent<?>)e).getDMContext()), IModelDelta.EXPAND);
143
	        parentDelta.addNode(createVMContext(((IDMEvent<?>)e).getDMContext()), IModelDelta.EXPAND);
144
	    } else {
144
	    } else {
145
	    	super.buildDelta(e, parentDelta, nodeOffset, requestMonitor);
145
	    	super.buildDelta(e, parentDelta, nodeOffset, requestMonitor);
(-)src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java (-7 / +29 lines)
Lines 38-43 Link Here
38
import org.eclipse.dd.dsf.concurrent.IDsfStatusConstants;
38
import org.eclipse.dd.dsf.concurrent.IDsfStatusConstants;
39
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
39
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
40
import org.eclipse.dd.dsf.concurrent.Sequence;
40
import org.eclipse.dd.dsf.concurrent.Sequence;
41
import org.eclipse.dd.dsf.datamodel.AbstractDMEvent;
41
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
42
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
42
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
43
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
43
import org.eclipse.dd.dsf.service.DsfSession;
44
import org.eclipse.dd.dsf.service.DsfSession;
Lines 72-77 Link Here
72
 */
73
 */
73
public class GDBControl extends AbstractMIControl {
74
public class GDBControl extends AbstractMIControl {
74
75
76
    /**
77
     * Event indicating that the back end process has started.
78
     */
79
    public static class GDBControlInitializedDMEvent extends AbstractDMEvent<ICommandControlDMContext> 
80
        implements ICommandControlInitializedDMEvent
81
    {
82
        public GDBControlInitializedDMEvent(GDBControlDMContext context) {
83
            super(context);
84
        }
85
    }
86
    
87
    /**
88
     * Event indicating that the back end process has terminated.
89
     */
90
    public static class GDBControlShutdownDMEvent extends AbstractDMEvent<ICommandControlDMContext> 
91
        implements ICommandControlShutdownDMEvent
92
    {
93
        public GDBControlShutdownDMEvent(GDBControlDMContext context) {
94
            super(context);
95
        }
96
    }
75
97
76
    private static int fgInstanceCounter = 0;
98
    private static int fgInstanceCounter = 0;
77
    private final GDBControlDMContext fControlDmc;
99
    private final GDBControlDMContext fControlDmc;
Lines 98-104 Link Here
98
    private PTY fPty;
120
    private PTY fPty;
99
121
100
    public GDBControl(DsfSession session, ILaunchConfiguration config) { 
122
    public GDBControl(DsfSession session, ILaunchConfiguration config) { 
101
        super(session);
123
        super(session, "gdbcontrol[" + ++fgInstanceCounter + "]"); //$NON-NLS-1$ //$NON-NLS-2$
102
        fSessionType = LaunchUtils.getSessionType(config);
124
        fSessionType = LaunchUtils.getSessionType(config);
103
        fAttach = LaunchUtils.getIsAttach(config);
125
        fAttach = LaunchUtils.getIsAttach(config);
104
        fGdbPath = LaunchUtils.getGDBPath(config);
126
        fGdbPath = LaunchUtils.getGDBPath(config);
Lines 107-124 Link Here
107
		} catch (CoreException e) {
129
		} catch (CoreException e) {
108
			fExecPath = new Path(""); //$NON-NLS-1$
130
			fExecPath = new Path(""); //$NON-NLS-1$
109
		}
131
		}
110
        fControlDmc = new GDBControlDMContext(session.getId(), "gdbcontrol[" + ++fgInstanceCounter + "]"); //$NON-NLS-1$ //$NON-NLS-2$
132
        fControlDmc = new GDBControlDMContext(session.getId(), getId()); 
111
    }
133
    }
112
134
113
    @Deprecated
135
    @Deprecated
114
    public GDBControl(DsfSession session, IPath gdbPath, IPath execPath, SessionType sessionType, boolean attach, int gdbLaunchTimeout) {
136
    public GDBControl(DsfSession session, IPath gdbPath, IPath execPath, SessionType sessionType, boolean attach, int gdbLaunchTimeout) {
115
        super(session);
137
        super(session, "gdbcontrol[" + ++fgInstanceCounter + "]"); //$NON-NLS-1$ //$NON-NLS-2$
116
        fSessionType = sessionType;
138
        fSessionType = sessionType;
117
        fAttach = attach;
139
        fAttach = attach;
118
        fGdbPath = gdbPath;
140
        fGdbPath = gdbPath;
119
        fExecPath = execPath;
141
        fExecPath = execPath;
120
        fGDBLaunchTimeout = gdbLaunchTimeout;
142
        fGDBLaunchTimeout = gdbLaunchTimeout;
121
        fControlDmc = new GDBControlDMContext(session.getId(), "gdbcontrol[" + ++fgInstanceCounter + "]"); //$NON-NLS-1$ //$NON-NLS-2$
143
        fControlDmc = new GDBControlDMContext(session.getId(), getId()); 
122
    }
144
    }
123
145
124
    @Override
146
    @Override
Lines 418-424 Link Here
418
    }
440
    }
419
        
441
        
420
    @DsfServiceEventHandler 
442
    @DsfServiceEventHandler 
421
    public void eventDispatched(BackendExitedEvent e) {
443
    public void eventDispatched(ICommandControlShutdownDMEvent e) {
422
        // Handle our "GDB Exited" event and stop processing commands.
444
        // Handle our "GDB Exited" event and stop processing commands.
423
        stopCommandProcessing();
445
        stopCommandProcessing();
424
    }
446
    }
Lines 445-451 Link Here
445
                        Thread.interrupted();
467
                        Thread.interrupted();
446
                    } finally {
468
                    } finally {
447
                        fExited = true;
469
                        fExited = true;
448
                        getSession().dispatchEvent(new BackendExitedEvent(fControlDmc) {}, getProperties());
470
                        getSession().dispatchEvent(new GDBControlShutdownDMEvent(fControlDmc) {}, getProperties());
449
                    }
471
                    }
450
                }
472
                }
451
            }
473
            }
Lines 717-723 Link Here
717
        public void initialize(final RequestMonitor requestMonitor) {
739
        public void initialize(final RequestMonitor requestMonitor) {
718
            getSession().addServiceEventListener(GDBControl.this, null);
740
            getSession().addServiceEventListener(GDBControl.this, null);
719
            register(new String[]{ ICommandControl.class.getName(), AbstractMIControl.class.getName() }, new Hashtable<String,String>());
741
            register(new String[]{ ICommandControl.class.getName(), AbstractMIControl.class.getName() }, new Hashtable<String,String>());
720
            getSession().dispatchEvent(new BackendStartedEvent(getGDBDMContext()), getProperties());
742
            getSession().dispatchEvent(new GDBControlInitializedDMEvent(getGDBDMContext()), getProperties());
721
            requestMonitor.done();
743
            requestMonitor.done();
722
        }
744
        }
723
745
(-)src/org/eclipse/dd/gdb/internal/provisional/launching/GdbLaunch.java (-2 / +2 lines)
Lines 32-37 Link Here
32
import org.eclipse.dd.dsf.debug.model.DsfMemoryBlockRetrieval;
32
import org.eclipse.dd.dsf.debug.model.DsfMemoryBlockRetrieval;
33
import org.eclipse.dd.dsf.debug.service.IDsfDebugServicesFactory;
33
import org.eclipse.dd.dsf.debug.service.IDsfDebugServicesFactory;
34
import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryDMContext;
34
import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryDMContext;
35
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent;
35
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
36
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
36
import org.eclipse.dd.dsf.service.DsfServicesTracker;
37
import org.eclipse.dd.dsf.service.DsfServicesTracker;
37
import org.eclipse.dd.dsf.service.DsfSession;
38
import org.eclipse.dd.dsf.service.DsfSession;
Lines 39-45 Link Here
39
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl;
40
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl;
40
import org.eclipse.dd.mi.service.command.AbstractCLIProcess;
41
import org.eclipse.dd.mi.service.command.AbstractCLIProcess;
41
import org.eclipse.dd.mi.service.command.MIInferiorProcess;
42
import org.eclipse.dd.mi.service.command.MIInferiorProcess;
42
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
43
import org.eclipse.debug.core.DebugException;
43
import org.eclipse.debug.core.DebugException;
44
import org.eclipse.debug.core.DebugPlugin;
44
import org.eclipse.debug.core.DebugPlugin;
45
import org.eclipse.debug.core.ILaunchConfiguration;
45
import org.eclipse.debug.core.ILaunchConfiguration;
Lines 185-191 Link Here
185
    
185
    
186
    ///////////////////////////////////////////////////////////////////////////
186
    ///////////////////////////////////////////////////////////////////////////
187
    // IServiceEventListener
187
    // IServiceEventListener
188
    @DsfServiceEventHandler public void eventDispatched(BackendExitedEvent event) {
188
    @DsfServiceEventHandler public void eventDispatched(ICommandControlShutdownDMEvent event) {
189
        shutdownSession(new RequestMonitor(ImmediateExecutor.getInstance(), null));
189
        shutdownSession(new RequestMonitor(ImmediateExecutor.getInstance(), null));
190
    }
190
    }
191
191
(-)src/org/eclipse/dd/dsf/debug/service/command/ICommandControl.java (-1 / +4 lines)
Lines 14-20 Link Here
14
14
15
/**
15
/**
16
 * API for sending commands to the debugger and for receiving command results
16
 * API for sending commands to the debugger and for receiving command results
17
 * and asynchronous events.
17
 * and asynchronous events.  The command control may be implemented by a service
18
 * or a non-service object.
19
 * 
20
 * @see ICommandControlService
18
 */
21
 */
19
public interface ICommandControl {
22
public interface ICommandControl {
20
23
(-)src/org/eclipse/dd/dsf/debug/service/command/ICommandControlService.java (+57 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Wind River Systems and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     Wind River Systems - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.dd.dsf.debug.service.command;
12
13
import org.eclipse.dd.dsf.datamodel.IDMContext;
14
import org.eclipse.dd.dsf.datamodel.IDMEvent;
15
import org.eclipse.dd.dsf.service.IDsfService;
16
17
/**
18
 * Service which acts as a command control. 
19
 * 
20
 * @since 1.1
21
 */
22
public interface ICommandControlService extends ICommandControl, IDsfService {
23
    
24
    public interface ICommandControlDMContext extends IDMContext {
25
        /**
26
         * Returns the ID of the command control that this context
27
         * represents.
28
         */
29
        public String getCommandControlId();
30
    } 
31
    
32
    
33
    /**
34
     * Event indicating that the back end process has started.
35
     */
36
    public interface ICommandControlInitializedDMEvent extends IDMEvent<ICommandControlDMContext> {};
37
    
38
    /**
39
     * Event indicating that the back end process has terminated.
40
     */
41
    public interface ICommandControlShutdownDMEvent extends IDMEvent<ICommandControlDMContext> {};
42
43
    /**
44
     * Returns the identifier of this command control service.  It can be used 
45
     * to distinguish between multiple instances of command control services.   
46
     */
47
    public String getId();
48
    
49
    /**
50
     * Returns whether this command control is currently active.  A command 
51
     * control service is active if it has been initialized and has not yet
52
     * shut down.
53
     * @return
54
     */
55
    public boolean isActive();
56
    
57
}
(-)src/org/eclipse/dd/mi/service/MIRunControlNS.java (-2 / +2 lines)
Lines 30-41 Link Here
30
import org.eclipse.dd.dsf.debug.service.IProcesses.IThreadDMContext;
30
import org.eclipse.dd.dsf.debug.service.IProcesses.IThreadDMContext;
31
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
31
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
32
import org.eclipse.dd.dsf.debug.service.command.CommandCache;
32
import org.eclipse.dd.dsf.debug.service.command.CommandCache;
33
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent;
33
import org.eclipse.dd.dsf.service.AbstractDsfService;
34
import org.eclipse.dd.dsf.service.AbstractDsfService;
34
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
35
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
35
import org.eclipse.dd.dsf.service.DsfSession;
36
import org.eclipse.dd.dsf.service.DsfSession;
36
import org.eclipse.dd.mi.internal.MIPlugin;
37
import org.eclipse.dd.mi.internal.MIPlugin;
37
import org.eclipse.dd.mi.service.command.AbstractMIControl;
38
import org.eclipse.dd.mi.service.command.AbstractMIControl;
38
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
39
import org.eclipse.dd.mi.service.command.commands.MIExecContinue;
39
import org.eclipse.dd.mi.service.command.commands.MIExecContinue;
40
import org.eclipse.dd.mi.service.command.commands.MIExecFinish;
40
import org.eclipse.dd.mi.service.command.commands.MIExecFinish;
41
import org.eclipse.dd.mi.service.command.commands.MIExecInterrupt;
41
import org.eclipse.dd.mi.service.command.commands.MIExecInterrupt;
Lines 781-787 Link Here
781
	}
781
	}
782
	
782
	
783
	@DsfServiceEventHandler
783
	@DsfServiceEventHandler
784
	public void eventDispatched(BackendExitedEvent e) {
784
	public void eventDispatched(ICommandControlShutdownDMEvent e) {
785
		fTerminated = true;
785
		fTerminated = true;
786
	}
786
	}
787
787
(-)src/org/eclipse/dd/mi/service/MIBreakpoints.java (-3 / +3 lines)
Lines 27-37 Link Here
27
import org.eclipse.dd.dsf.datamodel.IDMContext;
27
import org.eclipse.dd.dsf.datamodel.IDMContext;
28
import org.eclipse.dd.dsf.debug.service.IBreakpoints;
28
import org.eclipse.dd.dsf.debug.service.IBreakpoints;
29
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
29
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
30
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent;
30
import org.eclipse.dd.dsf.service.AbstractDsfService;
31
import org.eclipse.dd.dsf.service.AbstractDsfService;
31
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
32
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
32
import org.eclipse.dd.dsf.service.DsfSession;
33
import org.eclipse.dd.dsf.service.DsfSession;
33
import org.eclipse.dd.mi.internal.MIPlugin;
34
import org.eclipse.dd.mi.internal.MIPlugin;
34
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
35
import org.eclipse.dd.mi.service.command.commands.MIBreakAfter;
35
import org.eclipse.dd.mi.service.command.commands.MIBreakAfter;
36
import org.eclipse.dd.mi.service.command.commands.MIBreakCondition;
36
import org.eclipse.dd.mi.service.command.commands.MIBreakCondition;
37
import org.eclipse.dd.mi.service.command.commands.MIBreakDelete;
37
import org.eclipse.dd.mi.service.command.commands.MIBreakDelete;
Lines 271-283 Link Here
271
	    }
271
	    }
272
	}
272
	}
273
273
274
	// Not used, kept for API compatibility.  BackendExitedEvent is used instead
274
	// Not used, kept for API compatibility.  ICommandControlShutdownDMEvent is used instead
275
    @DsfServiceEventHandler
275
    @DsfServiceEventHandler
276
    public void eventDispatched(MIGDBExitEvent e) {
276
    public void eventDispatched(MIGDBExitEvent e) {
277
    }
277
    }
278
278
279
    @DsfServiceEventHandler
279
    @DsfServiceEventHandler
280
    public void eventDispatched(BackendExitedEvent e) {
280
    public void eventDispatched(ICommandControlShutdownDMEvent e) {
281
    }
281
    }
282
282
283
	///////////////////////////////////////////////////////////////////////////
283
	///////////////////////////////////////////////////////////////////////////
(-)src/org/eclipse/dd/mi/service/MIRunControl.java (-3 / +3 lines)
Lines 24-35 Link Here
24
import org.eclipse.dd.dsf.debug.service.IRunControl;
24
import org.eclipse.dd.dsf.debug.service.IRunControl;
25
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
25
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
26
import org.eclipse.dd.dsf.debug.service.command.CommandCache;
26
import org.eclipse.dd.dsf.debug.service.command.CommandCache;
27
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent;
27
import org.eclipse.dd.dsf.service.AbstractDsfService;
28
import org.eclipse.dd.dsf.service.AbstractDsfService;
28
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
29
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
29
import org.eclipse.dd.dsf.service.DsfSession;
30
import org.eclipse.dd.dsf.service.DsfSession;
30
import org.eclipse.dd.mi.internal.MIPlugin;
31
import org.eclipse.dd.mi.internal.MIPlugin;
31
import org.eclipse.dd.mi.service.command.AbstractMIControl;
32
import org.eclipse.dd.mi.service.command.AbstractMIControl;
32
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
33
import org.eclipse.dd.mi.service.command.commands.MIExecContinue;
33
import org.eclipse.dd.mi.service.command.commands.MIExecContinue;
34
import org.eclipse.dd.mi.service.command.commands.MIExecFinish;
34
import org.eclipse.dd.mi.service.command.commands.MIExecFinish;
35
import org.eclipse.dd.mi.service.command.commands.MIExecInterrupt;
35
import org.eclipse.dd.mi.service.command.commands.MIExecInterrupt;
Lines 404-417 Link Here
404
        fStepping = false;
404
        fStepping = false;
405
    }
405
    }
406
    
406
    
407
	// Not used, kept for API compatibility.  BackendExitedEvent is used instead
407
	// Not used, kept for API compatibility.  ICommandControlShutdownDMEvent is used instead
408
    @DsfServiceEventHandler
408
    @DsfServiceEventHandler
409
    public void eventDispatched(MIGDBExitEvent e) {
409
    public void eventDispatched(MIGDBExitEvent e) {
410
        fTerminated = true;
410
        fTerminated = true;
411
    }
411
    }
412
    
412
    
413
    @DsfServiceEventHandler
413
    @DsfServiceEventHandler
414
    public void eventDispatched(BackendExitedEvent e) {
414
    public void eventDispatched(ICommandControlShutdownDMEvent e) {
415
        fTerminated = true;
415
        fTerminated = true;
416
	}
416
	}
417
417
(-)src/org/eclipse/dd/mi/service/MIBreakpointsManager.java (-3 / +3 lines)
Lines 63-68 Link Here
63
import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext;
63
import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext;
64
import org.eclipse.dd.dsf.debug.service.ISourceLookup.ISourceLookupDMContext;
64
import org.eclipse.dd.dsf.debug.service.ISourceLookup.ISourceLookupDMContext;
65
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
65
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
66
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent;
66
import org.eclipse.dd.dsf.service.AbstractDsfService;
67
import org.eclipse.dd.dsf.service.AbstractDsfService;
67
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
68
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
68
import org.eclipse.dd.dsf.service.DsfSession;
69
import org.eclipse.dd.dsf.service.DsfSession;
Lines 72-78 Link Here
72
import org.eclipse.dd.mi.service.MIBreakpoints.BreakpointUpdatedEvent;
73
import org.eclipse.dd.mi.service.MIBreakpoints.BreakpointUpdatedEvent;
73
import org.eclipse.dd.mi.service.MIBreakpoints.MIBreakpointDMContext;
74
import org.eclipse.dd.mi.service.MIBreakpoints.MIBreakpointDMContext;
74
import org.eclipse.dd.mi.service.breakpoint.actions.BreakpointActionAdapter;
75
import org.eclipse.dd.mi.service.breakpoint.actions.BreakpointActionAdapter;
75
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
76
import org.eclipse.dd.mi.service.command.events.MIBreakpointHitEvent;
76
import org.eclipse.dd.mi.service.command.events.MIBreakpointHitEvent;
77
import org.eclipse.dd.mi.service.command.events.MIGDBExitEvent;
77
import org.eclipse.dd.mi.service.command.events.MIGDBExitEvent;
78
import org.eclipse.dd.mi.service.command.events.MIWatchpointScopeEvent;
78
import org.eclipse.dd.mi.service.command.events.MIWatchpointScopeEvent;
Lines 1228-1241 Link Here
1228
    // Session exit
1228
    // Session exit
1229
    //-------------------------------------------------------------------------
1229
    //-------------------------------------------------------------------------
1230
1230
1231
	// Not used, kept for API compatibility.  BackendExitedEvent is used instead
1231
	// Not used, kept for API compatibility.  ICommandControlShutdownDMEvent is used instead
1232
    @DsfServiceEventHandler
1232
    @DsfServiceEventHandler
1233
    public void eventDispatched(MIGDBExitEvent e) {
1233
    public void eventDispatched(MIGDBExitEvent e) {
1234
        terminated();
1234
        terminated();
1235
    }
1235
    }
1236
1236
1237
    @DsfServiceEventHandler
1237
    @DsfServiceEventHandler
1238
    public void eventDispatched(BackendExitedEvent e) {
1238
    public void eventDispatched(ICommandControlShutdownDMEvent e) {
1239
        terminated();
1239
        terminated();
1240
    }
1240
    }
1241
1241
(-)src/org/eclipse/dd/mi/service/command/MIControlDMContext.java (-4 / +10 lines)
Lines 14-27 Link Here
14
import org.eclipse.dd.dsf.datamodel.DMContexts;
14
import org.eclipse.dd.dsf.datamodel.DMContexts;
15
import org.eclipse.dd.dsf.datamodel.IDMContext;
15
import org.eclipse.dd.dsf.datamodel.IDMContext;
16
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
16
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
17
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
17
import org.eclipse.dd.dsf.service.IDsfService;
18
import org.eclipse.dd.dsf.service.IDsfService;
18
import org.osgi.framework.Constants;
19
import org.osgi.framework.Constants;
19
20
20
/**
21
/**
21
 * 
22
 * 
22
 */
23
 */
23
public class MIControlDMContext extends AbstractDMContext {
24
public class MIControlDMContext extends AbstractDMContext 
24
25
    implements ICommandControlDMContext
26
{
25
    private final String fCommandControlFilter;
27
    private final String fCommandControlFilter;
26
    private final String fCommandControlId;
28
    private final String fCommandControlId;
27
    
29
    
Lines 44-58 Link Here
44
    public String getCommandControlFilter() { 
46
    public String getCommandControlFilter() { 
45
        return fCommandControlFilter;
47
        return fCommandControlFilter;
46
    }
48
    }
49
50
    public String getCommandControlId() {
51
        return fCommandControlId;
52
    }
47
    
53
    
48
    @Override
54
    @Override
49
    public boolean equals(Object obj) {
55
    public boolean equals(Object obj) {
50
        return baseEquals(obj) && fCommandControlFilter.equals(((MIControlDMContext)obj).fCommandControlFilter);
56
        return baseEquals(obj) && fCommandControlId.equals(((MIControlDMContext)obj).fCommandControlId);
51
    }
57
    }
52
58
53
    @Override
59
    @Override
54
    public int hashCode() {
60
    public int hashCode() {
55
        return baseHashCode() + fCommandControlFilter.hashCode(); 
61
        return baseHashCode() + fCommandControlId.hashCode(); 
56
    }
62
    }
57
    
63
    
58
    @Override
64
    @Override
(-)src/org/eclipse/dd/mi/service/command/AbstractMIControl.java (-24 / +17 lines)
Lines 30-42 Link Here
30
import org.eclipse.core.runtime.Status;
30
import org.eclipse.core.runtime.Status;
31
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
31
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
32
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
32
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
33
import org.eclipse.dd.dsf.datamodel.AbstractDMEvent;
34
import org.eclipse.dd.dsf.datamodel.DMContexts;
33
import org.eclipse.dd.dsf.datamodel.DMContexts;
35
import org.eclipse.dd.dsf.datamodel.IDMContext;
34
import org.eclipse.dd.dsf.datamodel.IDMContext;
36
import org.eclipse.dd.dsf.debug.service.IRunControl;
35
import org.eclipse.dd.dsf.debug.service.IRunControl;
37
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
36
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
38
import org.eclipse.dd.dsf.debug.service.command.ICommand;
37
import org.eclipse.dd.dsf.debug.service.command.ICommand;
39
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
38
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService;
40
import org.eclipse.dd.dsf.debug.service.command.ICommandListener;
39
import org.eclipse.dd.dsf.debug.service.command.ICommandListener;
41
import org.eclipse.dd.dsf.debug.service.command.ICommandResult;
40
import org.eclipse.dd.dsf.debug.service.command.ICommandResult;
42
import org.eclipse.dd.dsf.debug.service.command.ICommandToken;
41
import org.eclipse.dd.dsf.debug.service.command.ICommandToken;
Lines 65-92 Link Here
65
 * Extending classes need to implement the initialize() and shutdown() methods.
64
 * Extending classes need to implement the initialize() and shutdown() methods.
66
 */
65
 */
67
public abstract class AbstractMIControl extends AbstractDsfService
66
public abstract class AbstractMIControl extends AbstractDsfService
68
    implements ICommandControl
67
    implements ICommandControlService
69
{
68
{
70
    final static String PROP_INSTANCE_ID = MIPlugin.PLUGIN_ID + ".miControlInstanceId";    //$NON-NLS-1$
69
    final static String PROP_INSTANCE_ID = MIPlugin.PLUGIN_ID + ".miControlInstanceId";    //$NON-NLS-1$
71
 
70
 
72
    /**
73
     * Event indicating that the back end process has started.
74
     */
75
    public static class BackendStartedEvent extends AbstractDMEvent<MIControlDMContext> {
76
        public BackendStartedEvent(MIControlDMContext context) {
77
            super(context);
78
        }
79
    }
80
    
81
    /**
82
     * Event indicating that the back end process has terminated.
83
     */
84
    public static class BackendExitedEvent extends AbstractDMEvent<MIControlDMContext> {
85
        public BackendExitedEvent(MIControlDMContext context) {
86
            super(context);
87
        }
88
    }
89
90
    /*
71
    /*
91
	 *  Thread control variables for the transmit and receive threads.
72
	 *  Thread control variables for the transmit and receive threads.
92
	 */
73
	 */
Lines 126-137 Link Here
126
     */
107
     */
127
    private boolean fStoppedCommandProcessing = false;
108
    private boolean fStoppedCommandProcessing = false;
128
109
129
    /*
110
    private String fId;
130
     *  Public constructor.
131
     */
132
    
111
    
133
    public AbstractMIControl(DsfSession session) {
112
    public AbstractMIControl(DsfSession session) {
134
        super(session);
113
        super(session);
114
        fId = "<no id>"; //$NON-NLS-1$
115
    }
116
117
    public AbstractMIControl(DsfSession session, String id) {
118
        super(session);
119
        fId = id;
135
    }
120
    }
136
121
137
    /**
122
    /**
Lines 363-368 Link Here
363
    
348
    
364
    abstract public MIControlDMContext getControlDMContext();
349
    abstract public MIControlDMContext getControlDMContext();
365
    
350
    
351
    public boolean isActive() {
352
        return !fStoppedCommandProcessing;
353
    }
354
    
355
    public String getId() {
356
        return fId;
357
    }
358
    
366
    /*
359
    /*
367
     *  These are the service routines which perform the various callouts back to the listeners.
360
     *  These are the service routines which perform the various callouts back to the listeners.
368
     */
361
     */

Return to bug 243611