Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2006-03-01 21:49:42 +0000
committerMikhail Khodjaiants2006-03-01 21:49:42 +0000
commit87084d47d158cde8a4f3a773a766f8a24c83c304 (patch)
treebc6090a4a817ee923ca26730cf6794426e5c78ef /debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse
parent40de7ba4a969098e273d6fd75badae7074c1e87d (diff)
downloadorg.eclipse.cdt-87084d47d158cde8a4f3a773a766f8a24c83c304.tar.gz
org.eclipse.cdt-87084d47d158cde8a4f3a773a766f8a24c83c304.tar.xz
org.eclipse.cdt-87084d47d158cde8a4f3a773a766f8a24c83c304.zip
Select the first available command factory when a new launch configuration is created.
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/StandardGDBDebuggerPage.java44
1 files changed, 22 insertions, 22 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/StandardGDBDebuggerPage.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/StandardGDBDebuggerPage.java
index 0af28da5872..ac089f2a4e3 100644
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/StandardGDBDebuggerPage.java
+++ b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/StandardGDBDebuggerPage.java
@@ -134,29 +134,29 @@ public class StandardGDBDebuggerPage extends AbstractCDebuggerPage implements Ob
index = i;
}
fCommandFactoryCombo.setItems( descLabels );
- if ( index >= 0 ) {
- fCommandFactoryCombo.select( index );
- String[] miVersions = fCommandFactoryDescriptors[index].getMIVersions();
- fProtocolCombo.setItems( miVersions );
- if ( miVersions.length == 0 ) {
- miVersions = new String[] { DEFAULT_MI_VERSION };
- }
- String mi = DEFAULT_MI_VERSION;
- try {
- mi = configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, DEFAULT_MI_VERSION );
- }
- catch( CoreException e ) {
- // use default
- }
- int miIndex = 0;
- for ( int i = 0; i < miVersions.length; ++i ) {
- if ( miVersions[i].equals( mi ) ) {
- miIndex = i;
- break;
- }
+ if ( index < 0 )
+ index = 0;
+ fCommandFactoryCombo.select( index );
+ String[] miVersions = fCommandFactoryDescriptors[index].getMIVersions();
+ fProtocolCombo.setItems( miVersions );
+ if ( miVersions.length == 0 ) {
+ miVersions = new String[] { DEFAULT_MI_VERSION };
+ }
+ String mi = DEFAULT_MI_VERSION;
+ try {
+ mi = configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, DEFAULT_MI_VERSION );
+ }
+ catch( CoreException e ) {
+ // use default
+ }
+ int miIndex = 0;
+ for ( int i = 0; i < miVersions.length; ++i ) {
+ if ( miVersions[i].equals( mi ) ) {
+ miIndex = i;
+ break;
}
- fProtocolCombo.select( miIndex );
}
+ fProtocolCombo.select( miIndex );
setInitializing( false );
}
@@ -170,7 +170,7 @@ public class StandardGDBDebuggerPage extends AbstractCDebuggerPage implements Ob
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, str );
str = fCommandFactoryCombo.getText();
int index = fCommandFactoryCombo.indexOf( str );
- str = fCommandFactoryDescriptors[index].getIdentifier();
+ str = ( index < 0 ) ? "" : fCommandFactoryDescriptors[index].getIdentifier(); //$NON-NLS-1$
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, str );
str = fProtocolCombo.getText();
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, str );

Back to the top