Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2007-04-16 15:02:30 -0400
committerDoug Schaefer2007-04-16 15:02:30 -0400
commitaa17ffe74ca5e6b58e2dce9fbe0f4aaa22e239b0 (patch)
treeebbac7ec020ac3b8f20db6d6270714f85aac95b6
parent12de1eb9a0d17c4e6c9f22eaf28ada3406533d77 (diff)
downloadorg.eclipse.cdt-aa17ffe74ca5e6b58e2dce9fbe0f4aaa22e239b0.tar.gz
org.eclipse.cdt-aa17ffe74ca5e6b58e2dce9fbe0f4aaa22e239b0.tar.xz
org.eclipse.cdt-aa17ffe74ca5e6b58e2dce9fbe0f4aaa22e239b0.zip
Initial code for supporting hardware debugging with GDB, mainly with JTAG.
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/.classpath7
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/.project28
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF15
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/build.properties5
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.properties1
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml16
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Activator.java50
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagCommandFactory.java37
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagConstants.java24
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java50
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagLaunchConfigurationDelegate.java114
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/.classpath7
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/.project28
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF18
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/build.properties5
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/obj16/c_app.gifbin0 -> 606 bytes
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/debugger_tab.gifbin0 -> 348 bytes
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/startup_tab.gifbin0 -> 527 bytes
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.properties0
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.xml19
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/Activator.java50
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java235
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagImages.java67
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagLaunchConfigurationTabGroup.java39
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java200
25 files changed, 1015 insertions, 0 deletions
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 0000000000..751c8f2e50
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
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 0000000000..db3493df07
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.cdt.debug.gdbjtag.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
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 0000000000..808a611d52
--- /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 0000000000..e9863e281e
--- /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 0000000000..562aaf708e
--- /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 0000000000..a26dd638b1
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ delegate="org.eclipse.cdt.debug.gdbjtag.core.GDBJtagLaunchConfigurationDelegate"
+ id="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType"
+ modes="debug"
+ name="%launchConfig.name"
+ public="true"
+ sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
+ sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"/>
+ </extension>
+
+</plugin>
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 0000000000..2369b21f7a
--- /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 0000000000..ff68b70557
--- /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 0000000000..1a9bb8de8b
--- /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 0000000000..01d756e49f
--- /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 0000000000..ec19f429dd
--- /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 0000000000..751c8f2e50
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
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 0000000000..f3cd19e9ec
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.cdt.debug.gdbjtag.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
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 0000000000..7af2435edf
--- /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 0000000000..e9863e281e
--- /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 0000000000..504ef509f9
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/obj16/c_app.gif
Binary files 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 0000000000..d90a29fead
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/debugger_tab.gif
Binary files 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 0000000000..7b3a92e090
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/startup_tab.gif
Binary files 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 0000000000..e69de29bb2
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.properties
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 0000000000..3a5516563d
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTypeImages">
+ <launchConfigurationTypeImage
+ configTypeID="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType"
+ icon="icons/obj16/c_app.gif"
+ id="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTypeImage"/>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+ <launchConfigurationTabGroup
+ class="org.eclipse.cdt.debug.gdbjtag.ui.GDBJtagLaunchConfigurationTabGroup"
+ id="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
+ type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType"/>
+ </extension>
+
+</plugin>
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 0000000000..3decf5ce5f
--- /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 0000000000..f00bad94f9
--- /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 0000000000..c216e5dcfc
--- /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 0000000000..d8dff8f6dd
--- /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 0000000000..84f17aa984
--- /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$
+ }
+
+}

Back to the top