Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Proposed CDT 1.2 patches 2/3

CDT-1.2 Patch: 2/3
2. If gdb takes too long to load the application, the MISession can time out,
   leaving behind orphan session resources, including possibly a running
   gdb process. This can lead to failure of subsequent launches, even after
   the user increases timeout values.

   The proposed patch is to catch the exception and terminate the session, and
   then display the session time out message.

Ashish.
#!/bin/bash
--- ./precious/old/MISession.java	2003-10-22 19:40:41.000000000 -0400
+++ ./precious/new/MISession.java	2003-10-22 19:40:41.000000000 -0400
@@ -141,17 +141,24 @@
 		// Disable a certain number of irritations from gdb.
 		// Like confirmation and screen size.

-		MIGDBSet confirm = new MIGDBSet(new String[]{"confirm", "off"});
-		postCommand(confirm);
-		confirm.getMIInfo();
-
-		MIGDBSet width = new MIGDBSet(new String[]{"width", "0"});
-		postCommand(width);
-		confirm.getMIInfo();
-
-		MIGDBSet height = new MIGDBSet(new String[]{"height", "0"});
-		postCommand(height);
-		confirm.getMIInfo();
+		try {
+			MIGDBSet confirm = new MIGDBSet(new String[]{"confirm", "off"});
+			postCommand(confirm);
+			confirm.getMIInfo();
+			
+			MIGDBSet width = new MIGDBSet(new String[]{"width", "0"});
+			postCommand(width);
+			confirm.getMIInfo();
+			
+			MIGDBSet height = new MIGDBSet(new String[]{"height", "0"});
+			postCommand(height);
+			confirm.getMIInfo();
+		} catch (MIException e1) {
+			// Have to clean up here if gdb is not responding.
+			//e1.printStackTrace();
+			terminate();
+			throw e1;
+		}
 	}

 	/**



Back to the top