diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl.java index b31903385da..002d7cc8a8f 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl.java @@ -10,6 +10,7 @@ * Ericsson AB - Modified for additional functionality * Nokia - create and use backend service. * Alvaro Sanchez-Leon (Ericsson AB) - Support for Step into selection (bug 244865) + * Alvaro Sanchez-Leon (Ericsson AB) - Bug 415362 *******************************************************************************/ package org.eclipse.cdt.dsf.gdb.service; @@ -48,6 +49,7 @@ import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; import org.eclipse.cdt.dsf.mi.service.command.events.MIBreakpointHitEvent; import org.eclipse.cdt.dsf.mi.service.command.events.MIEvent; import org.eclipse.cdt.dsf.mi.service.command.events.MIInferiorExitEvent; +import org.eclipse.cdt.dsf.mi.service.command.events.MIRunningEvent; import org.eclipse.cdt.dsf.mi.service.command.events.MIStoppedEvent; import org.eclipse.cdt.dsf.mi.service.command.events.MIThreadExitEvent; import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo; @@ -393,6 +395,34 @@ public class GDBRunControl extends MIRunControl { } } + /* (non-Javadoc) + * @see org.eclipse.cdt.dsf.mi.service.MIRunControl#eventDispatched(org.eclipse.cdt.dsf.mi.service.command.events.MIRunningEvent) + */ + @Override + @DsfServiceEventHandler + public void eventDispatched(final MIRunningEvent e) { + if (fDisableNextRunningEvent) { + // Leave the action to the super class + super.eventDispatched(e); + return; + } + + if (fRunToLineActiveOperation == null && fStepInToSelectionActiveOperation == null) { + // No special case here, i.e. send notification + super.eventDispatched(e); + } else { + // Either RuntoLine or StepIntoSelection operations are active + if (fLatestEvent instanceof ISuspendedDMEvent) { + // Need to send out Running event notification only once per operation, then a stop event is expected at + // the end of it + super.eventDispatched(e); + } + } + + // No event dispatched if RuntoLine or StepIntoSelection operations are active and a previous event is not a + // Suspended event, i.e. only one Running event distributed per operation + } + private boolean processRunToLineStoppedEvent(final MIStoppedEvent e) { if (fRunToLineActiveOperation != null) { int bpId = 0; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java index b23e19ae9c2..42cf51abf7f 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java @@ -11,6 +11,7 @@ * Indel AG - [369622] fixed moveToLine using MinGW * Marc Khouzam (Ericsson) - Support for operations on multiple execution contexts (bug 330974) * Alvaro Sanchez-Leon (Ericsson AB) - Support for Step into selection (bug 244865) + * Alvaro Sanchez-Leon (Ericsson AB) - Bug 415362 *******************************************************************************/ package org.eclipse.cdt.dsf.gdb.service; @@ -1528,7 +1529,18 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo return; } - getSession().dispatchEvent(new ResumedEvent(e.getDMContext(), e), getProperties()); + if (fRunToLineActiveOperation == null && fStepInToSelectionActiveOperation == null) { + // No special case here, i.e. send notification + getSession().dispatchEvent(new ResumedEvent(e.getDMContext(), e), getProperties()); + } else { + // Either RunToLine or StepIntoSelection operations are active + MIThreadRunState threadState = fThreadRunStates.get(e.getDMContext()); + if (threadState == null || threadState.fLatestEvent instanceof ISuspendedDMEvent) { + // Need to send out Running event notification, only once per operation, then a stop event is expected + // at the end of the operation + getSession().dispatchEvent(new ResumedEvent(e.getDMContext(), e), getProperties()); + } + } } /** diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java index 52d5fe64f9f..71c39729009 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java @@ -12,6 +12,7 @@ * Indel AG - [369622] fixed moveToLine using MinGW * Marc Khouzam (Ericsson) - Make each thread an IDisassemblyDMContext (bug 352748) * Alvaro Sanchez-Leon (Ericsson AB) - Support for Step into selection (bug 244865) + * Alvaro Sanchez-Leon (Ericsson AB) - Bug 415362 *******************************************************************************/ package org.eclipse.cdt.dsf.mi.service; @@ -400,8 +401,9 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I private IExecutionDMContext fStateChangeTriggeringContext; /** * Indicates that the next MIRunning event should be silenced. + * @since 4.3 */ - private boolean fDisableNextRunningEvent; + protected boolean fDisableNextRunningEvent; /** * Indicates that the next MISignal (MIStopped) event should be silenced. */