1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 416571 - [run control] Run-to-line gets aborted when setting a

breakpoint during the run-to-line

Change-Id: Id9182266c6b2ad9795ed18d3ddad900e4bd9b480
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/16170
This commit is contained in:
Marc Khouzam 2013-09-06 15:06:47 -04:00
parent 2519bcb8cb
commit f6a7143011
3 changed files with 26 additions and 10 deletions

View file

@ -50,6 +50,7 @@ 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.MISignalEvent;
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;
@ -384,7 +385,17 @@ public class GDBRunControl extends MIRunControl {
@Override
@DsfServiceEventHandler
public void eventDispatched(final MIStoppedEvent e) {
if (processRunToLineStoppedEvent(e)) {
// A disabled signal event is due to interrupting the target
// to set a breakpoint. This can happen during a run-to-line
// or step-into operation, so we need to check it first.
if (fDisableNextSignalEvent && e instanceof MISignalEvent) {
fDisableNextSignalEvent = false;
fSilencedSignalEvent = e;
// We don't broadcast this stopped event
return;
}
if (processRunToLineStoppedEvent(e)) {
// If RunToLine is not completed
return;
}

View file

@ -1549,6 +1549,16 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo
*/
@DsfServiceEventHandler
public void eventDispatched(final MIStoppedEvent e) {
// A disabled signal event is due to interrupting the target
// to set a breakpoint. This can happen during a run-to-line
// or step-into operation, so we need to check it first.
IMIExecutionDMContext threadDmc = DMContexts.getAncestorOfType(e.getDMContext(), IMIExecutionDMContext.class);
if (e instanceof MISignalEvent && fDisableNextSignalEventDmcSet.remove(threadDmc)) {
fSilencedSignalEventMap.put(threadDmc, e);
// Don't broadcast the stopped event
return;
}
if (processRunToLineStoppedEvent(e)) {
// If RunToLine is not completed
return;
@ -1561,13 +1571,6 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo
}
private void broadcastStop(final MIStoppedEvent e) {
IMIExecutionDMContext threadDmc = DMContexts.getAncestorOfType(e.getDMContext(), IMIExecutionDMContext.class);
if (e instanceof MISignalEvent && fDisableNextSignalEventDmcSet.remove(threadDmc)) {
fSilencedSignalEventMap.put(threadDmc, e);
// Don't broadcast the stopped event
return;
}
IDMEvent<?> event = null;
MIBreakpointDMContext bp = null;
if (e instanceof MIBreakpointHitEvent) {

View file

@ -406,13 +406,15 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
protected boolean fDisableNextRunningEvent;
/**
* Indicates that the next MISignal (MIStopped) event should be silenced.
* @since 4.3
*/
private boolean fDisableNextSignalEvent;
protected boolean fDisableNextSignalEvent;
/**
* Stores the silenced MIStopped event in case we need to use it
* for a failure.
* @since 4.3
*/
private MIStoppedEvent fSilencedSignalEvent;
protected MIStoppedEvent fSilencedSignalEvent;
private static final int FAKE_THREAD_ID = 0;