Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2005-07-07 15:59:59 -0400
committerAlain Magloire2005-07-07 15:59:59 -0400
commitc1fa89c0408a2fcccd5b2a9a88b1ba8a1a0dc73a (patch)
treea155803766603a06f3f77449e9172469c1ed897b
parentc162527605aef79dd428a06f927011a82ee5c035 (diff)
downloadorg.eclipse.cdt-c1fa89c0408a2fcccd5b2a9a88b1ba8a1a0dc73a.tar.gz
org.eclipse.cdt-c1fa89c0408a2fcccd5b2a9a88b1ba8a1a0dc73a.tar.xz
org.eclipse.cdt-c1fa89c0408a2fcccd5b2a9a88b1ba8a1a0dc73a.zip
2005-07-07 Alain Magloire
Try to suspend the target before disconnecting. * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/ChangeLog4
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java10
2 files changed, 14 insertions, 0 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
index 3ae7a4ab2d..c444d588e1 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
@@ -1,3 +1,7 @@
+2005-07-07 Alain Magloire
+ Try to suspend the target before disconnecting.
+ * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
+
2005-06-29 Alain Magloire
Fix PR 100602
* mi/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java
diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
index e4fe3a0a78..438dc6b809 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
@@ -45,6 +45,7 @@ import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.RxThread;
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
+import org.eclipse.cdt.debug.mi.core.cdi.EventManager;
import org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager;
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
import org.eclipse.cdt.debug.mi.core.cdi.MemoryManager;
@@ -569,6 +570,15 @@ public class Target extends SessionObject implements ICDITarget {
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#disconnect()
*/
public void disconnect() throws CDIException {
+ // if Target is running try to suspend first.
+ if (isRunning()) {
+ try {
+ ((EventManager)getSession().getEventManager()).allowProcessingEvents(false);
+ suspend();
+ } finally {
+ ((EventManager)getSession().getEventManager()).allowProcessingEvents(true);
+ }
+ }
CommandFactory factory = miSession.getCommandFactory();
MITargetDetach detach = factory.createMITargetDetach();
try {

Back to the top