diff --git a/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog b/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog index 22fd5d7709d..f16d78875d4 100644 --- a/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog @@ -1,3 +1,7 @@ +2006-03-01 Mikhail Khodjaiants + Select the first available command factory when a new launch configuration is created. + * StandardGDBDebuggerPage.java + 2006-02-08 Mikhail Khodjaiants Bug 114793: Add an extension point to contribute command factories. GDBServerDebuggerPage should extend StandardGDBDebuggerPage. 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; - } - } - fProtocolCombo.select( miIndex ); + 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 ); 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 );