Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2003-12-08 17:29:56 -0500
committerMikhail Khodjaiants2003-12-08 17:29:56 -0500
commit61cd51d9b686546d380fedc08198eaf339e386f2 (patch)
tree7e7461c2b7a58b38f82eda3ba6bb71b4ad2e0d37
parent724d096415afc6e93072c653c7e1c7408a53a55d (diff)
downloadorg.eclipse.cdt-61cd51d9b686546d380fedc08198eaf339e386f2.tar.gz
org.eclipse.cdt-61cd51d9b686546d380fedc08198eaf339e386f2.tar.xz
org.eclipse.cdt-61cd51d9b686546d380fedc08198eaf339e386f2.zip
Target.terminate() did not pass the exception up.
Added new method MIInferior.terminate().
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/ChangeLog8
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java21
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java6
3 files changed, 26 insertions, 9 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
index fac4cb0febb..4d9c58e5cab 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
@@ -1,3 +1,11 @@
+2003-12-08 Alain Magloire
+
+ Target.terminate() did not pass the exception up.
+ Added new method MIInferior.terminate().
+
+ * src/org/eclipse/cdt/debug/mi/core/MIInferior.java
+ * src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
+
2003-12-02 Alain Magloire
Retry the stack-info-depth when it fails the first time
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java
index caa7411cbc3..198bf3a459b 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java
@@ -142,6 +142,14 @@ public class MIInferior extends Process {
* @see java.lang.Process#destroy()
*/
public void destroy() {
+ try {
+ terminate();
+ } catch (MIException e) {
+ // do nothing.
+ }
+ }
+
+ public void terminate() throws MIException {
// An inferior will be destroy():interrupt and kill if
// - For attach session:
// the inferior was not disconnected yet (no need to try
@@ -153,14 +161,11 @@ public class MIInferior extends Process {
CommandFactory factory = session.getCommandFactory();
MIExecAbort abort = factory.createMIExecAbort();
- try {
- // Try to interrupt the inferior, first.
- interrupt();
- session.postCommand(abort);
- abort.getMIInfo();
- setTerminated(abort.getToken(), true);
- } catch (MIException e) {
- }
+ // Try to interrupt the inferior, first.
+ interrupt();
+ session.postCommand(abort);
+ abort.getMIInfo();
+ setTerminated(abort.getToken(), true);
}
}
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
index cb8538311de..b286dda145e 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
@@ -594,7 +594,11 @@ public class Target implements ICDITarget {
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#terminate()
*/
public void terminate() throws CDIException {
- session.getMISession().getMIInferior().destroy();
+ try {
+ session.getMISession().getMIInferior().terminate();
+ } catch (MIException e) {
+ throw new MI2CDIException(e);
+ }
}
/**

Back to the top