Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2003-11-19 20:46:38 +0000
committerMikhail Khodjaiants2003-11-19 20:46:38 +0000
commitdc03462d49db49e26105666d7786b44ccc1c42a2 (patch)
tree58a06a7a3182efbcaef694cdd3580c07122f69cf /debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse
parent30d3f00aefeb783ba0deafd842371137d0774ed3 (diff)
downloadorg.eclipse.cdt-dc03462d49db49e26105666d7786b44ccc1c42a2.tar.gz
org.eclipse.cdt-dc03462d49db49e26105666d7786b44ccc1c42a2.tar.xz
org.eclipse.cdt-dc03462d49db49e26105666d7786b44ccc1c42a2.zip
Fix for PR 45533: MIException while creating MISession can leave an orphan gdb process.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java61
1 files changed, 42 insertions, 19 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java
index 14338bfc538..460b4c67532 100644
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java
+++ b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java
@@ -36,8 +36,11 @@ import org.eclipse.ui.help.WorkbenchHelp;
*/
public class MIPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
{
- // Timeout preference widgets
- IntegerFieldEditor fTimeoutText;
+ // Debugger timeout preference widgets
+ IntegerFieldEditor fDebugTimeoutText;
+
+ // Launch timeout preference widgets
+ IntegerFieldEditor fLaunchTimeoutText;
/**
* Constructor for MIPreferencePage.
@@ -95,7 +98,8 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
*/
private void setValues()
{
- fTimeoutText.setStringValue( new Integer( MIPlugin.getDefault().getPluginPreferences().getInt( IMIConstants.PREF_REQUEST_TIMEOUT ) ).toString() );
+ fDebugTimeoutText.setStringValue( new Integer( MIPlugin.getDefault().getPluginPreferences().getInt( IMIConstants.PREF_REQUEST_TIMEOUT ) ).toString() );
+ fLaunchTimeoutText.setStringValue( new Integer( MIPlugin.getDefault().getPluginPreferences().getInt( IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT ) ).toString() );
}
/**
@@ -121,7 +125,8 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
private void setDefaultValues()
{
- fTimeoutText.setStringValue( new Integer( IMIConstants.DEF_REQUEST_TIMEOUT ).toString() );
+ fDebugTimeoutText.setStringValue( new Integer( IMIConstants.DEF_REQUEST_TIMEOUT ).toString() );
+ fLaunchTimeoutText.setStringValue( new Integer( IMIConstants.DEF_REQUEST_LAUNCH_TIMEOUT ).toString() );
}
/* (non-Javadoc)
@@ -150,25 +155,25 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
data.horizontalSpan = 2;
spacingComposite.setLayoutData( data );
- fTimeoutText = new IntegerFieldEditor( IMIConstants.PREF_REQUEST_TIMEOUT, "Debugger &timeout (ms):", spacingComposite );
- data = new GridData();
- data.widthHint = convertWidthInCharsToPixels( 10 );
- fTimeoutText.getTextControl( spacingComposite ).setLayoutData( data );
- fTimeoutText.setPreferenceStore( MIUIPlugin.getDefault().getPreferenceStore() );
- fTimeoutText.setPreferencePage( this );
- fTimeoutText.setValidateStrategy( StringFieldEditor.VALIDATE_ON_KEY_STROKE );
- fTimeoutText.setValidRange( IMIConstants.MIN_REQUEST_TIMEOUT, IMIConstants.MAX_REQUEST_TIMEOUT );
- String minValue = Integer.toString( IMIConstants.MIN_REQUEST_TIMEOUT );
- String maxValue = Integer.toString( IMIConstants.MAX_REQUEST_TIMEOUT );
- fTimeoutText.setErrorMessage( MessageFormat.format( "The valid value range is [{0},{1}].", new String[]{ minValue, maxValue } ) );
- fTimeoutText.load();
- fTimeoutText.setPropertyChangeListener(
+ fDebugTimeoutText = createTimeoutField( IMIConstants.PREF_REQUEST_TIMEOUT, "&Debugger timeout (ms):", spacingComposite );
+ fDebugTimeoutText.setPropertyChangeListener(
new IPropertyChangeListener()
{
public void propertyChange( PropertyChangeEvent event )
{
if ( event.getProperty().equals( FieldEditor.IS_VALID ) )
- setValid( fTimeoutText.isValid() );
+ setValid( fDebugTimeoutText.isValid() );
+ }
+ } );
+
+ fLaunchTimeoutText = createTimeoutField( IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, "&Launch &timeout (ms):", spacingComposite );
+ fLaunchTimeoutText.setPropertyChangeListener(
+ new IPropertyChangeListener()
+ {
+ public void propertyChange( PropertyChangeEvent event )
+ {
+ if ( event.getProperty().equals( FieldEditor.IS_VALID ) )
+ setValid( fLaunchTimeoutText.isValid() );
}
} );
}
@@ -179,6 +184,24 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
*/
private void storeValues()
{
- MIPlugin.getDefault().getPluginPreferences().setValue( IMIConstants.PREF_REQUEST_TIMEOUT, fTimeoutText.getIntValue() );
+ MIPlugin.getDefault().getPluginPreferences().setValue( IMIConstants.PREF_REQUEST_TIMEOUT, fDebugTimeoutText.getIntValue() );
+ MIPlugin.getDefault().getPluginPreferences().setValue( IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, fLaunchTimeoutText.getIntValue() );
+ }
+
+ private IntegerFieldEditor createTimeoutField( String preference, String label, Composite parent )
+ {
+ IntegerFieldEditor toText = new IntegerFieldEditor( preference, label, parent );
+ GridData data = new GridData();
+ data.widthHint = convertWidthInCharsToPixels( 10 );
+ toText.getTextControl( parent ).setLayoutData( data );
+ toText.setPreferenceStore( MIUIPlugin.getDefault().getPreferenceStore() );
+ toText.setPreferencePage( this );
+ toText.setValidateStrategy( StringFieldEditor.VALIDATE_ON_KEY_STROKE );
+ toText.setValidRange( IMIConstants.MIN_REQUEST_TIMEOUT, IMIConstants.MAX_REQUEST_TIMEOUT );
+ String minValue = Integer.toString( IMIConstants.MIN_REQUEST_TIMEOUT );
+ String maxValue = Integer.toString( IMIConstants.MAX_REQUEST_TIMEOUT );
+ toText.setErrorMessage( MessageFormat.format( "The valid value range is [{0},{1}].", new String[]{ minValue, maxValue } ) );
+ toText.load();
+ return toText;
}
}

Back to the top