1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Fix for PR 45533: MIException while creating MISession can leave an orphan gdb process.

This commit is contained in:
Mikhail Khodjaiants 2003-11-19 21:22:26 +00:00
parent d4457e175e
commit 9cfd14bfc1
2 changed files with 5 additions and 24 deletions

View file

@ -1,3 +1,8 @@
2003-11-19 Mikhail Khodjaiants
Fix for PR 45533: MIException while creating MISession can leave an orphan gdb process.
* src/org/eclipse/cdt/debug/mi/core/MIPlugin.java: removed the 'getAdjustedTimeout' method.
2003-11-19 Mikhail Khodjaiants
Fix for PR 45533: MIException while creating MISession can leave an orphan gdb process.

View file

@ -289,27 +289,6 @@ public class MIPlugin extends Plugin {
}
}
/**
* Retrieve the session timeout.
*
* Allow at least one second per megabyte as a minimum on the timeout
* (note one second is an arbitrary choice based on swapping performance).
* This is required for loading the symbols from very large programs.
*/
private int getAdjustedTimeout(File program) {
Preferences prefs = plugin.getPluginPreferences();
int timeout = prefs.getInt(IMIConstants.PREF_REQUEST_TIMEOUT); //milliseconds
if(program != null && program.exists()) {
long programSize = program.length();
int minimumTimeout = (int)(programSize / 1000L);
if(timeout < minimumTimeout) {
//debugLog("Adjusting timeout from " + timeout + "ms to " + minimumTimeout + "ms");
timeout = minimumTimeout;
}
}
return timeout;
}
/**
* Do some basic synchronisation, gdb make take some time to load
* for whatever reasons.
@ -348,9 +327,6 @@ public class MIPlugin extends Plugin {
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(launchTimeout);