From aa17ffe74ca5e6b58e2dce9fbe0f4aaa22e239b0 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 16 Apr 2007 19:02:30 +0000 Subject: [PATCH] Initial code for supporting hardware debugging with GDB, mainly with JTAG. --- .../.classpath | 7 + .../.project | 28 +++ .../META-INF/MANIFEST.MF | 15 ++ .../build.properties | 5 + .../plugin.properties | 1 + .../plugin.xml | 16 ++ .../cdt/debug/gdbjtag/core/Activator.java | 50 ++++ .../gdbjtag/core/GDBJtagCommandFactory.java | 37 +++ .../debug/gdbjtag/core/GDBJtagConstants.java | 24 ++ .../debug/gdbjtag/core/GDBJtagDebugger.java | 50 ++++ .../GDBJtagLaunchConfigurationDelegate.java | 114 +++++++++ .../.classpath | 7 + .../org.eclipse.cdt.debug.gdbjtag.ui/.project | 28 +++ .../META-INF/MANIFEST.MF | 18 ++ .../build.properties | 5 + .../icons/obj16/c_app.gif | Bin 0 -> 606 bytes .../icons/view16/debugger_tab.gif | Bin 0 -> 348 bytes .../icons/view16/startup_tab.gif | Bin 0 -> 527 bytes .../plugin.properties | 0 .../plugin.xml | 19 ++ .../cdt/debug/gdbjtag/ui/Activator.java | 50 ++++ .../debug/gdbjtag/ui/GDBJtagDebuggerTab.java | 235 ++++++++++++++++++ .../cdt/debug/gdbjtag/ui/GDBJtagImages.java | 67 +++++ .../GDBJtagLaunchConfigurationTabGroup.java | 39 +++ .../debug/gdbjtag/ui/GDBJtagStartupTab.java | 200 +++++++++++++++ 25 files changed, 1015 insertions(+) create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/.classpath create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/.project create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/build.properties create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.properties create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/plugin.xml create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Activator.java create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagCommandFactory.java create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagConstants.java create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagLaunchConfigurationDelegate.java create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/.classpath create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/.project create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/build.properties create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/obj16/c_app.gif create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/debugger_tab.gif create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/icons/view16/startup_tab.gif create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.properties create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/plugin.xml create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/Activator.java create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagImages.java create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagLaunchConfigurationTabGroup.java create mode 100644 jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java 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 0000000000000000000000000000000000000000..504ef509f9c5d688491dd731cb67e5f74ed2ceb2 GIT binary patch literal 606 zcmZ?wbhEHb6krfwc*el+^ueQyzCAe;_vKICA5^~~tZ8#t^X915t{lcYem0S60w~E!Cm1}%!*ZbD23vAe^ku>e{(=UZn)}MLw z`TE0`t1rFXe&hY&dml44Kg`|wD1Y0did|1y4m_K1?8Uq@udclO{QlSfPrv_P{rvyY zw||en{d@KE|LdRsKmPvz`1`*n-~YY*`Ty;&|IdE>d-d!8>tFxh{r>;{_y5m-{=fM7 z@6(_E-~Rsp`S1VEW5=7y9eZo-I;tF+%N(1_9s6qRIw~DzH(O1ux0%vlv%b${eV^&F zPVNi>4ZTA2Fe}+K=6o0ZXGB5-(=zv@ViW3I*-3@_F%`L4>f`USw zBBJ7~?3~<;O#Fcg3W^F!$||aAvU2j$lFWe}UBV(_ENmQHJiL5M{k67k+rG^|aEsC2 zeMUC>cX?`ATFOXCNa$MX>6+?#1qNtYTb{JDlQ?FpuOATTtz}_x(p*F1iLsfPcc71! zk?u*&d%C(-CMLdtep-fxlNc|s2^{MZbz7tmxUq?~B}Kw-LqcJ}(TN%kAwG9b6e>^D ea5O2CiB##DAnzQ+_p{MR)oV&y5+4@}gEauGD&+Y9 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..d90a29fead84c0ca79773c63e69c2f8c46daf706 GIT binary patch literal 348 zcmZ?wbhEHb6krfwxXQpFm0T{B0z_ppsb#Wh+mRt9F_KB}J9`r#g`PUial&Z=(aTAtPl_67=023r2s zI@$6TwHkr_Rud1`7Oo7Na-@9f(eimG>*t+pSbDnc`M29^FHBf>VZxRxGqzuybNk)t z+iy>A1+ixzy}$O@{dGt0tv&T<^VL@ekKJ2)?B2SoFAr|mu;Ksz{|u-=@h1x-1A`TV z4oDc}CkD1khq(bBl2ZMLPY5)bJTtLWT$b7Cq1ErMC!G7Li2sW2?+d7K36Q@l~$Ly1U#YBsooW6^-@PxqPKL3{A|Gv{X5SW!+=g4YV~CR9FMOoP{je iSk%>&<(WN7oP-&e7#ZT6WeT^tiSBe;w`ad2gEavB?SN4L literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..7b3a92e09060699883805541650140c334ccb6d8 GIT binary patch literal 527 zcmZ?wbhEHb6krfwc*ejW*BT(#>ZjBasMHpq(jK7R6|B)2tkoN)(;H#fAFbIJqBk+Z zd}e~dq;TV@Q8o)wtY;-zPK&jjlVm$9(P4h7+rkWw#aWK?lU)|2c`VLwTaxCrGBaXz zarmktpJf?gs|!L`lm!(9m%J*BIoU}11aYJJB z-sZ%02~B$%TlO_4Zir3ZkdU%2v3Y-E^WKJ*-Hok#nzOeibBj!DN_ zCLe8^cC2Iak>>K9@s+#c7M|{2a=K^HsqVFB`_`T7{{R0!!%zTJIt%I$-kZ`+znW?F+iN3i3 zk6^2yyn>>lrkbX#k_=x9r-rJux{92ZGB0;4yOExbv7t5>M?0&9rL`3+TPKr~BQr~% O2Lt1i7cW~H8LR + + + + + + + + + + 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$ + } + +}