From c0f8b0d48ca6424c7a8102d5d892541f32a3d44d Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Sun, 10 Apr 2011 01:28:19 +0000 Subject: [PATCH] Bug 342358: An inferior ran to completion should be considered suspended --- .../dsf/gdb/service/GDBRunControl_7_0_NS.java | 2 +- .../cdt/dsf/mi/service/MIRunControl.java | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) 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 faaf2d2a345..df3ceb10b2d 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 @@ -426,7 +426,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo } } // If this container does not have any threads, it means it wasn't started - // yet, so we can consider it suspended + // yet or it was terminated, so we can consider it suspended if (hasThread == false) return true; } 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 26d6f446902..d1cc321f984 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 @@ -620,13 +620,25 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I } /** - * Event handler when a thread is destroyed * @nooverride This method is not intended to be re-implemented or extended by clients. * @noreference This method is not intended to be referenced by clients. */ @DsfServiceEventHandler - public void eventDispatched(ExitedDMEvent e) { - fMICommandCache.reset(e.getDMContext()); + public void eventDispatched(IExitedDMEvent e) { + if (e.getDMContext() instanceof IContainerDMContext) { + // When the process terminates, we should consider it as suspended + // In fact, we did get a stopped event, but our processing of it + // needs some cleaning up. Until then, let's trigger of this event + // Bug 342358 + fMICommandCache.setContextAvailable(e.getDMContext(), true); + fMICommandCache.reset(); + + fSuspended = true; + fStepping = false; + fResumePending = false; + } else { + fMICommandCache.reset(e.getDMContext()); + } } ///////////////////////////////////////////////////////////////////////////