Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2009-01-21 04:10:51 +0000
committerMarc Khouzam2009-01-21 04:10:51 +0000
commit55244050c6380f01bf8f7f2084ebae3ec46ca602 (patch)
treeda59b12eec46c526b41ab47e6935d5ad9ed6b058 /dsf-gdb
parentf21a1cd7f7c3d63934aef66d443b120eb8d915a7 (diff)
downloadorg.eclipse.cdt-55244050c6380f01bf8f7f2084ebae3ec46ca602.tar.gz
org.eclipse.cdt-55244050c6380f01bf8f7f2084ebae3ec46ca602.tar.xz
org.eclipse.cdt-55244050c6380f01bf8f7f2084ebae3ec46ca602.zip
[261753] protects us against sending MI Stopped events with a null context if GDB generates an empty *stopped event
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor_7_0.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor_7_0.java
index 578c8a5ec12..0045d085787 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor_7_0.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor_7_0.java
@@ -119,7 +119,7 @@ public class MIRunControlEventProcessor_7_0
MIExecAsyncOutput exec = (MIExecAsyncOutput) oobr;
// Change of state.
String state = exec.getAsyncClass();
- if ("stopped".equals(state)) { //$NON-NLS-1$
+ if (STOPPED_REASON.equals(state)) {
// Re-set the thread and stack level to -1 when stopped event is recvd.
// This is to synchronize the state between GDB back-end and AbstractMIControl.
fCommandControl.resetCurrentThreadLevel();
@@ -154,7 +154,7 @@ public class MIRunControlEventProcessor_7_0
fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties());
}
}
- else if ("running".equals(state)) { //$NON-NLS-1$
+ else if (RUNNING_REASON.equals(state)) {
MIEvent<?> event = createEvent(RUNNING_REASON, exec);
if (event != null) {
fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties());
@@ -285,6 +285,11 @@ public class MIRunControlEventProcessor_7_0
IThreadDMContext threadDmc = procService.createThreadContext(procDmc, threadId);
execDmc = procService.createExecutionContext(containerDmc, threadDmc, threadId);
}
+
+ if (execDmc == null) {
+ // Badly formatted event
+ return null;
+ }
MIEvent<?> event = null;
if ("breakpoint-hit".equals(reason)) { //$NON-NLS-1$
@@ -342,7 +347,7 @@ public class MIRunControlEventProcessor_7_0
if (rr != null) {
// Check if the state changed.
String state = rr.getResultClass();
- if ("running".equals(state)) { //$NON-NLS-1$
+ if (RUNNING_REASON.equals(state)) {
// Store the type of command that is the trigger for the coming
// *running event
if (cmd instanceof MIExecNext) { fLastRunningCmdType = MIRunningEvent.NEXT; }

Back to the top