Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Fix for PR 43496

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/ChangeLog,v
retrieving revision 1.178
diff -u -r1.178 ChangeLog
--- ChangeLog	11 Sep 2003 17:44:35 -0000	1.178
+++ ChangeLog	25 Sep 2003 16:03:52 -0000
@@ -1,3 +1,11 @@
+2003-09-25 Alain Magloire
+
+	Fix for PR 43496.
+	In the event of an error we should Process.destroy()
+	after creating the Process.
+
+	* src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
+
 2003-11-10 Mikhail Khodjaiants
 	Moving the shared library search paths block to mi UI.
 	* IMILaunchConfigurationConstants.java: added the 'ATTR_DEBUGGER_SOLIB_PATH' attribute.
@@ -6,7 +14,7 @@
 
 	Fix to info shared parsing.
 
-	* src/org/eclipse/cdt/debug/mi/core/outpu/MIInfoSharedLibary.java
+	* src/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibary.java
 
 2003-09-09 Mikhail Khodjaiants
 	Regrouping the launch configuration constants.
Index: src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java,v
retrieving revision 1.41
diff -u -r1.41 MIPlugin.java
--- src/org/eclipse/cdt/debug/mi/core/MIPlugin.java	10 Jul 2003 19:25:10 -0000	1.41
+++ src/org/eclipse/cdt/debug/mi/core/MIPlugin.java	25 Sep 2003 16:03:52 -0000
@@ -132,7 +132,13 @@
 		}
 
 		Process pgdb = ProcessFactory.getFactory().exec(args);
-		MISession session = createMISession(pgdb, pty, MISession.PROGRAM);
+		MISession session;
+		try {
+			session = createMISession(pgdb, pty, MISession.PROGRAM);
+		} catch (MIException e) {
+			pgdb.destroy();
+			throw e;
+		}
 		// Try to detect if we have been attach via "target remote localhost:port"
 		// and set the state to be suspended.
 		try {
@@ -140,6 +146,7 @@
 			session.postCommand(cmd);
 			MIInfo info = cmd.getMIInfo();
 			if (info == null) {
+				pgdb.destroy();
 				throw new MIException("No answer");
 			}
 			//@@@ We have to manually set the suspended state when we attach
@@ -175,7 +182,13 @@
 			args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", "-c", core.getAbsolutePath(), program.getAbsolutePath()};
 		}
 		Process pgdb = ProcessFactory.getFactory().exec(args);
-		MISession session = createMISession(pgdb, null, MISession.CORE);
+		MISession session;
+		try {
+			session = createMISession(pgdb, null, MISession.CORE);
+		} catch (MIException e) {
+			pgdb.destroy();
+			throw e;
+		}
 		return new Session(session);
 	}
 
@@ -202,13 +215,20 @@
 			args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", program.getAbsolutePath()};
 		}
 		Process pgdb = ProcessFactory.getFactory().exec(args);
-		MISession session = createMISession(pgdb, null, MISession.ATTACH);
+		MISession session;
+		try {
+			session = createMISession(pgdb, null, MISession.ATTACH);
+		} catch (MIException e) {
+			pgdb.destroy();
+			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");
 			}
 		}
@@ -217,6 +237,7 @@
 			session.postCommand(attach);
 			MIInfo info = attach.getMIInfo();
 			if (info == null) {
+				pgdb.destroy();
 				throw new MIException("No answer");
 			}
 		}



Back to the top