mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[224434] Changed the context used in IRunControl.IStartedDMEvent and IRunControl.IExitedDMEvent events.
This commit is contained in:
parent
506cc50df7
commit
c50257d07d
5 changed files with 30 additions and 46 deletions
|
@ -502,10 +502,10 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay
|
|||
}
|
||||
|
||||
private void startAnnotationClearingJob(IRunControl.IExecutionDMContext execDmc) {
|
||||
// Make sure to add the dmc to the list.
|
||||
// Make sure to add the context to the list.
|
||||
fPendingExecDmcsToClear.add(execDmc);
|
||||
|
||||
// If lookup job is running, check it agains the exec context,
|
||||
// If lookup job is running, check it against the execution context,
|
||||
// and cancel it if matches.
|
||||
if (fRunningLookupJob != null) {
|
||||
if (DMContexts.isAncestorOf(fRunningLookupJob.getDmc(), execDmc)) {
|
||||
|
@ -513,8 +513,8 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay
|
|||
fRunningLookupJob = null;
|
||||
}
|
||||
}
|
||||
// If there is a pending displahy job, make sure it doesn't get
|
||||
// pre-empted by this event. If so, just cancel the pending
|
||||
// If there is a pending display job, make sure it doesn't get
|
||||
// preempted by this event. If so, just cancel the pending
|
||||
// display job.
|
||||
if (fPendingDisplayJob != null) {
|
||||
if (DMContexts.isAncestorOf(fPendingDisplayJob.getDmc(), execDmc)) {
|
||||
|
@ -539,7 +539,7 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay
|
|||
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IRunControl.IExitedDMEvent e) {
|
||||
startAnnotationClearingJob(e.getExecutionContext());
|
||||
startAnnotationClearingJob(e.getDMContext());
|
||||
}
|
||||
|
||||
@DsfServiceEventHandler
|
||||
|
|
|
@ -83,20 +83,14 @@ public interface IRunControl extends IDMService
|
|||
}
|
||||
|
||||
/**
|
||||
* Indicates that a new execution context (thread) was started. The DMC
|
||||
* for the event is the container of the new exec context.
|
||||
* Indicates that a new execution context (thread) was started.
|
||||
*/
|
||||
public interface IStartedDMEvent extends IDMEvent<IContainerDMContext> {
|
||||
IExecutionDMContext getExecutionContext();
|
||||
}
|
||||
public interface IStartedDMEvent extends IDMEvent<IExecutionDMContext> {}
|
||||
|
||||
/**
|
||||
* Indicates that an execution context has exited. As in the started event,
|
||||
* the DMC for the event is the container of the exec context.
|
||||
* Indicates that an execution context has exited.
|
||||
*/
|
||||
public interface IExitedDMEvent extends IDMEvent<IContainerDMContext> {
|
||||
IExecutionDMContext getExecutionContext();
|
||||
}
|
||||
public interface IExitedDMEvent extends IDMEvent<IExecutionDMContext> {}
|
||||
|
||||
/**
|
||||
* Display information for an execution context.
|
||||
|
|
|
@ -17,8 +17,10 @@ import java.util.concurrent.RejectedExecutionException;
|
|||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.dd.dsf.datamodel.DMContexts;
|
||||
import org.eclipse.dd.dsf.datamodel.IDMEvent;
|
||||
import org.eclipse.dd.dsf.debug.service.IRunControl;
|
||||
import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||
import org.eclipse.dd.dsf.debug.service.IRunControl.IExitedDMEvent;
|
||||
import org.eclipse.dd.dsf.debug.service.IRunControl.IStartedDMEvent;
|
||||
import org.eclipse.dd.dsf.service.DsfSession;
|
||||
|
@ -124,13 +126,16 @@ public class ContainerVMNode extends AbstractDMVMNode
|
|||
}
|
||||
|
||||
public void buildDelta(Object e, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor requestMonitor) {
|
||||
|
||||
if(e instanceof IRunControl.IContainerResumedDMEvent ||
|
||||
e instanceof IRunControl.IContainerSuspendedDMEvent)
|
||||
{
|
||||
parentDelta.addNode(createVMContext(((IDMEvent<?>)e).getDMContext()), IModelDelta.CONTENT);
|
||||
} else if (e instanceof IStartedDMEvent || e instanceof IExitedDMEvent) {
|
||||
parentDelta.addNode(createVMContext(((IDMEvent<?>)e).getDMContext()), IModelDelta.CONTENT);
|
||||
IContainerDMContext containerCtx = DMContexts.getAncestorOfType(
|
||||
((IDMEvent<?>)e).getDMContext(), IContainerDMContext.class);
|
||||
if (containerCtx != null) {
|
||||
parentDelta.addNode(createVMContext(containerCtx), IModelDelta.CONTENT);
|
||||
}
|
||||
} else if (e instanceof GDBControl.ExitedEvent ||
|
||||
e instanceof MIInferiorExitEvent ||
|
||||
e instanceof MIInferiorSignalExitEvent)
|
||||
|
|
|
@ -236,35 +236,20 @@ public class MIRunControl extends AbstractDsfService implements IRunControl
|
|||
}
|
||||
|
||||
@Immutable
|
||||
protected static class StartedDMEvent extends RunControlEvent<IContainerDMContext,MIThreadCreatedEvent>
|
||||
implements IStartedDMEvent{
|
||||
|
||||
private final IMIExecutionDMContext fExecutionDmc;
|
||||
|
||||
StartedDMEvent(IContainerDMContext containerDmc, IMIExecutionDMContext executionDmc, MIThreadCreatedEvent miInfo) {
|
||||
super(containerDmc, miInfo);
|
||||
fExecutionDmc = executionDmc;
|
||||
protected static class StartedDMEvent extends RunControlEvent<IExecutionDMContext,MIThreadCreatedEvent>
|
||||
implements IStartedDMEvent
|
||||
{
|
||||
StartedDMEvent(IMIExecutionDMContext executionDmc, MIThreadCreatedEvent miInfo) {
|
||||
super(executionDmc, miInfo);
|
||||
}
|
||||
|
||||
public IExecutionDMContext getExecutionContext(){
|
||||
return fExecutionDmc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Immutable
|
||||
protected static class ExitedDMEvent extends RunControlEvent<IContainerDMContext,MIThreadExitEvent>
|
||||
implements IExitedDMEvent{
|
||||
|
||||
private final IMIExecutionDMContext fExecutionDmc;
|
||||
|
||||
ExitedDMEvent(IContainerDMContext containerDmc, IMIExecutionDMContext executionDmc, MIThreadExitEvent miInfo) {
|
||||
super(containerDmc, miInfo);
|
||||
fExecutionDmc = executionDmc;
|
||||
}
|
||||
|
||||
public IExecutionDMContext getExecutionContext(){
|
||||
return fExecutionDmc;
|
||||
protected static class ExitedDMEvent extends RunControlEvent<IExecutionDMContext,MIThreadExitEvent>
|
||||
implements IExitedDMEvent
|
||||
{
|
||||
ExitedDMEvent(IMIExecutionDMContext executionDmc, MIThreadExitEvent miInfo) {
|
||||
super(executionDmc, miInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -375,7 +360,7 @@ public class MIRunControl extends AbstractDsfService implements IRunControl
|
|||
public void eventDispatched(final MIThreadCreatedEvent e) {
|
||||
IContainerDMContext containerDmc = e.getDMContext();
|
||||
IMIExecutionDMContext executionCtx = e.getId() != -1 ? new MIExecutionDMC(getSession().getId(), containerDmc, e.getId()) : null;
|
||||
getSession().dispatchEvent(new StartedDMEvent(containerDmc, executionCtx, e), getProperties());
|
||||
getSession().dispatchEvent(new StartedDMEvent(executionCtx, e), getProperties());
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -386,7 +371,7 @@ public class MIRunControl extends AbstractDsfService implements IRunControl
|
|||
public void eventDispatched(final MIThreadExitEvent e) {
|
||||
IContainerDMContext containerDmc = e.getDMContext();
|
||||
IMIExecutionDMContext executionCtx = e.getId() != -1 ? new MIExecutionDMC(getSession().getId(), containerDmc, e.getId()) : null;
|
||||
getSession().dispatchEvent(new ExitedDMEvent(containerDmc, executionCtx, e), getProperties());
|
||||
getSession().dispatchEvent(new ExitedDMEvent(executionCtx, e), getProperties());
|
||||
}
|
||||
|
||||
@DsfServiceEventHandler
|
||||
|
@ -430,7 +415,7 @@ public class MIRunControl extends AbstractDsfService implements IRunControl
|
|||
// Event handler when a thread is destroyed
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ExitedDMEvent e) {
|
||||
fMICommandCache.reset(e.getExecutionContext());
|
||||
fMICommandCache.reset(e.getDMContext());
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -438,7 +438,7 @@ public class MIRunControlTest extends BaseTestCase {
|
|||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IStartedDMEvent e) {
|
||||
if(fIsTestingThreadCreateEvent){
|
||||
if(((IMIExecutionDMContext)e.getExecutionContext()).getThreadId() != 2)
|
||||
if(((IMIExecutionDMContext)e.getDMContext()).getThreadId() != 2)
|
||||
/*
|
||||
* Set variable if thread create event is unsuccesful
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue