mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 243465 Removes the sending of Container events in non-stop mode
This commit is contained in:
parent
0414df9ea1
commit
be5c3679cb
2 changed files with 18 additions and 64 deletions
|
@ -173,6 +173,7 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses {
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* ID used by GDB to refer to threads.
|
* ID used by GDB to refer to threads.
|
||||||
|
* We use the same id as the one used in {@link MIProcesses#MIExecutionDMC}
|
||||||
*/
|
*/
|
||||||
private final String fId;
|
private final String fId;
|
||||||
|
|
||||||
|
@ -216,6 +217,7 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses {
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* ID given by the OS.
|
* ID given by the OS.
|
||||||
|
* For practicality, we use the same id as the one used in {@link MIProcesses#MIExecutionGroupDMC}
|
||||||
*/
|
*/
|
||||||
private final String fId;
|
private final String fId;
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ import org.osgi.framework.BundleContext;
|
||||||
public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
{
|
{
|
||||||
@Immutable
|
@Immutable
|
||||||
static class ExecutionData implements IExecutionDMData {
|
private static class ExecutionData implements IExecutionDMData {
|
||||||
private final StateChangeReason fReason;
|
private final StateChangeReason fReason;
|
||||||
ExecutionData(StateChangeReason reason) {
|
ExecutionData(StateChangeReason reason) {
|
||||||
fReason = reason;
|
fReason = reason;
|
||||||
|
@ -91,7 +91,7 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
* @see MIRunControl
|
* @see MIRunControl
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
static class RunControlEvent<V extends IDMContext, T extends MIEvent<? extends IDMContext>> extends AbstractDMEvent<V>
|
private static class RunControlEvent<V extends IDMContext, T extends MIEvent<? extends IDMContext>> extends AbstractDMEvent<V>
|
||||||
implements IDMEvent<V>, IMIDMEvent
|
implements IDMEvent<V>, IMIDMEvent
|
||||||
{
|
{
|
||||||
final private T fMIInfo;
|
final private T fMIInfo;
|
||||||
|
@ -107,7 +107,7 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
* Indicates that the given thread has been suspended.
|
* Indicates that the given thread has been suspended.
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
static class SuspendedEvent extends RunControlEvent<IExecutionDMContext, MIStoppedEvent>
|
private static class SuspendedEvent extends RunControlEvent<IExecutionDMContext, MIStoppedEvent>
|
||||||
implements ISuspendedDMEvent
|
implements ISuspendedDMEvent
|
||||||
{
|
{
|
||||||
SuspendedEvent(IExecutionDMContext ctx, MIStoppedEvent miInfo) {
|
SuspendedEvent(IExecutionDMContext ctx, MIStoppedEvent miInfo) {
|
||||||
|
@ -134,7 +134,7 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
static class ContainerSuspendedEvent extends SuspendedEvent
|
private static class ContainerSuspendedEvent extends SuspendedEvent
|
||||||
implements IContainerSuspendedDMEvent
|
implements IContainerSuspendedDMEvent
|
||||||
{
|
{
|
||||||
final IExecutionDMContext[] triggeringDmcs;
|
final IExecutionDMContext[] triggeringDmcs;
|
||||||
|
@ -150,15 +150,7 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
static class ThreadSuspendedEvent extends SuspendedEvent
|
private static class ResumedEvent extends RunControlEvent<IExecutionDMContext, MIRunningEvent>
|
||||||
{
|
|
||||||
ThreadSuspendedEvent(IExecutionDMContext executionDmc, MIStoppedEvent miInfo) {
|
|
||||||
super(executionDmc, miInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Immutable
|
|
||||||
static class ResumedEvent extends RunControlEvent<IExecutionDMContext, MIRunningEvent>
|
|
||||||
implements IResumedDMEvent
|
implements IResumedDMEvent
|
||||||
{
|
{
|
||||||
ResumedEvent(IExecutionDMContext ctx, MIRunningEvent miInfo) {
|
ResumedEvent(IExecutionDMContext ctx, MIRunningEvent miInfo) {
|
||||||
|
@ -186,7 +178,7 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
static class ContainerResumedEvent extends ResumedEvent
|
private static class ContainerResumedEvent extends ResumedEvent
|
||||||
implements IContainerResumedDMEvent
|
implements IContainerResumedDMEvent
|
||||||
{
|
{
|
||||||
final IExecutionDMContext[] triggeringDmcs;
|
final IExecutionDMContext[] triggeringDmcs;
|
||||||
|
@ -203,15 +195,7 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
static class ThreadResumedEvent extends ResumedEvent
|
private static class StartedDMEvent extends RunControlEvent<IExecutionDMContext,MIThreadCreatedEvent>
|
||||||
{
|
|
||||||
ThreadResumedEvent(IExecutionDMContext executionDmc, MIRunningEvent miInfo) {
|
|
||||||
super(executionDmc, miInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Immutable
|
|
||||||
static class StartedDMEvent extends RunControlEvent<IExecutionDMContext,MIThreadCreatedEvent>
|
|
||||||
implements IStartedDMEvent
|
implements IStartedDMEvent
|
||||||
{
|
{
|
||||||
StartedDMEvent(IMIExecutionDMContext executionDmc, MIThreadCreatedEvent miInfo) {
|
StartedDMEvent(IMIExecutionDMContext executionDmc, MIThreadCreatedEvent miInfo) {
|
||||||
|
@ -220,7 +204,7 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
static class ExitedDMEvent extends RunControlEvent<IExecutionDMContext,MIThreadExitEvent>
|
private static class ExitedDMEvent extends RunControlEvent<IExecutionDMContext,MIThreadExitEvent>
|
||||||
implements IExitedDMEvent
|
implements IExitedDMEvent
|
||||||
{
|
{
|
||||||
ExitedDMEvent(IMIExecutionDMContext executionDmc, MIThreadExitEvent miInfo) {
|
ExitedDMEvent(IMIExecutionDMContext executionDmc, MIThreadExitEvent miInfo) {
|
||||||
|
@ -719,21 +703,13 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's a thread execution context (since we are in non-stop mode)
|
// It's a thread execution context (since we are in non-stop mode)
|
||||||
event = new ThreadResumedEvent(e.getDMContext(), e);
|
event = new ResumedEvent(e.getDMContext(), e);
|
||||||
updateThreadState(executionDmc, (ThreadResumedEvent) event);
|
updateThreadState(executionDmc, (ResumedEvent) event);
|
||||||
getSession().dispatchEvent(event, getProperties());
|
getSession().dispatchEvent(event, getProperties());
|
||||||
fMICommandCache.reset();
|
fMICommandCache.reset();
|
||||||
|
|
||||||
// Find the container context, which is used in multi-threaded debugging.
|
|
||||||
IContainerDMContext containerDmc = DMContexts.getAncestorOfType(e.getDMContext(), IContainerDMContext.class);
|
|
||||||
if (containerDmc != null) {
|
|
||||||
IExecutionDMContext triggeringCtx = !e.getDMContext().equals(containerDmc) ? e.getDMContext() : null;
|
|
||||||
event = new ContainerResumedEvent(containerDmc, e, triggeringCtx);
|
|
||||||
getSession().dispatchEvent(event, getProperties());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateThreadState(IMIExecutionDMContext context, ThreadResumedEvent event) {
|
private void updateThreadState(IMIExecutionDMContext context, ResumedEvent event) {
|
||||||
StateChangeReason reason = event.getReason();
|
StateChangeReason reason = event.getReason();
|
||||||
boolean isStepping = reason.equals(StateChangeReason.STEP);
|
boolean isStepping = reason.equals(StateChangeReason.STEP);
|
||||||
MIThreadRunState threadState = fThreadRunStates.get(context);
|
MIThreadRunState threadState = fThreadRunStates.get(context);
|
||||||
|
@ -761,21 +737,13 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's a thread execution context (since we are in non-stop mode)
|
// It's a thread execution context (since we are in non-stop mode)
|
||||||
event = new ThreadSuspendedEvent(e.getDMContext(), e);
|
event = new SuspendedEvent(e.getDMContext(), e);
|
||||||
updateThreadState(executionDmc, (ThreadSuspendedEvent) event);
|
updateThreadState(executionDmc, (SuspendedEvent) event);
|
||||||
getSession().dispatchEvent(event, getProperties());
|
getSession().dispatchEvent(event, getProperties());
|
||||||
fMICommandCache.reset();
|
fMICommandCache.reset();
|
||||||
|
|
||||||
// Find the container context, which is used in multi-threaded debugging.
|
|
||||||
IContainerDMContext containerDmc = DMContexts.getAncestorOfType(e.getDMContext(), IContainerDMContext.class);
|
|
||||||
if (containerDmc != null) {
|
|
||||||
IExecutionDMContext triggeringCtx = !e.getDMContext().equals(containerDmc) ? e.getDMContext() : null;
|
|
||||||
event = new ContainerSuspendedEvent(containerDmc, e, triggeringCtx);
|
|
||||||
getSession().dispatchEvent(event, getProperties());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateThreadState(IMIExecutionDMContext context, ThreadSuspendedEvent event) {
|
private void updateThreadState(IMIExecutionDMContext context, SuspendedEvent event) {
|
||||||
StateChangeReason reason = event.getReason();
|
StateChangeReason reason = event.getReason();
|
||||||
MIThreadRunState threadState = fThreadRunStates.get(context);
|
MIThreadRunState threadState = fThreadRunStates.get(context);
|
||||||
if (threadState == null) {
|
if (threadState == null) {
|
||||||
|
@ -813,35 +781,19 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl
|
||||||
}
|
}
|
||||||
|
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(ThreadResumedEvent e) {
|
public void eventDispatched(ResumedEvent e) {
|
||||||
IMIExecutionDMContext context = DMContexts.getAncestorOfType(e.getDMContext(), IMIExecutionDMContext.class);
|
|
||||||
if (context == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(ThreadSuspendedEvent e) {
|
public void eventDispatched(SuspendedEvent e) {
|
||||||
IMIExecutionDMContext context = DMContexts.getAncestorOfType(e.getDMContext(), IMIExecutionDMContext.class);
|
|
||||||
if (context == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(ContainerResumedEvent e) {
|
public void eventDispatched(ContainerResumedEvent e) {
|
||||||
IMIExecutionDMContext context = DMContexts.getAncestorOfType(e.getDMContext(), IMIExecutionDMContext.class);
|
|
||||||
if (context == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(ContainerSuspendedEvent e) {
|
public void eventDispatched(ContainerSuspendedEvent e) {
|
||||||
IMIExecutionDMContext context = DMContexts.getAncestorOfType(e.getDMContext(), IMIExecutionDMContext.class);
|
|
||||||
if (context == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
|
|
Loading…
Add table
Reference in a new issue