Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jtag
diff options
context:
space:
mode:
authorMarc Khouzam2011-03-07 13:05:03 -0500
committerMarc Khouzam2011-03-07 13:05:03 -0500
commit03252ec0f9baf8481a8f00d99b7013e367a4636b (patch)
tree7f3c861e32903bb1a8b69fb67034a9a8b29c08a2 /jtag
parenteb02ad7b69c229159d663e0476f437b71356d0ed (diff)
downloadorg.eclipse.cdt-03252ec0f9baf8481a8f00d99b7013e367a4636b.tar.gz
org.eclipse.cdt-03252ec0f9baf8481a8f00d99b7013e367a4636b.tar.xz
org.eclipse.cdt-03252ec0f9baf8481a8f00d99b7013e367a4636b.zip
Bug 338769: Allow for different versions of the FinalLaunchSequence
Diffstat (limited to 'jtag')
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java9
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFLaunchConfigurationDelegate.java34
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl.java42
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_0.java42
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_2.java42
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GdbJtagDebugServicesFactory.java42
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/macos/MacOSGdbJtagDebugServicesFactory.java31
8 files changed, 224 insertions, 20 deletions
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF
index 0ee25d3702..6f1e9c26e6 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core;singleton:=true
-Bundle-Version: 7.0.0.qualifier
+Bundle-Version: 8.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java
index 7c669a1646..78127a5359 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java
@@ -36,6 +36,7 @@ import org.eclipse.cdt.dsf.concurrent.CountingRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
+import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress;
import org.eclipse.cdt.dsf.concurrent.Sequence;
import org.eclipse.cdt.dsf.datamodel.DMContexts;
import org.eclipse.cdt.dsf.datamodel.DataModelInitializedEvent;
@@ -58,7 +59,6 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.variables.VariablesPlugin;
@@ -745,8 +745,11 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
DsfServicesTracker fTracker;
- public GDBJtagDSFFinalLaunchSequence(DsfExecutor executor, GdbLaunch launch, SessionType sessionType, boolean attach, IProgressMonitor pm) {
- super(executor, pm, LaunchMessages.getString("FinalLaunchSequence.0"), LaunchMessages.getString("FinalLaunchSequence.1")); //$NON-NLS-1$ //$NON-NLS-2$
+ /**
+ * @since 8.0
+ */
+ public GDBJtagDSFFinalLaunchSequence(DsfExecutor executor, GdbLaunch launch, SessionType sessionType, boolean attach, RequestMonitorWithProgress rm) {
+ super(executor, rm, LaunchMessages.getString("FinalLaunchSequence.0"), LaunchMessages.getString("FinalLaunchSequence.1")); //$NON-NLS-1$ //$NON-NLS-2$
fLaunch = launch;
fSessionType = sessionType;
fAttach = attach;
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 81f5c36e13..0b2733fc21 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
@@ -7,6 +7,7 @@
*
* Contributors:
* QNX Software Systems - Initial implementation
+ * Ericsson - Updated for changes in base DSF-GDB launching (Bug 338769)
*******************************************************************************/
package org.eclipse.cdt.debug.gdbjtag.core;
@@ -15,13 +16,12 @@ package org.eclipse.cdt.debug.gdbjtag.core;
*
*/
-import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
-import org.eclipse.cdt.dsf.concurrent.Sequence;
+import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.GdbJtagDebugServicesFactory;
+import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.macos.MacOSGdbJtagDebugServicesFactory;
import org.eclipse.cdt.dsf.concurrent.ThreadSafe;
-import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
+import org.eclipse.cdt.dsf.debug.service.IDsfDebugServicesFactory;
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate;
-import org.eclipse.cdt.dsf.gdb.service.SessionType;
-import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
/**
* The launch configuration delegate for the Jtag hardware debugging using
@@ -31,21 +31,23 @@ import org.eclipse.core.runtime.IProgressMonitor;
* launch configuration types.
* <p>
* It extends the standard DSF/GDB launch delegate <code>GdbLaunchDelegate</code>
- * but overrides the <code>getFinalLaunchSequence</code> method to return the Jtag
- * hardware debugging specific launch sequence.
+ * but overrides the <code>newServiceFactory</code> method to return the Jtag
+ * hardware debugging factory.
* @since 7.0
*/
@ThreadSafe
public class GDBJtagDSFLaunchConfigurationDelegate extends GdbLaunchDelegate {
+
+ protected IDsfDebugServicesFactory newServiceFactory(String version) {
+ if (version.contains(LaunchUtils.MACOS_GDB_MARKER)) {
+ // The version string at this point should look like
+ // 6.3.50-20050815APPLE1346, we extract the gdb version and apple version
+ String versions [] = version.split(LaunchUtils.MACOS_GDB_MARKER);
+ if (versions.length == 2) {
+ return new MacOSGdbJtagDebugServicesFactory(versions[0], versions[1]);
+ }
+ }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate#getFinalLaunchSequence(org.eclipse.cdt.dsf.concurrent.DsfExecutor, org.eclipse.cdt.dsf.gdb.launching.GdbLaunch, org.eclipse.cdt.dsf.gdb.service.SessionType, boolean, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected Sequence getFinalLaunchSequence(DsfExecutor executor,
- GdbLaunch launch, SessionType type, boolean attach,
- IProgressMonitor pm) {
- return new GDBJtagDSFFinalLaunchSequence(executor, launch, type, attach, pm);
+ return new GdbJtagDebugServicesFactory(version);
}
-
}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl.java
new file mode 100644
index 0000000000..36b4cc0fea
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Ericsson 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service;
+
+import java.util.Map;
+
+import org.eclipse.cdt.debug.gdbjtag.core.GDBJtagDSFFinalLaunchSequence;
+import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress;
+import org.eclipse.cdt.dsf.concurrent.Sequence;
+import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
+import org.eclipse.cdt.dsf.gdb.service.IGDBBackend;
+import org.eclipse.cdt.dsf.gdb.service.command.GDBControl;
+import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
+import org.eclipse.cdt.dsf.service.DsfSession;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+
+/**
+ * Jtag control service which selects the Jtag CompleteInitializationSequence.
+ * Use for GDB < 7.0
+ */
+public class GDBJtagControl extends GDBControl {
+
+ public GDBJtagControl(DsfSession session, ILaunchConfiguration config, CommandFactory factory) {
+ super(session, config, factory);
+ }
+
+ protected Sequence getCompleteInitializationSequence(Map<String,Object> attributes, RequestMonitorWithProgress rm) {
+ GdbLaunch launch = (GdbLaunch)getSession().getModelAdapter(ILaunch.class);
+ IGDBBackend backend = getServicesTracker().getService(IGDBBackend.class);
+ return new GDBJtagDSFFinalLaunchSequence(getExecutor(), launch, backend.getSessionType(), backend.getIsAttachSession(), rm);
+ }
+} \ No newline at end of file
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_0.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_0.java
new file mode 100644
index 0000000000..de79e4a35c
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_0.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Ericsson 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service;
+
+import java.util.Map;
+
+import org.eclipse.cdt.debug.gdbjtag.core.GDBJtagDSFFinalLaunchSequence;
+import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress;
+import org.eclipse.cdt.dsf.concurrent.Sequence;
+import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
+import org.eclipse.cdt.dsf.gdb.service.IGDBBackend;
+import org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_0;
+import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
+import org.eclipse.cdt.dsf.service.DsfSession;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+
+/**
+ * Jtag control service which selects the Jtag CompleteInitializationSequence.
+ * Use for GDB >= 7.0
+ */
+public class GDBJtagControl_7_0 extends GDBControl_7_0 {
+
+ public GDBJtagControl_7_0(DsfSession session, ILaunchConfiguration config, CommandFactory factory) {
+ super(session, config, factory);
+ }
+
+ protected Sequence getCompleteInitializationSequence(Map<String,Object> attributes, RequestMonitorWithProgress rm) {
+ GdbLaunch launch = (GdbLaunch)getSession().getModelAdapter(ILaunch.class);
+ IGDBBackend backend = getServicesTracker().getService(IGDBBackend.class);
+ return new GDBJtagDSFFinalLaunchSequence(getExecutor(), launch, backend.getSessionType(), backend.getIsAttachSession(), rm);
+ }
+} \ No newline at end of file
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_2.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_2.java
new file mode 100644
index 0000000000..64aef84436
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_2.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Ericsson 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service;
+
+import java.util.Map;
+
+import org.eclipse.cdt.debug.gdbjtag.core.GDBJtagDSFFinalLaunchSequence;
+import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress;
+import org.eclipse.cdt.dsf.concurrent.Sequence;
+import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
+import org.eclipse.cdt.dsf.gdb.service.IGDBBackend;
+import org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_2;
+import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
+import org.eclipse.cdt.dsf.service.DsfSession;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+
+/**
+ * Jtag control service which selects the Jtag CompleteInitializationSequence.
+ * Use for GDB >= 7.2
+ */
+public class GDBJtagControl_7_2 extends GDBControl_7_2 {
+
+ public GDBJtagControl_7_2(DsfSession session, ILaunchConfiguration config, CommandFactory factory) {
+ super(session, config, factory);
+ }
+
+ protected Sequence getCompleteInitializationSequence(Map<String,Object> attributes, RequestMonitorWithProgress rm) {
+ GdbLaunch launch = (GdbLaunch)getSession().getModelAdapter(ILaunch.class);
+ IGDBBackend backend = getServicesTracker().getService(IGDBBackend.class);
+ return new GDBJtagDSFFinalLaunchSequence(getExecutor(), launch, backend.getSessionType(), backend.getIsAttachSession(), rm);
+ }
+} \ No newline at end of file
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GdbJtagDebugServicesFactory.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GdbJtagDebugServicesFactory.java
new file mode 100644
index 0000000000..47f7144431
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GdbJtagDebugServicesFactory.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Ericsson 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service;
+
+import org.eclipse.cdt.dsf.debug.service.command.ICommandControl;
+import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
+import org.eclipse.cdt.dsf.gdb.service.command.CommandFactory_6_8;
+import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
+import org.eclipse.cdt.dsf.service.DsfSession;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+/**
+ * @since 8.0
+ */
+public class GdbJtagDebugServicesFactory extends GdbDebugServicesFactory {
+
+
+ public GdbJtagDebugServicesFactory(String version) {
+ super(version);
+ }
+
+ protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) {
+ if (GDB_7_2_VERSION.compareTo(getVersion()) <= 0) {
+ return new GDBJtagControl_7_2(session, config, new CommandFactory_6_8());
+ }
+ if (GDB_7_0_VERSION.compareTo(getVersion()) <= 0) {
+ return new GDBJtagControl_7_0(session, config, new CommandFactory_6_8());
+ }
+ if (GDB_6_8_VERSION.compareTo(getVersion()) <= 0) {
+ return new GDBJtagControl(session, config, new CommandFactory_6_8());
+ }
+ return new GDBJtagControl(session, config, new CommandFactory());
+ }
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/macos/MacOSGdbJtagDebugServicesFactory.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/macos/MacOSGdbJtagDebugServicesFactory.java
new file mode 100644
index 0000000000..484721546e
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/macos/MacOSGdbJtagDebugServicesFactory.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Ericsson 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson - Initial implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.macos;
+
+import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.GDBJtagControl;
+import org.eclipse.cdt.dsf.debug.service.command.ICommandControl;
+import org.eclipse.cdt.dsf.gdb.service.macos.MacOSCommandFactory;
+import org.eclipse.cdt.dsf.gdb.service.macos.MacOSGdbDebugServicesFactory;
+import org.eclipse.cdt.dsf.service.DsfSession;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+/** @since 8.0 */
+public class MacOSGdbJtagDebugServicesFactory extends MacOSGdbDebugServicesFactory {
+
+ public MacOSGdbJtagDebugServicesFactory(String gdbVersion, String appleVersion) {
+ super(gdbVersion, appleVersion);
+ }
+
+ @Override
+ protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) {
+ return new GDBJtagControl(session, config, new MacOSCommandFactory());
+ }
+}

Back to the top