diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/.classpath b/jtag/org.eclipse.cdt.debug.gdbjtag.core/.classpath
new file mode 100644
index 00000000000..751c8f2e504
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/.project b/jtag/org.eclipse.cdt.debug.gdbjtag.core/.project
new file mode 100644
index 00000000000..db3493df07a
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.cdt.debug.gdbjtag.core
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
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
new file mode 100644
index 00000000000..808a611d52b
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: CDT GDB JTAG Core Plug-in
+Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.Activator
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.debug.core,
+ org.eclipse.cdt.launch,
+ org.eclipse.cdt.debug.core,
+ org.eclipse.cdt.debug.mi.core,
+ org.eclipse.cdt.core
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.cdt.debug.gdbjtag.core
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/build.properties b/jtag/org.eclipse.cdt.debug.gdbjtag.core/build.properties
new file mode 100644
index 00000000000..e9863e281ea
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.properties b/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.properties
new file mode 100644
index 00000000000..562aaf708eb
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.properties
@@ -0,0 +1 @@
+launchConfig.name=GDB Hardware Debugging
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml b/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml
new file mode 100644
index 00000000000..a26dd638b1c
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Activator.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Activator.java
new file mode 100644
index 00000000000..2369b21f7ae
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.cdt.debug.gdbjtag.core;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.cdt.debug.gdbremote.core";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagCommandFactory.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagCommandFactory.java
new file mode 100644
index 00000000000..ff68b705570
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagCommandFactory.java
@@ -0,0 +1,37 @@
+/**********************************************************************
+ * Copyright (c) 2007 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.cdt.debug.gdbjtag.core;
+
+import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
+
+/**
+ * @author Doug Schaefer
+ *
+ */
+public class GDBJtagCommandFactory extends CommandFactory {
+
+ /**
+ *
+ */
+ public GDBJtagCommandFactory() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param miVersion
+ */
+ public GDBJtagCommandFactory(String miVersion) {
+ super(miVersion);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagConstants.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagConstants.java
new file mode 100644
index 00000000000..1a9bb8de8b0
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagConstants.java
@@ -0,0 +1,24 @@
+/**********************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.cdt.debug.gdbjtag.core;
+
+/**
+ * @author Doug Schaefer
+ *
+ */
+public class GDBJtagConstants {
+
+ public static final String DEBUGGER_ID = "org.eclipse.cdt.debug.mi.core.CDebuggerNew"; //$NON-NLS-1$
+
+ public static final String LAUNCH_ATTR_INIT_COMMANDS = Activator.PLUGIN_ID + ".initCommands"; //$NON-NLS-1$
+ public static final String LAUNCH_ATTR_RUN_COMMANDS = Activator.PLUGIN_ID + ".runCommands"; //$NON-NLS-1$
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java
new file mode 100644
index 00000000000..01d756e49ff
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java
@@ -0,0 +1,50 @@
+/**********************************************************************
+ * Copyright (c) 2007 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.cdt.debug.gdbjtag.core;
+
+import java.io.File;
+
+import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
+import org.eclipse.cdt.debug.core.cdi.ICDISession;
+import org.eclipse.cdt.debug.mi.core.AbstractGDBCDIDebugger;
+import org.eclipse.cdt.debug.mi.core.MIPlugin;
+import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+/**
+ * @author Doug Schaefer
+ *
+ */
+public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
+
+ public ICDISession createSession(ILaunch launch, File executable,
+ IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ICDISession createDebuggerSession(ILaunch launch, IBinaryObject exe,
+ IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected CommandFactory getCommandFactory(ILaunchConfiguration config)
+ throws CoreException {
+ String miVersion = MIPlugin.getMIVersion(config);
+ return new GDBJtagCommandFactory(miVersion);
+ }
+
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagLaunchConfigurationDelegate.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagLaunchConfigurationDelegate.java
new file mode 100644
index 00000000000..ec19f429dd2
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagLaunchConfigurationDelegate.java
@@ -0,0 +1,114 @@
+/**********************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.cdt.debug.gdbjtag.core;
+
+import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
+import org.eclipse.cdt.debug.core.ICDebugConfiguration;
+import org.eclipse.cdt.debug.core.cdi.ICDISession;
+import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchManager;
+
+/**
+ * @author Doug Schaefer
+ *
+ */
+public class GDBJtagLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
+
+ protected String getPluginID() {
+ return Activator.PLUGIN_ID;
+ };
+
+ public void launch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ try {
+ // set the default source locator if required
+ setDefaultSourceLocator(launch, configuration);
+
+ if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+ ICDebugConfiguration debugConfig = getDebugConfig(configuration);
+ ICDISession dsession = null;
+ String debugMode = configuration
+ .getAttribute(
+ ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
+ ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
+
+ if (debugMode
+ .equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) {
+// dsession = ((EmbeddedGDBCDIDebugger) debugConfig
+// .createDebugger()).createDebuggerSession(this,
+// launch, exeFileInfo, new SubProgressMonitor(
+// monitor, 8));
+//
+// ICDITarget[] dtargets = dsession.getTargets();
+// // setFactory(dtargets);
+// try {
+//
+// monitor.worked(1);
+//
+// executeGDBScript(
+// configuration,
+// LaunchConfigurationConstants.ATTR_DEBUGGER_COMMANDS_INIT,
+// dtargets);
+// monitor.worked(2);
+//
+// queryTargetState(dtargets);
+//
+// // create the Launch targets/processes for eclipse.
+// for (int i = 0; i < dtargets.length; i++) {
+// Target target = (Target) dtargets[i];
+// target.setConfiguration(new Configuration(target));
+// Process process = target.getProcess();
+// IProcess iprocess = null;
+// if (process != null) {
+// iprocess = DebugPlugin.newProcess(launch,
+// process, renderProcessLabel(exePath
+// .toOSString()));
+// }
+// CDIDebugModel.newDebugTarget(launch, projectInfo,
+// dtargets[i],
+// renderTargetLabel(debugConfig), iprocess,
+// exeFileInfo, true, true, false);
+// /* FIX!!!! put up a console view for */
+// // if (process != null) {
+// // iprocess = DebugPlugin.newProcess(launch,
+// // process,
+// // renderProcessLabel(exePath.toOSString()));
+// // }
+// }
+// executeGDBScript(
+// configuration,
+// LaunchConfigurationConstants.ATTR_DEBUGGER_COMMANDS_RUN,
+// dtargets);
+//
+// } catch (CoreException e) {
+// try {
+// dsession.terminate();
+// } catch (CDIException e1) {
+// // ignore
+// }
+// throw e;
+// }
+ }
+ } else {
+ cancel("TargetConfiguration not supported",
+ ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
+ }
+ } finally {
+ monitor.done();
+ }
+
+ }
+
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/.classpath b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/.classpath
new file mode 100644
index 00000000000..751c8f2e504
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/.project b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/.project
new file mode 100644
index 00000000000..f3cd19e9ec0
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.cdt.debug.gdbjtag.ui
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..7af2435edf7
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: CDT GDB Remote UI Plug-in
+Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.ui;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.ui.Activator
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.debug.ui,
+ org.eclipse.debug.core,
+ org.eclipse.cdt.launch,
+ org.eclipse.cdt.ui,
+ org.eclipse.cdt.debug.mi.core,
+ org.eclipse.cdt.debug.gdbjtag.core,
+ org.eclipse.core.variables,
+ org.eclipse.cdt.managedbuilder.ui
+Eclipse-LazyStart: true
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/build.properties b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/build.properties
new file mode 100644
index 00000000000..e9863e281ea
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/obj16/c_app.gif b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/obj16/c_app.gif
new file mode 100644
index 00000000000..504ef509f9c
Binary files /dev/null and b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/obj16/c_app.gif differ
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/debugger_tab.gif b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/debugger_tab.gif
new file mode 100644
index 00000000000..d90a29fead8
Binary files /dev/null and b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/debugger_tab.gif differ
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/startup_tab.gif b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/startup_tab.gif
new file mode 100644
index 00000000000..7b3a92e0906
Binary files /dev/null and b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/startup_tab.gif differ
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.properties b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.properties
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.xml b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.xml
new file mode 100644
index 00000000000..3a5516563de
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/Activator.java b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/Activator.java
new file mode 100644
index 00000000000..3decf5ce5ff
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.cdt.debug.gdbjtag.ui;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.cdt.debug.gdbremote.ui";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java
new file mode 100644
index 00000000000..f00bad94f92
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java
@@ -0,0 +1,235 @@
+/**********************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.cdt.debug.gdbjtag.ui;
+
+import org.eclipse.cdt.debug.gdbjtag.core.GDBJtagConstants;
+import org.eclipse.cdt.debug.mi.core.MIPlugin;
+import org.eclipse.cdt.debug.mi.core.command.factories.CommandFactoryDescriptor;
+import org.eclipse.cdt.debug.mi.core.command.factories.CommandFactoryManager;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+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.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author Doug Schaefer
+ *
+ */
+public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
+
+ private CommandFactoryDescriptor[] cfDescs;
+ private int cfSelected = -1;
+
+ private Button useRemote;
+ private Composite remoteConnection;
+ private Text ipAddress;
+ private Text portNumber;
+
+ public String getName() {
+ return "Debugger";
+ }
+
+ public Image getImage() {
+ return GDBJtagImages.getDebuggerTabImage();
+ }
+
+ public void createControl(Composite parent) {
+ ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
+ setControl(sc);
+
+ Composite comp = new Composite(sc, SWT.NONE);
+ sc.setContent(comp);
+ GridLayout layout = new GridLayout();
+ comp.setLayout(layout);
+
+ Group group = new Group(comp, SWT.NONE);
+ layout = new GridLayout();
+ group.setLayout(layout);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ group.setLayoutData(gd);
+ group.setText("GDB Setup");
+
+ createCommandControl(group);
+ createInitFileControl(group);
+ createCommandSetControl(group);
+ createProtocolControl(group);
+ createVerboseModeControl(group);
+
+ createRemoteControl(comp);
+ }
+
+ public void createCommandControl(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ comp.setLayout(layout);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ comp.setLayoutData(gd);
+
+ Label label = new Label(comp, SWT.NONE);
+ label.setText("GDB Command:");
+ gd = new GridData();
+ gd.horizontalSpan = 3;
+ label.setLayoutData(gd);
+
+ Text text = new Text(comp, SWT.SINGLE | SWT.BORDER);
+ text.setText("gdb");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ text.setLayoutData(gd);
+
+ Button button = new Button(comp, SWT.NONE);
+ button.setText("Browse...");
+ button = new Button(comp, SWT.NONE);
+ button.setText("Variables...");
+ }
+
+ public void createInitFileControl(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ comp.setLayout(layout);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ comp.setLayoutData(gd);
+
+ Label label = new Label(comp, SWT.NONE);
+ label.setText("GDB Init File:");
+ gd = new GridData();
+ gd.horizontalSpan = 3;
+ label.setLayoutData(gd);
+
+ Text text = new Text(comp, SWT.SINGLE | SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ text.setLayoutData(gd);
+
+ Button button = new Button(comp, SWT.NONE);
+ button.setText("Browse...");
+ button = new Button(comp, SWT.NONE);
+ button.setText("Workspace...");
+ }
+
+ public void createCommandSetControl(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(2, false);
+ comp.setLayout(layout);
+ Label label = new Label(comp, SWT.NONE);
+ label.setText("Command Set:");
+
+ Combo combo = new Combo(comp, SWT.READ_ONLY | SWT.DROP_DOWN);
+
+ // Get the command sets
+ CommandFactoryManager cfManager = MIPlugin.getDefault().getCommandFactoryManager();
+ CommandFactoryDescriptor defDesc = cfManager.getDefaultDescriptor(GDBJtagConstants.DEBUGGER_ID);
+ cfDescs = cfManager.getDescriptors(
+ GDBJtagConstants.DEBUGGER_ID);
+ for (int i = 0; i < cfDescs.length; ++i) {
+ combo.add(cfDescs[i].getName());
+ if (defDesc == cfDescs[i])
+ cfSelected = i;
+ }
+
+ if (cfSelected > -1)
+ combo.select(cfSelected);
+ }
+
+ public void createProtocolControl(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(2, false);
+ comp.setLayout(layout);
+ Label label = new Label(comp, SWT.NONE);
+ label.setText("Protocol Version:");
+
+ Combo combo = new Combo(comp, SWT.READ_ONLY | SWT.DROP_DOWN);
+ if (cfSelected > -1) {
+ String[] vers = cfDescs[cfSelected].getMIVersions();
+ for (int i = 0; i < vers.length; ++i) {
+ combo.add(vers[i]);
+ }
+ }
+ combo.select(0);
+ }
+
+ public void createVerboseModeControl(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(2, false);
+ comp.setLayout(layout);
+
+ Button button = new Button(comp, SWT.CHECK);
+ Label label = new Label(comp, SWT.NONE);
+ label.setText("Verbose console mode");
+ }
+
+ private void createRemoteControl(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ group.setLayout(layout);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ group.setLayoutData(gd);
+ group.setText("Remote Connection");
+
+ useRemote = new Button(group, SWT.CHECK);
+ useRemote.setText("Use remote connection");
+ useRemote.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ useRemoteChanged();
+ }
+ });
+
+ remoteConnection = new Composite(group, SWT.NONE);
+ layout = new GridLayout();
+ layout.numColumns = 2;
+ remoteConnection.setLayout(layout);
+
+ Label label = new Label(remoteConnection, SWT.NONE);
+ label.setText("Host name or IP address:");
+ ipAddress = new Text(remoteConnection, SWT.BORDER);
+
+ label = new Label(remoteConnection, SWT.NONE);
+ label.setText("Port number:");
+ portNumber = new Text(remoteConnection, SWT.BORDER);
+ }
+
+ private void useRemoteChanged() {
+ boolean enabled = useRemote.getSelection();
+ ipAddress.setEnabled(enabled);
+ portNumber.setEnabled(enabled);
+ }
+
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ useRemote.setSelection(true);
+ useRemoteChanged();
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ // TODO Auto-generated method stub
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ // TODO Auto-generated method stub
+ }
+
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagImages.java b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagImages.java
new file mode 100644
index 00000000000..c216e5dcfc0
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagImages.java
@@ -0,0 +1,67 @@
+/**********************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.cdt.debug.gdbjtag.ui;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Doug Schaefer
+ *
+ */
+public class GDBJtagImages {
+
+ private static ImageRegistry imageRegistry = new ImageRegistry();
+
+ private static URL iconBaseURL = Activator.getDefault().getBundle().getEntry("/icons/"); //$NON-NLS-1$
+
+ private static final String NAME_PREFIX = Activator.PLUGIN_ID + '.';
+
+ private static final String T_TABS = "view16/"; //$NON-NLS-1$
+
+ private static final String IMG_VIEW_DEBUGGER_TAB = NAME_PREFIX + "debugger_tab.gif"; //$NON-NLS-1$
+ private static final String IMG_VIEW_STARTUP_TAB = NAME_PREFIX + "startup_tab.gif"; //$NON-NLS-1$
+
+ public static Image getDebuggerTabImage() {
+ return imageRegistry.get(IMG_VIEW_DEBUGGER_TAB);
+ }
+
+ public static Image getStartupTabImage() {
+ return imageRegistry.get(IMG_VIEW_STARTUP_TAB);
+ }
+
+ static {
+ createManaged(T_TABS, IMG_VIEW_DEBUGGER_TAB);
+ createManaged(T_TABS, IMG_VIEW_STARTUP_TAB);
+ }
+
+ private static void createManaged(String prefix, String name) {
+ imageRegistry.put(name, ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX.length()))));
+ }
+
+ private static URL makeIconFileURL(String prefix, String name) {
+ StringBuffer buffer= new StringBuffer(prefix);
+ buffer.append(name);
+ try {
+ return new URL(iconBaseURL, buffer.toString());
+ } catch (MalformedURLException e) {
+ LaunchUIPlugin.log(e);
+ return null;
+ }
+ }
+
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagLaunchConfigurationTabGroup.java b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagLaunchConfigurationTabGroup.java
new file mode 100644
index 00000000000..d8dff8f6dd7
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagLaunchConfigurationTabGroup.java
@@ -0,0 +1,39 @@
+/**********************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.cdt.debug.gdbjtag.ui;
+
+import org.eclipse.cdt.launch.ui.CMainTab;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
+
+/**
+ * @author Doug Schaefer
+ *
+ */
+public class GDBJtagLaunchConfigurationTabGroup extends
+ AbstractLaunchConfigurationTabGroup {
+
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
+ new CMainTab(CMainTab.DONT_CHECK_PROGRAM),
+ new GDBJtagDebuggerTab(),
+ new GDBJtagStartupTab(),
+ new SourceLookupTab(),
+ new CommonTab()
+ };
+ setTabs(tabs);
+ }
+
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java
new file mode 100644
index 00000000000..84f17aa984e
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java
@@ -0,0 +1,200 @@
+/**********************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.cdt.debug.gdbjtag.ui;
+
+import org.eclipse.cdt.debug.gdbjtag.core.GDBJtagConstants;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.debug.ui.StringVariableSelectionDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+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.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author Doug Schaefer
+ *
+ */
+public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
+
+ Text initCommands;
+ Button loadImage;
+ Text imageFileName;
+ Button defaultRun;
+ Text runCommands;
+
+ public String getName() {
+ return "Startup";
+ }
+
+ public Image getImage() {
+ return GDBJtagImages.getStartupTabImage();
+ }
+
+ public void createControl(Composite parent) {
+ ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
+ setControl(sc);
+
+ Composite comp = new Composite(sc, SWT.NONE);
+ sc.setContent(comp);
+ GridLayout layout = new GridLayout();
+ comp.setLayout(layout);
+
+ createInitGroup(comp);
+ createLoadGroup(comp);
+ createRunGroup(comp);
+
+ sc.setMinSize(comp.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ }
+
+ public void createInitGroup(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ group.setLayout(layout);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ group.setLayoutData(gd);
+ group.setText("Initialization Commands");
+
+ initCommands = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 100;
+ initCommands.setLayoutData(gd);
+ initCommands.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent evt) {
+ updateLaunchConfigurationDialog();
+ }
+ });
+
+ Button varsButton = new Button(group, SWT.NONE);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ varsButton.setLayoutData(gd);
+ varsButton.setText("Variables...");
+ varsButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleVarsButtonSelected(initCommands);
+ }
+ });
+ }
+
+ private void createLoadGroup(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ group.setLayout(layout);
+ layout.numColumns = 3;
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ group.setLayoutData(gd);
+ group.setText("Load Image");
+
+ loadImage = new Button(group, SWT.CHECK);
+ loadImage.setText("Automatically load image");
+ gd = new GridData();
+ gd.horizontalSpan = 3;
+ loadImage.setLayoutData(gd);
+ loadImage.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ loadImageChanged();
+ }
+ });
+
+ Label label = new Label(group, SWT.NONE);
+ gd = new GridData();
+ gd.horizontalSpan = 3;
+ label.setLayoutData(gd);
+ label.setText("Image file name:");
+
+ imageFileName = new Text(group, SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ imageFileName.setLayoutData(gd);
+
+ Button button = new Button(group, SWT.NONE);
+ button.setText("Browse...");
+ button = new Button(group, SWT.NONE);
+ button.setText("Workspace...");
+ }
+
+ private void loadImageChanged() {
+ imageFileName.setEnabled(loadImage.getSelection());
+ }
+
+ public void createRunGroup(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ group.setLayout(layout);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ group.setLayoutData(gd);
+ group.setText("Run Commands");
+
+ defaultRun = new Button(group, SWT.CHECK);
+ defaultRun.setText("Use default run command");
+
+ runCommands = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 100;
+ runCommands.setLayoutData(gd);
+ runCommands.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent evt) {
+ updateLaunchConfigurationDialog();
+ }
+ });
+
+ Button varsButton = new Button(group, SWT.NONE);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ varsButton.setLayoutData(gd);
+ varsButton.setText("Variables...");
+ varsButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleVarsButtonSelected(runCommands);
+ }
+ });
+ }
+
+ private void handleVarsButtonSelected(Text text) {
+ StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
+ dialog.open();
+ text.append(dialog.getVariableExpression());
+ }
+
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ try {
+ initCommands.setText(configuration.getAttribute(GDBJtagConstants.LAUNCH_ATTR_INIT_COMMANDS, "")); //$NON-NLS-1$
+ runCommands.setText(configuration.getAttribute(GDBJtagConstants.LAUNCH_ATTR_RUN_COMMANDS, "")); //$NON-NLS-1$)
+ } catch (CoreException e) {
+ Activator.getDefault().getLog().log(e.getStatus());
+ }
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ configuration.setAttribute(GDBJtagConstants.LAUNCH_ATTR_INIT_COMMANDS, initCommands.getText());
+ configuration.setAttribute(GDBJtagConstants.LAUNCH_ATTR_RUN_COMMANDS, runCommands.getText());
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ configuration.setAttribute(GDBJtagConstants.LAUNCH_ATTR_INIT_COMMANDS, ""); //$NON-NLS-1$
+ configuration.setAttribute(GDBJtagConstants.LAUNCH_ATTR_RUN_COMMANDS, ""); //$NON-NLS-1$
+ }
+
+}