Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Head: fix for PR 45533

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/ChangeLog,v
retrieving revision 1.184
diff -u -r1.184 ChangeLog
--- ChangeLog	18 Oct 2003 01:22:37 -0000	1.184
+++ ChangeLog	29 Oct 2003 17:35:05 -0000
@@ -1,3 +1,15 @@
+2003-10-29 Alain Magloire
+
+	Deal with PR 45533
+
+	Make a preferenc for Timeout and use it when launching
+	the ICDebugger session, when way wait for for gdb
+	to say "ready" by returning the prompt.
+
+	* src/org/eclipse/cdt/debug/mi/core/MISession.java
+	* src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
+	* src/org/eclipse/cdt/debug/mi/core/IMIConstants.java
+	
 2003-10-17 Alain Magloire
 
 	Put the framework to deal with deferred breakpoint.
Index: src/org/eclipse/cdt/debug/mi/core/IMIConstants.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMIConstants.java,v
retrieving revision 1.1
diff -u -r1.1 IMIConstants.java
--- src/org/eclipse/cdt/debug/mi/core/IMIConstants.java	4 Oct 2002 18:09:04 -0000	1.1
+++ src/org/eclipse/cdt/debug/mi/core/IMIConstants.java	29 Oct 2003 17:35:05 -0000
@@ -22,6 +22,16 @@
 	 * Preference key for default MI request timeout value.
 	 */
 	public static final String PREF_REQUEST_TIMEOUT = PLUGIN_ID + ".PREF_REQUEST_TIMEOUT"; //$NON-NLS-1$
+
+	/**
+	 * Preference key for default MI launch request timeout value.
+	 */
+	public static final String PREF_REQUEST_LAUNCH_TIMEOUT = PLUGIN_ID + ".PREF_REQUEST_LAUNCH_TIMEOUT"; //$NON-NLS-1$
+
+	/**
+	 * The default MI request timeout when no preference is set.
+	 */
+	public static final int DEF_REQUEST_LAUNCH_TIMEOUT = 30000;
 	
 	/**
 	 * The default MI request timeout when no preference is set.
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.43
diff -u -r1.43 MIPlugin.java
--- src/org/eclipse/cdt/debug/mi/core/MIPlugin.java	26 Sep 2003 16:58:24 -0000	1.43
+++ src/org/eclipse/cdt/debug/mi/core/MIPlugin.java	29 Oct 2003 17:35:05 -0000
@@ -71,8 +71,8 @@
 	 * @throws MIException
 	 * @return MISession
 	 */
-	public MISession createMISession(Process process, PTY pty, int timeout, int type) throws MIException {
-		return new MISession(process, pty, timeout, type);
+	public MISession createMISession(Process process, PTY pty, int timeout, int type, int launchTimeout) throws MIException {
+		return new MISession(process, pty, timeout, type, launchTimeout);
 	}
 
 	/**
@@ -87,7 +87,8 @@
 		MIPlugin plugin = getDefault();
 		Preferences prefs = plugin.getPluginPreferences();
 		int timeout = prefs.getInt(IMIConstants.PREF_REQUEST_TIMEOUT);
-		return createMISession(process, pty, timeout, type);
+		int launchTimeout = prefs.getInt(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT);
+		return createMISession(process, pty, timeout, type, launchTimeout);
 	}
 
 	/**
@@ -344,10 +345,15 @@
 		syncStartup.start();
 		
 		synchronized (pgdb) {
-			int timeout = getAdjustedTimeout(program);
+			MIPlugin plugin = getDefault();
+			Preferences prefs = plugin.getPluginPreferences();
+			int launchTimeout = prefs.getInt(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT);
+			if (launchTimeout <= 0) {
+				launchTimeout = getAdjustedTimeout(program);
+			}
 			while (syncStartup.isAlive()) {
 				try {
-					pgdb.wait(timeout);
+					pgdb.wait(launchTimeout);
 					break;
 				} catch (InterruptedException e) {
 				}
Index: src/org/eclipse/cdt/debug/mi/core/MISession.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MISession.java,v
retrieving revision 1.43
diff -u -r1.43 MISession.java
--- src/org/eclipse/cdt/debug/mi/core/MISession.java	25 Apr 2003 20:49:10 -0000	1.43
+++ src/org/eclipse/cdt/debug/mi/core/MISession.java	29 Oct 2003 17:35:05 -0000
@@ -89,7 +89,7 @@
 	 * @param timeout time in milliseconds to wait for command response.
 	 * @param type the type of debugin session.
 	 */
-	public MISession(Process process, PTY pty, int timeout, int type) throws MIException {
+	public MISession(Process process, PTY pty, int timeout, int type, int launchTimeout) throws MIException {
 
 		gdbProcess = process;
 		inChannel = process.getInputStream();
@@ -142,15 +142,15 @@
 		// Like confirmation and screen size.
 
 		MIGDBSet confirm = new MIGDBSet(new String[]{"confirm", "off"});
-		postCommand(confirm);
+		postCommand(confirm, launchTimeout);
 		confirm.getMIInfo(); 
 
 		MIGDBSet width = new MIGDBSet(new String[]{"width", "0"});
-		postCommand(width);
+		postCommand(width, launchTimeout);
 		confirm.getMIInfo(); 
 
 		MIGDBSet height = new MIGDBSet(new String[]{"height", "0"});
-		postCommand(height);
+		postCommand(height, launchTimeout);
 		confirm.getMIInfo(); 
 	}
 



Back to the top