1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 243216

MIGDBExitedEvent was listened for but never issued.   Replaced with BackendExitedEvent
This commit is contained in:
Marc Khouzam 2008-08-05 19:15:02 +00:00
parent fef4792098
commit 0d74c407e4
9 changed files with 56 additions and 33 deletions

View file

@ -31,6 +31,8 @@ import org.eclipse.dd.dsf.ui.viewmodel.VMDelta;
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider;
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.IDMVMContext;
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl;
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendStartedEvent;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
@ -125,9 +127,9 @@ public class ContainerVMNode extends AbstractContainerVMNode
@Override
public int getDeltaFlags(Object e) {
if (e instanceof GDBControl.GDBExitedEvent) {
if (e instanceof BackendExitedEvent) {
return IModelDelta.CONTENT;
} else if (e instanceof GDBControl.GDBStartedEvent) {
} else if (e instanceof BackendStartedEvent) {
return IModelDelta.EXPAND;
}
return super.getDeltaFlags(e);
@ -135,9 +137,9 @@ public class ContainerVMNode extends AbstractContainerVMNode
@Override
public void buildDelta(Object e, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor requestMonitor) {
if (e instanceof GDBControl.GDBExitedEvent) {
if (e instanceof BackendExitedEvent) {
parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.CONTENT);
} else if (e instanceof GDBControl.GDBStartedEvent) {
} else if (e instanceof BackendStartedEvent) {
parentDelta.addNode(createVMContext(((IDMEvent<?>)e).getDMContext()), IModelDelta.EXPAND);
} else {
super.buildDelta(e, parentDelta, nodeOffset, requestMonitor);

View file

@ -20,8 +20,8 @@ import org.eclipse.dd.dsf.service.DsfSession;
import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMAdapter;
import org.eclipse.dd.dsf.ui.viewmodel.IRootVMNode;
import org.eclipse.dd.dsf.ui.viewmodel.IVMNode;
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl.GDBExitedEvent;
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl.GDBStartedEvent;
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendStartedEvent;
import org.eclipse.dd.mi.service.command.MIInferiorProcess.InferiorExitedDMEvent;
import org.eclipse.dd.mi.service.command.MIInferiorProcess.InferiorStartedDMEvent;
import org.eclipse.debug.core.DebugPlugin;
@ -75,8 +75,8 @@ public class LaunchVMProvider extends AbstractLaunchVMProvider
// Never skip the process lifecycle events.
if (eventToSkip instanceof InferiorExitedDMEvent ||
eventToSkip instanceof InferiorStartedDMEvent ||
eventToSkip instanceof GDBStartedEvent ||
eventToSkip instanceof GDBExitedEvent)
eventToSkip instanceof BackendStartedEvent ||
eventToSkip instanceof BackendExitedEvent)
{
return false;
}

View file

@ -39,6 +39,7 @@ import org.eclipse.dd.gdb.internal.GdbPlugin;
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl;
import org.eclipse.dd.mi.service.command.AbstractCLIProcess;
import org.eclipse.dd.mi.service.command.MIInferiorProcess;
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
@ -184,7 +185,7 @@ public class GdbLaunch extends Launch
///////////////////////////////////////////////////////////////////////////
// IServiceEventListener
@DsfServiceEventHandler public void eventDispatched(GDBControl.GDBExitedEvent event) {
@DsfServiceEventHandler public void eventDispatched(BackendExitedEvent event) {
shutdownSession(new RequestMonitor(ImmediateExecutor.getInstance(), null));
}

View file

@ -38,7 +38,6 @@ import org.eclipse.dd.dsf.concurrent.DsfRunnable;
import org.eclipse.dd.dsf.concurrent.IDsfStatusConstants;
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
import org.eclipse.dd.dsf.concurrent.Sequence;
import org.eclipse.dd.dsf.datamodel.AbstractDMEvent;
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
import org.eclipse.dd.dsf.service.DsfSession;
@ -73,23 +72,6 @@ import org.osgi.framework.BundleContext;
*/
public class GDBControl extends AbstractMIControl {
/**
* Event indicating that the back end process process has started.
*/
public static class GDBStartedEvent extends AbstractDMEvent<GDBControlDMContext> {
public GDBStartedEvent(GDBControlDMContext context) {
super(context);
}
}
/**
* Event indicating that the back end process has terminated.
*/
public static class GDBExitedEvent extends AbstractDMEvent<GDBControlDMContext> {
public GDBExitedEvent(GDBControlDMContext context) {
super(context);
}
}
private static int fgInstanceCounter = 0;
private final GDBControlDMContext fControlDmc;
@ -436,7 +418,7 @@ public class GDBControl extends AbstractMIControl {
}
@DsfServiceEventHandler
public void eventDispatched(GDBExitedEvent e) {
public void eventDispatched(BackendExitedEvent e) {
// Handle our "GDB Exited" event and stop processing commands.
stopCommandProcessing();
}
@ -463,7 +445,7 @@ public class GDBControl extends AbstractMIControl {
Thread.interrupted();
} finally {
fExited = true;
getSession().dispatchEvent(new GDBExitedEvent(fControlDmc) {}, getProperties());
getSession().dispatchEvent(new BackendExitedEvent(fControlDmc) {}, getProperties());
}
}
}
@ -735,7 +717,7 @@ public class GDBControl extends AbstractMIControl {
public void initialize(final RequestMonitor requestMonitor) {
getSession().addServiceEventListener(GDBControl.this, null);
register(new String[]{ ICommandControl.class.getName(), AbstractMIControl.class.getName() }, new Hashtable<String,String>());
getSession().dispatchEvent(new GDBStartedEvent(getGDBDMContext()), getProperties());
getSession().dispatchEvent(new BackendStartedEvent(getGDBDMContext()), getProperties());
requestMonitor.done();
}

View file

@ -31,6 +31,7 @@ import org.eclipse.dd.dsf.service.AbstractDsfService;
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
import org.eclipse.dd.dsf.service.DsfSession;
import org.eclipse.dd.mi.internal.MIPlugin;
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
import org.eclipse.dd.mi.service.command.commands.MIBreakAfter;
import org.eclipse.dd.mi.service.command.commands.MIBreakCondition;
import org.eclipse.dd.mi.service.command.commands.MIBreakDelete;
@ -270,8 +271,13 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints
}
}
// Not used, kept for API compatibility. BackendExitedEvent is used instead
@DsfServiceEventHandler
public void eventDispatched(MIGDBExitEvent e) {
}
@DsfServiceEventHandler
public void eventDispatched(BackendExitedEvent e) {
}
///////////////////////////////////////////////////////////////////////////

View file

@ -72,6 +72,7 @@ import org.eclipse.dd.mi.service.MIBreakpoints.BreakpointRemovedEvent;
import org.eclipse.dd.mi.service.MIBreakpoints.BreakpointUpdatedEvent;
import org.eclipse.dd.mi.service.MIBreakpoints.MIBreakpointDMContext;
import org.eclipse.dd.mi.service.breakpoint.actions.BreakpointActionAdapter;
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
import org.eclipse.dd.mi.service.command.events.MIBreakpointHitEvent;
import org.eclipse.dd.mi.service.command.events.MIGDBExitEvent;
import org.eclipse.dd.mi.service.command.events.MIWatchpointScopeEvent;
@ -1227,11 +1228,17 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
// Session exit
//-------------------------------------------------------------------------
// Not used, kept for API compatibility. BackendExitedEvent is used instead
@DsfServiceEventHandler
public void eventDispatched(MIGDBExitEvent e) {
terminated();
}
@DsfServiceEventHandler
public void eventDispatched(BackendExitedEvent e) {
terminated();
}
private void terminated() {
clearBreakpointStatus(fPlatformBPs.keySet().toArray(new ICBreakpoint[fPlatformBPs.size()]));
fPlatformBPs.clear();

View file

@ -29,6 +29,7 @@ import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
import org.eclipse.dd.dsf.service.DsfSession;
import org.eclipse.dd.mi.internal.MIPlugin;
import org.eclipse.dd.mi.service.command.AbstractMIControl;
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
import org.eclipse.dd.mi.service.command.commands.MIExecContinue;
import org.eclipse.dd.mi.service.command.commands.MIExecFinish;
import org.eclipse.dd.mi.service.command.commands.MIExecInterrupt;
@ -403,10 +404,15 @@ public class MIRunControl extends AbstractDsfService implements IRunControl
fStepping = false;
}
// Not used, kept for API compatibility. BackendExitedEvent is used instead
@DsfServiceEventHandler
public void eventDispatched(MIGDBExitEvent e) {
fTerminated = true;
}
@DsfServiceEventHandler
public void eventDispatched(BackendExitedEvent e) {
fTerminated = true;
}

View file

@ -35,6 +35,7 @@ import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
import org.eclipse.dd.dsf.service.DsfSession;
import org.eclipse.dd.mi.internal.MIPlugin;
import org.eclipse.dd.mi.service.command.AbstractMIControl;
import org.eclipse.dd.mi.service.command.AbstractMIControl.BackendExitedEvent;
import org.eclipse.dd.mi.service.command.commands.MIExecContinue;
import org.eclipse.dd.mi.service.command.commands.MIExecFinish;
import org.eclipse.dd.mi.service.command.commands.MIExecInterrupt;
@ -48,7 +49,6 @@ import org.eclipse.dd.mi.service.command.events.IMIDMEvent;
import org.eclipse.dd.mi.service.command.events.MIBreakpointHitEvent;
import org.eclipse.dd.mi.service.command.events.MIErrorEvent;
import org.eclipse.dd.mi.service.command.events.MIEvent;
import org.eclipse.dd.mi.service.command.events.MIGDBExitEvent;
import org.eclipse.dd.mi.service.command.events.MIRunningEvent;
import org.eclipse.dd.mi.service.command.events.MISharedLibEvent;
import org.eclipse.dd.mi.service.command.events.MISignalEvent;
@ -850,7 +850,7 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
}
@DsfServiceEventHandler
public void eventDispatched(MIGDBExitEvent e) {
public void eventDispatched(BackendExitedEvent e) {
fTerminated = true;
}

View file

@ -30,6 +30,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
import org.eclipse.dd.dsf.datamodel.AbstractDMEvent;
import org.eclipse.dd.dsf.datamodel.DMContexts;
import org.eclipse.dd.dsf.datamodel.IDMContext;
import org.eclipse.dd.dsf.debug.service.IRunControl;
@ -68,6 +69,24 @@ public abstract class AbstractMIControl extends AbstractDsfService
{
final static String PROP_INSTANCE_ID = MIPlugin.PLUGIN_ID + ".miControlInstanceId"; //$NON-NLS-1$
/**
* Event indicating that the back end process has started.
*/
public static class BackendStartedEvent extends AbstractDMEvent<MIControlDMContext> {
public BackendStartedEvent(MIControlDMContext context) {
super(context);
}
}
/**
* Event indicating that the back end process has terminated.
*/
public static class BackendExitedEvent extends AbstractDMEvent<MIControlDMContext> {
public BackendExitedEvent(MIControlDMContext context) {
super(context);
}
}
/*
* Thread control variables for the transmit and receive threads.
*/