mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[214384] - [debug view] When a program runs to completion, the debug target still shows it as running.
This commit is contained in:
parent
63e0dc8c6a
commit
23afc8c598
2 changed files with 26 additions and 10 deletions
|
@ -117,9 +117,7 @@ public class ContainerVMNode extends AbstractDMVMNode
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDeltaFlags(Object e) {
|
public int getDeltaFlags(Object e) {
|
||||||
if(e instanceof IStartedDMEvent || e instanceof IExitedDMEvent) {
|
if(e instanceof IRunControl.IContainerResumedDMEvent ||
|
||||||
return IModelDelta.CONTENT;
|
|
||||||
} else if(e instanceof IRunControl.IContainerResumedDMEvent ||
|
|
||||||
e instanceof IRunControl.IContainerSuspendedDMEvent)
|
e instanceof IRunControl.IContainerSuspendedDMEvent)
|
||||||
{
|
{
|
||||||
return IModelDelta.CONTENT;
|
return IModelDelta.CONTENT;
|
||||||
|
@ -129,6 +127,8 @@ public class ContainerVMNode extends AbstractDMVMNode
|
||||||
return IModelDelta.EXPAND;
|
return IModelDelta.EXPAND;
|
||||||
} else if (e instanceof InferiorStartedDMEvent) {
|
} else if (e instanceof InferiorStartedDMEvent) {
|
||||||
return IModelDelta.EXPAND | IModelDelta.SELECT;
|
return IModelDelta.EXPAND | IModelDelta.SELECT;
|
||||||
|
} if(e instanceof IStartedDMEvent || e instanceof IExitedDMEvent) {
|
||||||
|
return IModelDelta.CONTENT;
|
||||||
}
|
}
|
||||||
return IModelDelta.NO_CHANGE;
|
return IModelDelta.NO_CHANGE;
|
||||||
}
|
}
|
||||||
|
@ -138,18 +138,20 @@ public class ContainerVMNode extends AbstractDMVMNode
|
||||||
e instanceof IRunControl.IContainerSuspendedDMEvent)
|
e instanceof IRunControl.IContainerSuspendedDMEvent)
|
||||||
{
|
{
|
||||||
parentDelta.addNode(createVMContext(((IDMEvent<?>)e).getDMContext()), IModelDelta.CONTENT);
|
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) {
|
} else if (e instanceof IStartedDMEvent || e instanceof IExitedDMEvent) {
|
||||||
IContainerDMContext containerCtx = DMContexts.getAncestorOfType(
|
IContainerDMContext containerCtx = DMContexts.getAncestorOfType(
|
||||||
((IDMEvent<?>)e).getDMContext(), IContainerDMContext.class);
|
((IDMEvent<?>)e).getDMContext(), IContainerDMContext.class);
|
||||||
if (containerCtx != null) {
|
if (containerCtx != null) {
|
||||||
parentDelta.addNode(createVMContext(containerCtx), IModelDelta.CONTENT);
|
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();
|
requestMonitor.done();
|
||||||
|
|
|
@ -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.IRootVMNode;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMNode;
|
import org.eclipse.dd.dsf.ui.viewmodel.IVMNode;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider;
|
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.DebugEvent;
|
||||||
import org.eclipse.debug.core.DebugPlugin;
|
import org.eclipse.debug.core.DebugPlugin;
|
||||||
import org.eclipse.debug.core.IDebugEventSetListener;
|
import org.eclipse.debug.core.IDebugEventSetListener;
|
||||||
|
@ -133,6 +137,16 @@ public class LaunchVMProvider extends AbstractDMVMProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canSkipHandlingEvent(Object newEvent, Object eventToSkip) {
|
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
|
// To optimize view performance when stepping rapidly, skip events that came
|
||||||
// before the last suspended events. However, the debug view can get suspended
|
// 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
|
// events for different threads, so make sure to skip only the events if they
|
||||||
|
|
Loading…
Add table
Reference in a new issue