Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2003-12-16 11:49:40 -0500
committerMikhail Khodjaiants2003-12-16 11:49:40 -0500
commit18c0d5ab97e5915263b514d1f6856acf44a90f5b (patch)
treeb032ccaa33ef7944cc6f8f61a1e7553bf30dbdc1
parent9477658e08756d3faa9707817d6d35d83d11ac39 (diff)
downloadorg.eclipse.cdt-18c0d5ab97e5915263b514d1f6856acf44a90f5b.tar.gz
org.eclipse.cdt-18c0d5ab97e5915263b514d1f6856acf44a90f5b.tar.xz
org.eclipse.cdt-18c0d5ab97e5915263b514d1f6856acf44a90f5b.zip
Fix for PR 48870: Terminate gdb if attach to process fails.
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/ChangeLog6
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java33
2 files changed, 24 insertions, 15 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
index d5fd83e92a9..2a8845d816b 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
@@ -1,3 +1,9 @@
+2003-12-16 Mikhail Khodjaiants
+
+ Fix for PR 48870: Terminate gdb if attach to process fails.
+
+ * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
+
2003-12-09 Alain Magloire
Do not try to interrupt if the target was suspended.
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
index 6a10f45e9f4..d7effcae677 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
@@ -258,23 +258,26 @@ public class MIPlugin extends Plugin {
throw e;
}
CommandFactory factory = session.getCommandFactory();
- if (targetParams != null && targetParams.length > 0) {
- MITargetSelect target = factory.createMITargetSelect(targetParams);
- session.postCommand(target);
- MIInfo info = target.getMIInfo();
- if (info == null) {
- pgdb.destroy();
- throw new MIException("No answer");
+ try {
+ if (targetParams != null && targetParams.length > 0) {
+ MITargetSelect target = factory.createMITargetSelect(targetParams);
+ session.postCommand(target);
+ MIInfo info = target.getMIInfo();
+ if (info == null) {
+ throw new MIException("No answer");
+ }
}
- }
- if (pid > 0) {
- MITargetAttach attach = factory.createMITargetAttach(pid);
- session.postCommand(attach);
- MIInfo info = attach.getMIInfo();
- if (info == null) {
- pgdb.destroy();
- throw new MIException("No answer");
+ if (pid > 0) {
+ MITargetAttach attach = factory.createMITargetAttach(pid);
+ session.postCommand(attach);
+ MIInfo info = attach.getMIInfo();
+ if (info == null) {
+ throw new MIException("No answer");
+ }
}
+ } catch (MIException e) {
+ pgdb.destroy();
+ throw e;
}
//@@@ We have to manually set the suspended state when we attach
session.getMIInferior().setSuspended();

Back to the top