Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2005-09-06 19:11:57 +0000
committerMikhail Khodjaiants2005-09-06 19:11:57 +0000
commitdb189e593524909c362a42023fc1ade5f58ee98d (patch)
tree541b555280b4dd350591208e70b211c80eb9a97a /debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse
parentd743e195a3f9a92dcdd516c5df0d88e409aca510 (diff)
downloadorg.eclipse.cdt-db189e593524909c362a42023fc1ade5f58ee98d.tar.gz
org.eclipse.cdt-db189e593524909c362a42023fc1ade5f58ee98d.tar.xz
org.eclipse.cdt-db189e593524909c362a42023fc1ade5f58ee98d.zip
Bug 108636: mi level selection option should be moved to the gdb page.
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/GDBDebuggerPage.java69
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIMessages.properties2
2 files changed, 62 insertions, 9 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBDebuggerPage.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBDebuggerPage.java
index 654eb00f9a0..dd8e0eae1d7 100644
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBDebuggerPage.java
+++ b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBDebuggerPage.java
@@ -13,8 +13,8 @@ package org.eclipse.cdt.debug.mi.internal.ui;
import java.io.File;
import java.util.Observable;
import java.util.Observer;
-
import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
+import org.eclipse.cdt.debug.mi.core.MIPlugin;
import org.eclipse.cdt.debug.mi.ui.IMILaunchConfigurationComponent;
import org.eclipse.cdt.debug.mi.ui.MIUIUtils;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
@@ -27,9 +27,11 @@ import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
@@ -43,12 +45,17 @@ import org.eclipse.swt.widgets.Text;
*/
public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements Observer {
+ final private static String DEFAULT_MI_PROTOCOL = MIUIMessages.getString( "GDBDebuggerPage.12" ); //$NON-NLS-1$
+ final protected String[] protocolItems = new String[] { DEFAULT_MI_PROTOCOL, "mi1", "mi2", "mi3" }; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+
protected TabFolder fTabFolder;
protected Text fGDBCommandText;
protected Text fGDBInitText;
+ protected Combo fProtocolCombo;
+
private IMILaunchConfigurationComponent fSolibBlock;
private boolean fIsInitializing = false;
@@ -67,6 +74,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) {
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb" ); //$NON-NLS-1$
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, "" ); //$NON-NLS-1$
+ configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, "mi" ); //$NON-NLS-1$
if ( fSolibBlock != null )
fSolibBlock.setDefaults( configuration );
}
@@ -90,24 +98,47 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
String gdbInit = ""; //$NON-NLS-1$
try {
gdbCommand = configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb" ); //$NON-NLS-1$
+ }
+ catch( CoreException e ) {
+ }
+ try {
gdbInit = configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, "" ); //$NON-NLS-1$
}
catch( CoreException e ) {
}
+ String miVersion = MIPlugin.getMIVersion( configuration );
+ if ( miVersion.compareTo( "mi" ) == 0 ) { //$NON-NLS-1$
+ miVersion = DEFAULT_MI_PROTOCOL;
+ }
if ( fSolibBlock != null )
fSolibBlock.initializeFrom( configuration );
fGDBCommandText.setText( gdbCommand );
fGDBInitText.setText( gdbInit );
+ int index = 0;
+ if ( miVersion.length() > 0 ) {
+ for( int i = 0; i < protocolItems.length; ++i ) {
+ if ( protocolItems[i].equals( miVersion ) ) {
+ index = i;
+ break;
+ }
+ }
+ }
+ fProtocolCombo.select( index );
setInitializing( false );
}
public void performApply( ILaunchConfigurationWorkingCopy configuration ) {
- String gdbStr = fGDBCommandText.getText();
- gdbStr.trim();
- configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, gdbStr );
- gdbStr = fGDBInitText.getText();
- gdbStr.trim();
- configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, gdbStr );
+ String str = fGDBCommandText.getText();
+ str.trim();
+ configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, str );
+ str = fGDBInitText.getText();
+ str.trim();
+ configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, str );
+ str = fProtocolCombo.getText();
+ if ( str.compareTo( DEFAULT_MI_PROTOCOL ) == 0 ) {
+ str = "mi"; //$NON-NLS-1$
+ }
+ configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, str );
if ( fSolibBlock != null )
fSolibBlock.performApply( configuration );
}
@@ -233,12 +264,13 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
fGDBInitText.setText( res );
}
} );
- label = ControlFactory.createLabel( comp, MIUIMessages.getString( "GDBDebuggerPage.9" ), //$NON-NLS-1$
+ label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "GDBDebuggerPage.9" ), //$NON-NLS-1$
200, SWT.DEFAULT, SWT.WRAP );
gd = new GridData( GridData.FILL_HORIZONTAL );
- gd.horizontalSpan = 1;
+ gd.horizontalSpan = 3;
gd.widthHint = 200;
label.setLayoutData( gd );
+ createProtocolCombo( subComp );
}
public void createSolibTab( TabFolder tabFolder ) {
@@ -280,4 +312,23 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
private void setInitializing( boolean isInitializing ) {
fIsInitializing = isInitializing;
}
+
+ protected void createProtocolCombo( Composite parent ) {
+ Label label = new Label( parent, SWT.NONE );
+ label.setText( MIUIMessages.getString( "GDBDebuggerPage.11" ) ); //$NON-NLS-1$
+ fProtocolCombo = new Combo( parent, SWT.READ_ONLY | SWT.DROP_DOWN );
+ fProtocolCombo.setItems( protocolItems );
+ fProtocolCombo.addSelectionListener( new SelectionListener() {
+
+ public void widgetDefaultSelected( SelectionEvent e ) {
+ if ( !isInitializing() )
+ updateLaunchConfigurationDialog();
+ }
+
+ public void widgetSelected( SelectionEvent e ) {
+ if ( !isInitializing() )
+ updateLaunchConfigurationDialog();
+ }
+ } );
+ }
}
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIMessages.properties b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIMessages.properties
index 816414c68ec..2871db97bc2 100644
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIMessages.properties
+++ b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIMessages.properties
@@ -21,6 +21,8 @@ GDBDebuggerPage.7=B&rowse...
GDBDebuggerPage.8=GDB Command File
GDBDebuggerPage.9=(Warning: Some commands in this file may interfere with the startup operation of the debugger, for example "run".)
GDBDebuggerPage.10=Shared Libraries
+GDBDebuggerPage.11=MI Protocol:
+GDBDebuggerPage.12=Default
GDBServerDebuggerPage.0=TCP
GDBServerDebuggerPage.1=Serial
GDBServerDebuggerPage.10=Connection

Back to the top