diff --git a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/viewmodel/launch/ContainerVMNode.java b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/viewmodel/launch/ContainerVMNode.java index ad92416378e..8db5d4dbab3 100644 --- a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/viewmodel/launch/ContainerVMNode.java +++ b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/viewmodel/launch/ContainerVMNode.java @@ -117,10 +117,8 @@ public class ContainerVMNode extends AbstractDMVMNode } public int getDeltaFlags(Object e) { - if(e instanceof IStartedDMEvent || e instanceof IExitedDMEvent) { - return IModelDelta.CONTENT; - } else if(e instanceof IRunControl.IContainerResumedDMEvent || - e instanceof IRunControl.IContainerSuspendedDMEvent) + if(e instanceof IRunControl.IContainerResumedDMEvent || + e instanceof IRunControl.IContainerSuspendedDMEvent) { return IModelDelta.CONTENT; } else if (e instanceof GDBControl.GDBExitedEvent || e instanceof InferiorExitedDMEvent) { @@ -129,6 +127,8 @@ public class ContainerVMNode extends AbstractDMVMNode return IModelDelta.EXPAND; } else if (e instanceof InferiorStartedDMEvent) { return IModelDelta.EXPAND | IModelDelta.SELECT; + } if(e instanceof IStartedDMEvent || e instanceof IExitedDMEvent) { + return IModelDelta.CONTENT; } return IModelDelta.NO_CHANGE; } @@ -138,18 +138,20 @@ public class ContainerVMNode extends AbstractDMVMNode e instanceof IRunControl.IContainerSuspendedDMEvent) { parentDelta.addNode(createVMContext(((IDMEvent)e).getDMContext()), IModelDelta.CONTENT); + } else if (e instanceof GDBControl.GDBExitedEvent || e instanceof InferiorExitedDMEvent) { + // Note: we must process the inferior started/exited events before the thread's + // started/exited events otherwise the inferior's handlers would never be called. + parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.CONTENT); + } else if (e instanceof GDBStartedEvent) { + parentDelta.addNode(createVMContext(((IDMEvent)e).getDMContext()), IModelDelta.EXPAND); + } else if (e instanceof InferiorStartedDMEvent) { + parentDelta.addNode(createVMContext(((IDMEvent)e).getDMContext()), IModelDelta.EXPAND | IModelDelta.SELECT); } else if (e instanceof IStartedDMEvent || e instanceof IExitedDMEvent) { IContainerDMContext containerCtx = DMContexts.getAncestorOfType( ((IDMEvent)e).getDMContext(), IContainerDMContext.class); if (containerCtx != null) { parentDelta.addNode(createVMContext(containerCtx), IModelDelta.CONTENT); } - } else if (e instanceof GDBControl.GDBExitedEvent || e instanceof InferiorExitedDMEvent) { - parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.CONTENT); - } else if (e instanceof GDBStartedEvent) { - parentDelta.addNode(createVMContext(((IDMEvent)e).getDMContext()), IModelDelta.EXPAND); - } else if (e instanceof InferiorStartedDMEvent) { - parentDelta.addNode(createVMContext(((IDMEvent)e).getDMContext()), IModelDelta.EXPAND | IModelDelta.SELECT); } requestMonitor.done(); diff --git a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java index 84e0cd40b09..8b358f3d747 100644 --- a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java +++ b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java @@ -27,6 +27,10 @@ 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.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider; +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.MIInferiorProcess.InferiorExitedDMEvent; +import org.eclipse.dd.mi.service.command.MIInferiorProcess.InferiorStartedDMEvent; import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.IDebugEventSetListener; @@ -133,6 +137,16 @@ public class LaunchVMProvider extends AbstractDMVMProvider @Override protected boolean canSkipHandlingEvent(Object newEvent, Object eventToSkip) { + // Never skip the process lifecycle events. + if (eventToSkip instanceof InferiorExitedDMEvent || + eventToSkip instanceof InferiorStartedDMEvent || + eventToSkip instanceof GDBStartedEvent || + eventToSkip instanceof GDBExitedEvent) + { + return false; + } + + // To optimize view performance when stepping rapidly, skip events that came // before the last suspended events. However, the debug view can get suspended // events for different threads, so make sure to skip only the events if they