summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlvaro Sanchez-Leon2013-09-04 08:15:51 (EDT)
committer Marc Khouzam2013-09-06 13:14:29 (EDT)
commit2519bcb8cbaaab425e898162d8c76a1f1a0bb765 (patch)
tree2dc23a351e70775ea80b573f3d08138c357b0187
parent9d1233f05a4edcfa87c29ab0b88a360f2a7c7e0f (diff)
downloadorg.eclipse.cdt-2519bcb8cbaaab425e898162d8c76a1f1a0bb765.zip
org.eclipse.cdt-2519bcb8cbaaab425e898162d8c76a1f1a0bb765.tar.gz
org.eclipse.cdt-2519bcb8cbaaab425e898162d8c76a1f1a0bb765.tar.bz2
bug 415362: [visualizer] occasional exception when exercising step intorefs/changes/06/16106/4
selection https://bugs.eclipse.org/bugs/show_bug.cgi?id=415362 Change-Id: Ifea7bc53881bbb1d10dfd55c85fb3116dcb0817d Signed-off-by: Alvaro Sanchez-Leon <alvsan09@gmail.com> Reviewed-on: https://git.eclipse.org/r/16106 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl.java30
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java14
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java4
3 files changed, 46 insertions, 2 deletions
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 b319033..002d7cc 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 b23e19a..42cf51a 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 52d5fe6..71c3972 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.
*/