Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2011-08-05 19:04:24 +0000
committerMarc Khouzam2011-08-05 19:35:19 +0000
commitdb62a47f3e60cca608b8c7bbd5a00afd27805086 (patch)
tree90f47cda4a5443cac5bb5e8fc162b7006df8ef6d
parentebcbdcf6c5522c834c7c70e27a59257ef636026c (diff)
downloadorg.eclipse.cdt-db62a47f3e60cca608b8c7bbd5a00afd27805086.tar.gz
org.eclipse.cdt-db62a47f3e60cca608b8c7bbd5a00afd27805086.tar.xz
org.eclipse.cdt-db62a47f3e60cca608b8c7bbd5a00afd27805086.zip
Bug 348091: Cannot launch hardware or post-mortem debugging for older GDBs when preference for non-stop is enabled
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java19
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFLaunchConfigurationDelegate.java24
2 files changed, 40 insertions, 3 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java
index cbcbe79d2c9..d6bf6ab9b5d 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java
@@ -26,6 +26,7 @@ import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress;
import org.eclipse.cdt.dsf.concurrent.ThreadSafe;
import org.eclipse.cdt.dsf.debug.service.IDsfDebugServicesFactory;
import org.eclipse.cdt.dsf.debug.sourcelookup.DsfSourceLookupDirector;
+import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactoryNS;
@@ -45,6 +46,7 @@ import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.model.ISourceLocator;
@@ -272,8 +274,21 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2
@Override
public boolean preLaunchCheck(ILaunchConfiguration config, String mode, IProgressMonitor monitor) throws CoreException {
- // no pre launch check for core file
- if (mode.equals(ILaunchManager.DEBUG_MODE) && LaunchUtils.getSessionType(config) == SessionType.CORE) return true;
+ // Forcibly turn off non-stop for post-mortem sessions.
+ // Non-stop does not apply to post-mortem sessions.
+ // Now that we can have non-stop defaulting to enabled, it will prevent
+ // post-mortem sessions from starting for GDBs <= 6.8 and there is no way to turn if off
+ // Bug 348091
+ if (LaunchUtils.getSessionType(config) == SessionType.CORE) {
+ if (LaunchUtils.getIsNonStopMode(config)) {
+ ILaunchConfigurationWorkingCopy wcConfig = config.getWorkingCopy();
+ wcConfig.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, false);
+ wcConfig.doSave();
+ }
+
+ // no further prelaunch check for core files
+ return true;
+ }
return super.preLaunchCheck(config, mode, monitor);
}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFLaunchConfigurationDelegate.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFLaunchConfigurationDelegate.java
index 0b2733fc21e..5b07a137b39 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFLaunchConfigurationDelegate.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFLaunchConfigurationDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 - 2010 QNX Software Systems and others.
+ * Copyright (c) 2007 - 2011 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* QNX Software Systems - Initial implementation
* Ericsson - Updated for changes in base DSF-GDB launching (Bug 338769)
+ * Marc Khouzam (Ericsson) - Make sure non-stop is disabled (bug 348091)
*******************************************************************************/
package org.eclipse.cdt.debug.gdbjtag.core;
@@ -20,8 +21,13 @@ import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.GdbJtagDebugServicesFa
import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.macos.MacOSGdbJtagDebugServicesFactory;
import org.eclipse.cdt.dsf.concurrent.ThreadSafe;
import org.eclipse.cdt.dsf.debug.service.IDsfDebugServicesFactory;
+import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate;
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
/**
* The launch configuration delegate for the Jtag hardware debugging using
@@ -50,4 +56,20 @@ public class GDBJtagDSFLaunchConfigurationDelegate extends GdbLaunchDelegate {
return new GdbJtagDebugServicesFactory(version);
}
+
+ @Override
+ public boolean preLaunchCheck(ILaunchConfiguration config, String mode, IProgressMonitor monitor) throws CoreException {
+ // Forcibly turn off non-stop for hardware sessions.
+ // Non-stop is not an option we offer for hardware launches.
+ // Now that we can have non-stop defaulting to enabled, it will prevent
+ // hardware sessions from starting for GDBs <= 6.8 and there is no way to turn if off
+ // Bug 348091
+ if (LaunchUtils.getIsNonStopMode(config)) {
+ ILaunchConfigurationWorkingCopy wcConfig = config.getWorkingCopy();
+ wcConfig.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, false);
+ wcConfig.doSave();
+ }
+
+ return super.preLaunchCheck(config, mode, monitor);
+ }
}

Back to the top