1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 237556

The public GDB now supports non-stop for linux.
This patch fixes the version number we were using and allows the user to click the non-stop checkbox in the launch.
This commit is contained in:
Marc Khouzam 2008-07-27 18:22:56 +00:00
parent 3b749fe80a
commit aac8edc5d7
2 changed files with 18 additions and 5 deletions

View file

@ -264,7 +264,6 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
// TODO: Find a way to determine if non-stop is supported (i.e. find the GDB version) then grey out the check box if necessary // TODO: Find a way to determine if non-stop is supported (i.e. find the GDB version) then grey out the check box if necessary
// Button fNonStopButton = ControlFactory.createCheckBox(subComp, LaunchUIMessages.getString( "GDBDebuggerPage.15") ); //$NON-NLS-1$ // Button fNonStopButton = ControlFactory.createCheckBox(subComp, LaunchUIMessages.getString( "GDBDebuggerPage.15") ); //$NON-NLS-1$
fNonStopCheckBox = ControlFactory.createCheckBox(subComp, LaunchUIMessages.getString("GDBDebuggerPage.13")); //$NON-NLS-1$ fNonStopCheckBox = ControlFactory.createCheckBox(subComp, LaunchUIMessages.getString("GDBDebuggerPage.13")); //$NON-NLS-1$
fNonStopCheckBox.setEnabled(false);
fNonStopCheckBox.addSelectionListener( new SelectionAdapter() { fNonStopCheckBox.addSelectionListener( new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {

View file

@ -56,7 +56,8 @@ public class GdbLaunchDelegate extends LaunchConfigurationDelegate
implements ILaunchConfigurationDelegate2 implements ILaunchConfigurationDelegate2
{ {
public final static String GDB_DEBUG_MODEL_ID = "org.eclipse.dd.gdb"; //$NON-NLS-1$ public final static String GDB_DEBUG_MODEL_ID = "org.eclipse.dd.gdb"; //$NON-NLS-1$
private final static String NON_STOP_FIRST_VERSION = "6.8.50"; //$NON-NLS-1$
private boolean isNonStopSession = false; private boolean isNonStopSession = false;
public void launch( ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor ) throws CoreException { public void launch( ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor ) throws CoreException {
@ -107,8 +108,15 @@ public class GdbLaunchDelegate extends LaunchConfigurationDelegate
monitor.worked( 1 ); monitor.worked( 1 );
launch.setServiceFactory(newServiceFactory(LaunchUtils.getGDBVersion(config))); String gdbVersion = LaunchUtils.getGDBVersion(config);
// First make sure non-stop is supported, if the user want to use this mode
if (isNonStopSession && !isNonStopSupported(gdbVersion)) {
throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Non-stop mode is only supported starting with GDB " + NON_STOP_FIRST_VERSION, null)); //$NON-NLS-1$
}
launch.setServiceFactory(newServiceFactory(gdbVersion));
// Create and invoke the launch sequence to create the debug control and services // Create and invoke the launch sequence to create the debug control and services
final ServicesLaunchSequence servicesLaunchSequence = final ServicesLaunchSequence servicesLaunchSequence =
new ServicesLaunchSequence(launch.getSession(), launch, exePath, sessionType, attach); new ServicesLaunchSequence(launch.getSession(), launch, exePath, sessionType, attach);
@ -328,10 +336,16 @@ public class GdbLaunchDelegate extends LaunchConfigurationDelegate
return false; return false;
} }
private boolean isNonStopSupported(String version) {
if (NON_STOP_FIRST_VERSION.compareTo(version) <= 0) {
return true;
}
return false;
}
private IDsfDebugServicesFactory newServiceFactory(String version) { private IDsfDebugServicesFactory newServiceFactory(String version) {
// TODO: Fix version number once non-stop GDB is delivered if (isNonStopSession && isNonStopSupported(version)) {
if (isNonStopSession && version.startsWith("6.8.50.20080327")) { //$NON-NLS-1$
return new GdbDebugServicesFactoryNS(version); return new GdbDebugServicesFactoryNS(version);
} }