Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jtag
diff options
context:
space:
mode:
authorJohn Cortell2010-05-06 16:17:04 -0400
committerJohn Cortell2010-05-06 16:17:04 -0400
commite42056257a03ec17cb27262a997b6ff1ba07bbd2 (patch)
tree6a817dd58ba207d1d32df638cced62fea5d5d811 /jtag
parent4e0258df9a01d3b493bffe6987bdcda38e6b56e2 (diff)
downloadorg.eclipse.cdt-e42056257a03ec17cb27262a997b6ff1ba07bbd2.tar.gz
org.eclipse.cdt-e42056257a03ec17cb27262a997b6ff1ba07bbd2.tar.xz
org.eclipse.cdt-e42056257a03ec17cb27262a997b6ff1ba07bbd2.zip
[310304] GDB (DSF) Hardware Debugging Launcher ignores application program path
Diffstat (limited to 'jtag')
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java203
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java115
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagLaunchConfigurationDelegate.java12
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java28
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Message.properties8
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java23
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java10
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java14
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java295
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties3
10 files changed, 503 insertions, 208 deletions
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java
index e83f410b22..8503233e3b 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java
@@ -27,6 +27,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Properties;
+import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GDBJtagDeviceContribution;
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GDBJtagDeviceContributionFactory;
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice;
@@ -350,7 +351,7 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
// Below steps are specific to JTag hardware debugging
/*
- * Retrieve the JTag device
+ * Retrieve the IGDBJtagDevice instance
*/
new Step() {
@Override
@@ -370,6 +371,61 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.done();
}},
/*
+ * Execute symbol loading
+ */
+ new Step() {
+ @Override
+ public void execute(RequestMonitor rm) {
+ ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
+ try {
+ if (config.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS)) {
+ String symbolsFileName = null;
+
+ // New setting in Helios. Default is true. Check for existence
+ // in order to support older launch configs
+ if (config.hasAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS) &&
+ config.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS)) {
+ IPath programFile = CDebugUtils.verifyProgramPath(config);
+ if (programFile != null) {
+ symbolsFileName = programFile.toOSString();
+ }
+ }
+ else {
+ symbolsFileName = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME);
+ if (symbolsFileName.length() > 0) {
+ symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName);
+ } else {
+ symbolsFileName = null;
+ }
+ }
+
+ if (symbolsFileName == null) {
+ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, Messages.getString("GDBJtagDebugger.err_no_img_file"), null)); //$NON-NLS-1$
+ rm.done();
+ return;
+ }
+
+ // Escape windows path separator characters TWICE, once for Java and once for GDB.
+ symbolsFileName = symbolsFileName.replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ String symbolsOffset = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET);
+ if (symbolsOffset.length() > 0) {
+ symbolsOffset = "0x" + symbolsOffset;
+ }
+ List<String> commands = new ArrayList<String>();
+ fGdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands);
+ queueCommands(commands, rm);
+
+ } else {
+ rm.done();
+ }
+ } catch (CoreException e) {
+ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot load symbol", e)); //$NON-NLS-1$
+ rm.done();
+ }
+ }},
+
+ /*
* Hook up to remote target
*/
new Step() {
@@ -410,7 +466,7 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try {
- if (config.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, true)) {
+ if (config.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)) {
List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doReset(commands);
queueCommands(commands, rm);
@@ -447,7 +503,7 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try {
- if (config.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, true)) {
+ if (config.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)) {
List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doHalt(commands);
queueCommands(commands, rm);
@@ -467,16 +523,21 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try {
- String userCmd = config.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, ""); //$NON-NLS-1$
+ String userCmd = config.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, IGDBJtagConstants.DEFAULT_INIT_COMMANDS);
userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd);
- String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$
-
- CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm);
- crm.setDoneCount(commands.length);
- for (int i = 0; i < commands.length; ++i) {
- fCommandControl.queueCommand(
- new CLICommand<MIInfo>(fCommandControl.getContext(), commands[i]),
- new DataRequestMonitor<MIInfo>(getExecutor(), crm));
+ if (userCmd.length() > 0) {
+ String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$
+
+ CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm);
+ crm.setDoneCount(commands.length);
+ for (int i = 0; i < commands.length; ++i) {
+ fCommandControl.queueCommand(
+ new CLICommand<MIInfo>(fCommandControl.getContext(), commands[i]),
+ new DataRequestMonitor<MIInfo>(getExecutor(), crm));
+ }
+ }
+ else {
+ rm.done();
}
} catch (CoreException e) {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot run user defined init commands", e)); //$NON-NLS-1$
@@ -491,20 +552,44 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try {
+ String imageFileName = null;
if (config.getAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE)) {
- // Escape windows path separator characters TWICE, once for Java and once for GDB.
- String imageFileName = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, ""); //$NON-NLS-1$
- if (imageFileName.length() > 0) {
- imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName).replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
- String imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- List<String> commands = new ArrayList<String>();
- fGdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands);
- queueCommands(commands, rm);
- } else {
- rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Image name cannot be empty", null)); //$NON-NLS-1$
- rm.done();
+ // New setting in Helios. Default is true. Check for existence
+ // in order to support older launch configs
+ if (config.hasAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE) &&
+ config.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE)) {
+ IPath programFile = CDebugUtils.verifyProgramPath(config);
+ if (programFile != null) {
+ imageFileName = programFile.toOSString();
+ }
}
- } else {
+ else {
+ imageFileName = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME); //$NON-NLS-1$
+ if (imageFileName.length() > 0) {
+ imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName);
+ } else {
+ imageFileName = null;
+ }
+ }
+
+ if (imageFileName == null) {
+ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, Messages.getString("GDBJtagDebugger.err_no_img_file"), null)); //$NON-NLS-1$
+ rm.done();
+ return;
+ }
+
+ // Escape windows path separator characters TWICE, once for Java and once for GDB.
+ imageFileName = imageFileName.replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ String imageOffset = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET);
+ if (imageOffset.length() > 0) {
+ imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); //$NON-NLS-2$ //$NON-NLS-4$
+ }
+ List<String> commands = new ArrayList<String>();
+ fGdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands);
+ queueCommands(commands, rm);
+ }
+ else {
rm.done();
}
} catch (CoreException e) {
@@ -512,36 +597,6 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.done();
}
}},
- /*
- * Execute symbol loading
- */
- new Step() {
- @Override
- public void execute(RequestMonitor rm) {
- ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
- try {
- if (config.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS)) {
- // Escape windows path separator characters TWICE, once for Java and once for GDB.
- String symbolsFileName = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, ""); //$NON-NLS-1$
- if (symbolsFileName.length() > 0) {
- symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName).replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
- String symbolsOffset = "0x" + config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, ""); //$NON-NLS-1$ //$NON-NLS-2$
- List<String> commands = new ArrayList<String>();
- fGdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands);
- queueCommands(commands, rm);
- } else {
- rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Symbol name cannot be empty", null)); //$NON-NLS-1$
- rm.done();
- }
- } else {
- rm.done();
- }
- } catch (CoreException e) {
- rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot load symbol", e)); //$NON-NLS-1$
- rm.done();
- }
- }
- },
/*
* Start tracking the breakpoints once we know we are connected to the target (necessary for remote debugging)
*/
@@ -566,7 +621,7 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try {
if (config.getAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER)) {
- String pcRegister = config.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, "")); //$NON-NLS-1$
+ String pcRegister = config.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_PC_REGISTER)); //$NON-NLS-1$
List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doSetPC(pcRegister, commands);
queueCommands(commands, rm);
@@ -587,7 +642,7 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try {
if (config.getAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT)) {
- String stopAt = config.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, ""); //$NON-NLS-1$
+ String stopAt = config.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT); //$NON-NLS-1$
List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doStopAt(stopAt, commands);
queueCommands(commands, rm);
@@ -628,16 +683,21 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try {
- String userCmd = config.getAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, ""); //$NON-NLS-1$
- userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd);
- String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$
-
- CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm);
- crm.setDoneCount(commands.length);
- for (int i = 0; i < commands.length; ++i) {
- fCommandControl.queueCommand(
- new CLICommand<MIInfo>(fCommandControl.getContext(), commands[i]),
- new DataRequestMonitor<MIInfo>(getExecutor(), crm));
+ String userCmd = config.getAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, IGDBJtagConstants.DEFAULT_RUN_COMMANDS); //$NON-NLS-1$
+ if (userCmd.length() > 0) {
+ userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd);
+ String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$
+
+ CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm);
+ crm.setDoneCount(commands.length);
+ for (int i = 0; i < commands.length; ++i) {
+ fCommandControl.queueCommand(
+ new CLICommand<MIInfo>(fCommandControl.getContext(), commands[i]),
+ new DataRequestMonitor<MIInfo>(getExecutor(), crm));
+ }
+ }
+ else {
+ rm.done();
}
} catch (CoreException e) {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot run user defined run commands", e)); //$NON-NLS-1$
@@ -703,12 +763,11 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
private IGDBJtagDevice getGDBJtagDevice (ILaunchConfiguration config)
throws CoreException, NullPointerException {
IGDBJtagDevice gdbJtagDevice = null;
- String jtagDeviceName = config.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, ""); //$NON-NLS-1$
- GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.
- getInstance().getGDBJtagDeviceContribution();
- for (int i = 0; i < availableDevices.length; i++) {
- if (jtagDeviceName.equals(availableDevices[i].getDeviceName())) {
- gdbJtagDevice = availableDevices[i].getDevice();
+ String jtagDeviceName = config.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, IGDBJtagConstants.DEFAULT_JTAG_DEVICE); //$NON-NLS-1$
+ GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance().getGDBJtagDeviceContribution();
+ for (GDBJtagDeviceContribution availableDevice : availableDevices) {
+ if (jtagDeviceName.equals(availableDevice.getDeviceName())) {
+ gdbJtagDevice = availableDevice.getDevice();
break;
}
}
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
index 845370eec7..3041cc66ad 100644
--- 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
@@ -24,6 +24,7 @@ import java.util.List;
import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
+import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
@@ -41,6 +42,7 @@ import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIGDBSetNewConsole;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
@@ -117,14 +119,58 @@ public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
List<String> commands = new ArrayList<String>();
- // hook up to remote target
if (submonitor.isCanceled()) {
throw new OperationCanceledException();
}
+ // execute symbol load
+ boolean doLoadSymbols = config.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS);
+ if (doLoadSymbols) {
+ String symbolsFileName = null;
+ // New setting in Helios. Default is true. Check for existence
+ // in order to support older launch configs
+ if (config.hasAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS) &&
+ config.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS)) {
+ IPath programFile = CDebugUtils.verifyProgramPath(config);
+ if (programFile != null) {
+ symbolsFileName = programFile.toOSString();
+ }
+ }
+ else {
+ symbolsFileName = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME);
+ if (symbolsFileName.length() > 0) {
+ symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName);
+ }
+ }
+ if (symbolsFileName == null) {
+ // The launch config GUI should prevent this from happening, but just in case
+ throw new CoreException(new Status( IStatus.ERROR,
+ Activator.getUniqueIdentifier(),
+ -1, Messages.getString("GDBJtagDebugger.err_no_sym_file"), null));
+ }
+
+ // Escape windows path separator characters TWICE, once for Java and once for GDB.
+ symbolsFileName = symbolsFileName.replace("\\", "\\\\");
+
+ String symbolsOffset = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET);
+ if (symbolsOffset.length() > 0) {
+ symbolsOffset = "0x" + symbolsOffset;
+ }
+ commands.clear();
+ gdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands);
+ monitor.beginTask(Messages.getString("GDBJtagDebugger.loading_symbols"), 1); //$NON-NLS-1$
+ executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(15));
+ }
+
+ if (submonitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ // hook up to remote target
boolean useRemote = config.getAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET);
if (useRemote) {
submonitor.subTask(Messages.getString("GDBJtagDebugger.2")); //$NON-NLS-1$
try {
+ commands.clear();
if (gdbJtagDevice instanceof IGDBJtagConnection) {
URI connection = new URI(config.getAttribute(IGDBJtagConstants.ATTR_CONNECTION, IGDBJtagConstants.DEFAULT_CONNECTION));
IGDBJtagConnection device = (IGDBJtagConnection)gdbJtagDevice;
@@ -149,7 +195,7 @@ public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
submonitor.setWorkRemaining(80); // compensate for optional work above
// Run device-specific code to reset the board
- if (config.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, true)) {
+ if (config.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)) {
commands.clear();
gdbJtagDevice.doReset(commands);
int defaultDelay = gdbJtagDevice.getDefaultDelay();
@@ -159,7 +205,7 @@ public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
submonitor.setWorkRemaining(65); // compensate for optional work above
// Run device-specific code to halt the board
- if (config.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, true)) {
+ if (config.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)) {
commands.clear();
gdbJtagDevice.doHalt(commands);
executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(15));
@@ -172,31 +218,44 @@ public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
// execute load
boolean doLoad = config.getAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE);
if (doLoad) {
- // Escape windows path separator characters TWICE, once for Java and once for GDB.
- String imageFileName = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, ""); //$NON-NLS-1$
- if (imageFileName.length() > 0) {
- monitor.beginTask(Messages.getString("GDBJtagDebugger.5"), 1); //$NON-NLS-1$
- imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName).replace("\\", "\\\\");
- String imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, ""); //$NON-NLS-2$ //$NON-NLS-4$
- commands.clear();
- gdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands);
- executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(20));
+ String imageFileName = null;
+
+ // New setting in Helios. Default is true. Check for existence
+ // in order to support older launch configs
+ if (config.hasAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE) &&
+ config.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE)) {
+ IPath programFile = CDebugUtils.verifyProgramPath(config);
+ if (programFile != null) {
+ imageFileName = programFile.toOSString();
+ }
}
- }
- submonitor.setWorkRemaining(15); // compensate for optional work above
+ else {
+ imageFileName = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME);
+ if (imageFileName.length() > 0) {
+ imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName);
+ }
+ }
+ if (imageFileName == null) {
+ // The launch config GUI should prevent this from happening, but just in case
+ throw new CoreException(new Status( IStatus.ERROR,
+ Activator.getUniqueIdentifier(),
+ -1, Messages.getString("GDBJtagDebugger.err_no_img_file"), null));
+ }
+ imageFileName = imageFileName.replace("\\", "\\\\");
- // execute symbol load
- boolean doLoadSymbols = config.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS);
- if (doLoadSymbols) {
- String symbolsFileName = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, ""); //$NON-NLS-1$
- if (symbolsFileName.length() > 0) {
- symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName).replace("\\", "\\\\");
- String symbolsOffset = "0x" + config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, ""); //$NON-NLS-2$
- commands.clear();
- gdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands);
- executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(15));
+ String imageOffset = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET);
+ if (imageOffset.length() > 0) {
+ imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET);
}
+
+ commands.clear();
+ gdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands);
+ monitor.beginTask(Messages.getString("GDBJtagDebugger.loading_image"), 1); //$NON-NLS-1$
+ executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(20));
+
+
}
+ submonitor.setWorkRemaining(15); // compensate for optional work above
} catch (OperationCanceledException e) {
if (launch != null && launch.canTerminate()) {
launch.terminate();
@@ -229,7 +288,7 @@ public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
// Set program counter
boolean setPc = config.getAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER);
if (setPc) {
- String pcRegister = config.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, "")); //$NON-NLS-1$
+ String pcRegister = config.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_PC_REGISTER)); //$NON-NLS-1$
gdbJtagDevice.doSetPC(pcRegister, commands);
executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(20));
}
@@ -239,7 +298,7 @@ public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
monitor.beginTask(Messages.getString("GDBJtagDebugger.18"), 1); //$NON-NLS-1$
boolean setStopAt = config.getAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT);
if (setStopAt) {
- String stopAt = config.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, ""); //$NON-NLS-1$
+ String stopAt = config.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT); //$NON-NLS-1$
commands.clear();
gdbJtagDevice.doStopAt(stopAt, commands);
executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(20));
@@ -266,7 +325,7 @@ public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
private void executeGDBScript(String script, MISession miSession,
IProgressMonitor monitor) throws CoreException {
// Try to execute any extra command
- if (script == null)
+ if (script == null || script.length() == 0)
return;
script = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(script);
String[] commands = script.split("\\r?\\n");
@@ -309,7 +368,7 @@ public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
private IGDBJtagDevice getGDBJtagDevice (ILaunchConfiguration config)
throws CoreException, NullPointerException {
IGDBJtagDevice gdbJtagDevice = null;
- String jtagDeviceName = config.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, ""); //$NON-NLS-1$
+ String jtagDeviceName = config.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, IGDBJtagConstants.DEFAULT_JTAG_DEVICE); //$NON-NLS-1$
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.
getInstance().getGDBJtagDeviceContribution();
for (int i = 0; i < availableDevices.length; i++) {
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
index dd59117d85..55d28124f6 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 QNX Software Systems and others.
+ * Copyright (c) 2007 - 2010 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
@@ -10,11 +10,10 @@
*******************************************************************************/
package org.eclipse.cdt.debug.gdbjtag.core;
-import java.io.File;
-
import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.CDIDebugModel;
+import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDISession;
@@ -48,10 +47,9 @@ public class GDBJtagLaunchConfigurationDelegate extends AbstractCLaunchDelegate
if (mode.equals(ILaunchManager.DEBUG_MODE)) {
GDBJtagDebugger debugger = new GDBJtagDebugger();
- ICProject project = verifyCProject(configuration);
- IPath exePath = verifyProgramPath(configuration);
- File exeFile = exePath != null ? exePath.toFile() : null;
- ICDISession session = debugger.createSession(launch, exeFile, submonitor.newChild(1));
+ ICProject project = CDebugUtils.verifyCProject(configuration);
+ IPath exePath = CDebugUtils.verifyProgramPath(configuration);
+ ICDISession session = debugger.createSession(launch, null, submonitor.newChild(1));
IBinaryObject exeBinary = null;
if ( exePath != null ) {
exeBinary = verifyBinary(project, exePath);
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java
index aa8905f6e8..9a53d8aa8e 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 - 2008 QNX Software Systems and others.
+ * Copyright (c) 2007 - 2010 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
@@ -52,15 +52,33 @@ public interface IGDBJtagConstants {
public static final String ATTR_STOP_AT = Activator.PLUGIN_ID + ".stopAt"; //$NON-NLS-1$
public static final String ATTR_SET_RESUME = Activator.PLUGIN_ID + ".setResume"; //$NON-NLS-1$
public static final String ATTR_RUN_COMMANDS = Activator.PLUGIN_ID + ".runCommands"; //$NON-NLS-1$
-
+ /** @since 7.0 */ public static final String ATTR_USE_PROJ_BINARY_FOR_IMAGE = Activator.PLUGIN_ID + ".useProjBinaryForImage"; //$NON-NLS-1$
+ /** @since 7.0 */ public static final String ATTR_USE_FILE_FOR_IMAGE = Activator.PLUGIN_ID + ".useFileForImage"; //$NON-NLS-1$
+ /** @since 7.0 */ public static final String ATTR_USE_PROJ_BINARY_FOR_SYMBOLS = Activator.PLUGIN_ID + ".useProjBinaryForSymbols"; //$NON-NLS-1$
+ /** @since 7.0 */ public static final String ATTR_USE_FILE_FOR_SYMBOLS = Activator.PLUGIN_ID + ".useFileForSymbols"; //$NON-NLS-1$
+
public static final boolean DEFAULT_DO_RESET = true;
public static final boolean DEFAULT_DO_HALT = true;
public static final int DEFAULT_DELAY = 3;
- public static final boolean DEFAULT_LOAD_IMAGE = false;
- public static final boolean DEFAULT_LOAD_SYMBOLS = false;
+ public static final boolean DEFAULT_LOAD_IMAGE = true;
+ public static final boolean DEFAULT_LOAD_SYMBOLS = true;
public static final boolean DEFAULT_SET_PC_REGISTER = false;
public static final boolean DEFAULT_SET_STOP_AT = false;
public static final boolean DEFAULT_SET_RESUME = false;
public static final boolean DEFAULT_USE_DEFAULT_RUN = true;
-
+
+ /** @since 7.0 */ public static final String DEFAULT_INIT_COMMANDS = ""; //$NON-NLS-1$
+ /** @since 7.0 */ public static final String DEFAULT_IMAGE_FILE_NAME = ""; //$NON-NLS-1$
+ /** @since 7.0 */ public static final String DEFAULT_SYMBOLS_FILE_NAME = ""; //$NON-NLS-1$
+ /** @since 7.0 */ public static final String DEFAULT_RUN_COMMANDS = ""; //$NON-NLS-1$
+ /** @since 7.0 */ public static final boolean DEFAULT_USE_PROJ_BINARY_FOR_IMAGE = true;
+ /** @since 7.0 */ public static final boolean DEFAULT_USE_FILE_FOR_IMAGE = false;
+ /** @since 7.0 */ public static final boolean DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS = true;
+ /** @since 7.0 */ public static final boolean DEFAULT_USE_FILE_FOR_SYMBOLS = false;
+ /** @since 7.0 */ public static final String DEFAULT_IMAGE_OFFSET = ""; //$NON-NLS-1$
+ /** @since 7.0 */ public static final String DEFAULT_SYMBOLS_OFFSET = ""; //$NON-NLS-1$
+ /** @since 7.0 */ public static final String DEFAULT_PC_REGISTER = ""; //$NON-NLS-1$
+ /** @since 7.0 */ public static final String DEFAULT_STOP_AT = ""; //$NON-NLS-1$
+ /** @since 7.0 */ public static final String DEFAULT_JTAG_DEVICE = ""; //$NON-NLS-1$
+
}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Message.properties b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Message.properties
index bcded8c7a4..5eb05951eb 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Message.properties
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Message.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008 QNX Software Systems and others.
+# Copyright (c) 2008 - 2010 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
@@ -15,5 +15,9 @@ GDBJtagDebugger.2=Connecting to remote
GDBJtagDebugger.21=GDB command:
GDBJtagDebugger.22=Failed command
GDBJtagDebugger.3=Executing init commands
-GDBJtagDebugger.5=Loading image
+GDBJtagDebugger.loading_image=Loading image
+GDBJtagDebugger.loading_symbols=Loading symbolics
src.common.No_answer=No answer
+
+GDBJtagDebugger.err_no_sym_file=Symbolics loading was requested but file was not specified or not found.
+GDBJtagDebugger.err_no_img_file=Image loading was requested but file was not specified or not found.
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java
index 2a2aea3880..47260a3261 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java
@@ -77,8 +77,19 @@ public class DefaultGDBJtagDeviceImpl implements IGDBJtagDevice {
*/
public void doLoadImage(String imageFileName, String imageOffset, Collection<String> commands) {
String file = escapeScpaces(imageFileName);
- String cmd = "restore " + file + " " + imageOffset; //$NON-NLS-1$ //$NON-NLS-2$
- addCmd(commands, cmd);
+ if (imageOffset.length() > 0) {
+ // 'restore' simply puts the program into memory.
+ addCmd(commands, "restore " + file + " " + imageOffset);
+ }
+ else {
+ // 'load' puts the program into memory and sets the PC. To see why
+ // we do this when no offset is specified, see
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=310304#c20
+ addCmd(commands, "load " + file);
+ }
+ // 'exec-file' specifies the program as the context for getting memory.
+ // Basically, it tells gdb "this is the program we'll be debugging"
+ addCmd(commands, "exec-file " + file);
}
/* (non-Javadoc)
@@ -86,8 +97,12 @@ public class DefaultGDBJtagDeviceImpl implements IGDBJtagDevice {
*/
public void doLoadSymbol(String symbolFileName, String symbolOffset, Collection<String> commands) {
String file = escapeScpaces(symbolFileName);
- String cmd = "add-sym " + file + " " + symbolOffset; //$NON-NLS-1$ //$NON-NLS-2$
- addCmd(commands, cmd);
+ if (symbolOffset == null || (symbolOffset.length() == 0)) {
+ addCmd(commands, "symbol-file " + file);
+ }
+ else {
+ addCmd(commands, "add-sym " + file + " " + symbolOffset);
+ }
}
protected String escapeScpaces(String file) {
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java
index a8479447bb..036d984930 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java
@@ -159,7 +159,7 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
gdbCommand.setLayoutData(gd);
gdbCommand.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
@@ -216,7 +216,7 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
jtagDevice.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateDeviceIpPort(jtagDevice.getText());
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
@@ -275,7 +275,7 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
ipAddress.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
portNumber.addVerifyListener(new VerifyListener() {
@@ -285,13 +285,13 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
});
portNumber.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
connection.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
}
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
index 4152845356..6fc9143b26 100644
--- 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
@@ -160,7 +160,7 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
gdbCommand.setLayoutData(gd);
gdbCommand.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
@@ -200,7 +200,7 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
commandFactory.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
commandFactoryChanged();
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
}
@@ -215,7 +215,7 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
miProtocol = new Combo(comp, SWT.READ_ONLY | SWT.DROP_DOWN);
miProtocol.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
}
@@ -285,7 +285,7 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
jtagDevice.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateDeviceIpPort(jtagDevice.getText());
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
@@ -344,7 +344,7 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
ipAddress.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
portNumber.addVerifyListener(new VerifyListener() {
@@ -354,13 +354,13 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
});
portNumber.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
connection.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
}
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
index 46ee2652f7..3e7297920c 100644
--- 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
@@ -15,7 +15,7 @@ package org.eclipse.cdt.debug.gdbjtag.ui;
import java.io.File;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
+import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -33,6 +33,7 @@ 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.events.SelectionListener;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.graphics.Image;
@@ -82,6 +83,16 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
boolean resume = false;
Text runCommands;
+
+ // New GUI added to address bug 310304
+ private Button useProjectBinaryForImage;
+ private Button useFileForImage;
+ private Button useProjectBinaryForSymbols;
+ private Button useFileForSymbols;
+ private Label imageOffsetLabel;
+ private Label symbolsOffsetLabel;
+ private Label projBinaryLabel1;
+ private Label projBinaryLabel2;
public String getName() {
return TAB_NAME;
@@ -170,7 +181,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
});
delay.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob();
}
});
@@ -197,7 +208,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
initCommands.setLayoutData(gd);
initCommands.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob();
}
});
@@ -231,15 +242,42 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
comp.setLayout(layout);
- Label imageLabel = new Label(comp, SWT.NONE);
- imageLabel.setText(Messages.getString("GDBJtagStartupTab.imageLabel_Text"));
+ SelectionListener radioButtonListener = new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ updateLaunchConfigurationDialog();
+ updateUseFileEnablement();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ };
+
+ useProjectBinaryForImage = new Button(comp, SWT.RADIO);
+ useProjectBinaryForImage.setText(Messages.getString("GDBJtagStartupTab.useProjectBinary_Label"));
+ useProjectBinaryForImage.setToolTipText(Messages.getString("GDBJtagStartupTab.useProjectBinary_ToolTip"));
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ useProjectBinaryForImage.setLayoutData(gd);
+ useProjectBinaryForImage.addSelectionListener(radioButtonListener);
+
+ projBinaryLabel1 = new Label(comp, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 3;
+ projBinaryLabel1.setLayoutData(gd);
+
+ useFileForImage = new Button(comp, SWT.RADIO);
+ useFileForImage.setText(Messages.getString("GDBJtagStartupTab.useFile_Label"));
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ useFileForImage.setLayoutData(gd);
+ useFileForImage.addSelectionListener(radioButtonListener);
+
imageFileName = new Text(comp, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 1;
imageFileName.setLayoutData(gd);
imageFileName.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob();
}
});
@@ -257,7 +295,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
}
});
- Label imageOffsetLabel = new Label(comp, SWT.NONE);
+ imageOffsetLabel = new Label(comp, SWT.NONE);
imageOffsetLabel.setText(Messages.getString("GDBJtagStartupTab.imageOffsetLabel_Text"));
imageOffset = new Text(comp, SWT.BORDER);
gd = new GridData();
@@ -271,10 +309,11 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
});
imageOffset.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob();
}
});
+
loadSymbols = new Button(group, SWT.CHECK);
loadSymbols.setText(Messages.getString("GDBJtagStartupTab.loadSymbols_Text"));
gd = new GridData();
@@ -292,16 +331,34 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
layout.numColumns = 4;
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
comp.setLayout(layout);
+
+ useProjectBinaryForSymbols = new Button(comp, SWT.RADIO);
+ useProjectBinaryForSymbols.setText(Messages.getString("GDBJtagStartupTab.useProjectBinary_Label"));
+ useProjectBinaryForSymbols.setToolTipText(Messages.getString("GDBJtagStartupTab.useProjectBinary_ToolTip"));
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ useProjectBinaryForSymbols.setLayoutData(gd);
+ useProjectBinaryForSymbols.addSelectionListener(radioButtonListener);
+
+ projBinaryLabel2 = new Label(comp, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 3;
+ projBinaryLabel2.setLayoutData(gd);
+
+ useFileForSymbols = new Button(comp, SWT.RADIO);
+ useFileForSymbols.setText(Messages.getString("GDBJtagStartupTab.useFile_Label"));
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ useFileForSymbols.setLayoutData(gd);
+ useFileForSymbols.addSelectionListener(radioButtonListener);
- Label symbolLabel = new Label(comp, SWT.NONE);
- symbolLabel.setText(Messages.getString("GDBJtagStartupTab.symbolsLabel_Text"));
symbolsFileName = new Text(comp, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 1;
symbolsFileName.setLayoutData(gd);
symbolsFileName.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob();
}
});
@@ -319,7 +376,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
}
});
- Label symbolsOffsetLabel = new Label(comp, SWT.NONE);
+ symbolsOffsetLabel = new Label(comp, SWT.NONE);
symbolsOffsetLabel.setText(Messages.getString("GDBJtagStartupTab.symbolsOffsetLabel_Text"));
symbolsOffset = new Text(comp, SWT.BORDER);
gd = new GridData();
@@ -333,12 +390,24 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
});
symbolsOffset.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob();
}
});
}
+ private void updateUseFileEnablement() {
+ boolean enabled = loadImage.getSelection() && useFileForImage.getSelection();
+ imageFileName.setEnabled(enabled);
+ imageFileBrowseWs.setEnabled(enabled);
+ imageFileBrowse.setEnabled(enabled);
+
+ enabled = loadSymbols.getSelection() && useFileForSymbols.getSelection();
+ symbolsFileName.setEnabled(enabled);
+ symbolsFileBrowseWs.setEnabled(enabled);
+ symbolsFileBrowse.setEnabled(enabled);
+ }
+
public void createRunOptionGroup(Composite parent) {
Group group = new Group(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -373,7 +442,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
});
pcRegister.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob();
}
});
@@ -396,7 +465,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
stopAt.setLayoutData(gd);
stopAt.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob();
}
});
@@ -419,18 +488,20 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
private void loadImageChanged() {
boolean enabled = loadImage.getSelection();
- imageFileName.setEnabled(enabled);
- imageFileBrowseWs.setEnabled(enabled);
- imageFileBrowse.setEnabled(enabled);
+ useProjectBinaryForImage.setEnabled(enabled);
+ useFileForImage.setEnabled(enabled);
imageOffset.setEnabled(enabled);
+ imageOffsetLabel.setEnabled(enabled);
+ updateUseFileEnablement();
}
private void loadSymbolsChanged() {
boolean enabled = loadSymbols.getSelection();
- symbolsFileName.setEnabled(enabled);
- symbolsFileBrowseWs.setEnabled(enabled);
- symbolsFileBrowse.setEnabled(enabled);
+ useProjectBinaryForSymbols.setEnabled(enabled);
+ useFileForSymbols.setEnabled(enabled);
symbolsOffset.setEnabled(enabled);
+ symbolsOffsetLabel.setEnabled(enabled);
+ updateUseFileEnablement();
}
private void pcRegisterChanged() {
@@ -459,7 +530,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
runCommands.setLayoutData(gd);
runCommands.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
+ scheduleUpdateJob();
}
});
}
@@ -474,40 +545,45 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
setMessage(null);
if (loadImage.getSelection()) {
- if (imageFileName.getText().trim().length() == 0) {
- setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_not_specified"));
- return false;
- }
-
- String path;
- try {
- path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName.getText().trim());
- IPath filePath = new Path(path);
- if (!filePath.toFile().exists()) {
+ if (!useProjectBinaryForImage.getSelection()) {
+ if (imageFileName.getText().trim().length() == 0) {
+ setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_not_specified"));
+ return false;
+ }
+
+ try {
+ String path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName.getText().trim());
+ IPath filePath = new Path(path);
+ if (!filePath.toFile().exists()) {
+ setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_does_not_exist"));
+ return false;
+ }
+ } catch (CoreException e) { // string substitution throws this if expression doesn't resolve
setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_does_not_exist"));
return false;
}
- } catch (CoreException e) {
- Activator.getDefault().getLog().log(e.getStatus());
}
} else {
setErrorMessage(null);
}
if (loadSymbols.getSelection()) {
- if (symbolsFileName.getText().trim().length() == 0) {
- setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_not_specified"));
- return false;
- }
- String path;
- try {
- path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName.getText().trim());
- IPath filePath = new Path(path);
- if (!filePath.toFile().exists()) {
+ if (!useProjectBinaryForSymbols.getSelection()) {
+ if (symbolsFileName.getText().trim().length() == 0) {
+ setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_not_specified"));
+ return false;
+ }
+
+ try {
+ String path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName.getText().trim());
+ IPath filePath = new Path(path);
+ if (!filePath.toFile().exists()) {
+ setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_does_not_exist"));
+ return false;
+ }
+ } catch (CoreException e) { // string substitution throws this if expression doesn't resolve
setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_does_not_exist"));
return false;
}
- } catch (CoreException e) {
- Activator.getDefault().getLog().log(e.getStatus());
}
} else {
setErrorMessage(null);
@@ -540,72 +616,135 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
}
/* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
-// protected void updateLaunchConfigurationDialog() {
-// super.updateLaunchConfigurationDialog();
-// isValid(getLaunchConfigurationDialog());
-// }
-
public void initializeFrom(ILaunchConfiguration configuration) {
try {
- initCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, "")); //$NON-NLS-1$
+ // Initialization Commands
doReset.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET));
- doResetChanged();
- doHalt.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT));
delay.setText(String.valueOf(configuration.getAttribute(IGDBJtagConstants.ATTR_DELAY, IGDBJtagConstants.DEFAULT_DELAY)));
+ doHalt.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT));
+ initCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, IGDBJtagConstants.DEFAULT_INIT_COMMANDS));
+
+ // Load Image...
loadImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE));
- loadImageChanged();
- String defaultImageFileName = configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, ""); //$NON-NLS-1$
- if (defaultImageFileName.equals("")) {
- defaultImageFileName = configuration.getWorkingCopy().getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); //$NON-NLS-1$
- }
- imageFileName.setText(defaultImageFileName);
- imageOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, "")); //$NON-NLS-1$
+ useProjectBinaryForImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE));
+ useFileForImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_IMAGE));
+ imageFileName.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME));
+ imageOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET));
+
+ //.. and Symbols
loadSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS));
- loadSymbolsChanged();
- symbolsFileName.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, "")); //$NON-NLS-1$
- symbolsOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, "")); //$NON-NLS-1$
+ useProjectBinaryForSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS));
+ useFileForSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_SYMBOLS));
+ symbolsFileName.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME));
+ symbolsOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET));
+
+ // Runtime Options
setPcRegister.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER));
- pcRegisterChanged();
- pcRegister.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, "")); //$NON-NLS-1$
+ pcRegister.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, IGDBJtagConstants.DEFAULT_PC_REGISTER));
setStopAt.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT));
- stopAtChanged();
- stopAt.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, "")); //$NON-NLS-1$
+ stopAt.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT));
setResume.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME));
+
+ // Run Commands
+ runCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, IGDBJtagConstants.DEFAULT_RUN_COMMANDS));
+
+ String programName = CDebugUtils.getProgramName(configuration);
+ if (programName != null) {
+ int lastSlash = programName.indexOf('\\');
+ if (lastSlash >= 0) {
+ programName = programName.substring(lastSlash + 1);
+ }
+ lastSlash = programName.indexOf('/');
+ if (lastSlash >= 0) {
+ programName = programName.substring(lastSlash + 1);
+ }
+ projBinaryLabel1.setText(programName);
+ projBinaryLabel2.setText(programName);
+ }
+
+ doResetChanged();
+ loadImageChanged();
+ loadSymbolsChanged();
+ pcRegisterChanged();
+ stopAtChanged();
resumeChanged();
- runCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, "")); //$NON-NLS-1$)
+ updateUseFileEnablement();
+
} catch (CoreException e) {
Activator.getDefault().getLog().log(e.getStatus());
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, initCommands.getText());
- configuration.setAttribute(IGDBJtagConstants.ATTR_DELAY, Integer.parseInt(delay.getText()));
+
+ // Initialization Commands
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, doReset.getSelection());
+ configuration.setAttribute(IGDBJtagConstants.ATTR_DELAY, Integer.parseInt(delay.getText()));
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, doHalt.getSelection());
+ configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, initCommands.getText());
+
+ // Load Image...
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, loadImage.getSelection());
+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, useProjectBinaryForImage.getSelection());
+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_IMAGE, useFileForImage.getSelection());
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, imageFileName.getText().trim());
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, imageOffset.getText());
+
+ //.. and Symbols
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, loadSymbols.getSelection());
- configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, symbolsOffset.getText());
+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, useProjectBinaryForSymbols.getSelection());
+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_SYMBOLS, useFileForSymbols.getSelection());
configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, symbolsFileName.getText().trim());
+ configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, symbolsOffset.getText());
+
+ // Runtime Options
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, setPcRegister.getSelection());
configuration.setAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, pcRegister.getText());
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, setStopAt.getSelection());
configuration.setAttribute(IGDBJtagConstants.ATTR_STOP_AT, stopAt.getText());
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_RESUME, setResume.getSelection());
+
+ // Run Commands
configuration.setAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, runCommands.getText());
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, ""); //$NON-NLS-1$
+ // Initialization Commands
+ configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_DELAY, IGDBJtagConstants.DEFAULT_DELAY);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, IGDBJtagConstants.DEFAULT_INIT_COMMANDS);
+
+ // Load Image...
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE);
- configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, ""); //$NON-NLS-1$
- configuration.setAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, ""); //$NON-NLS-1$
- configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, true);
- configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, true);
- }
+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_IMAGE);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET);
+ //.. and Symbols
+ configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_SYMBOLS);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET);
+
+ // Runtime Options
+ configuration.setAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, IGDBJtagConstants.DEFAULT_PC_REGISTER);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT);
+ configuration.setAttribute(IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME);
+
+ // Run Commands
+ configuration.setAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, IGDBJtagConstants.DEFAULT_RUN_COMMANDS);
+ }
}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties
index 999ee921d3..72b7724cc1 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties
@@ -31,6 +31,9 @@ GDBJtagStartupTab.symbolsLabel_Text=Symbols file name:
GDBJtagStartupTab.symbolsFileBrowseWs_Title=Select symbols file
GDBJtagStartupTab.symbolsFileBrowse_Title=Select symbols file
GDBJtagStartupTab.symbolsOffsetLabel_Text=Symbols offset (hex):
+GDBJtagStartupTab.useProjectBinary_Label=Use project binary:
+GDBJtagStartupTab.useFile_Label=Use file:
+GDBJtagStartupTab.useProjectBinary_ToolTip=Use C/C++ application specified in the Main tab.
GDBJtagStartupTab.runOptionGroup_Text=Runtime Options
GDBJtagStartupTab.setPcRegister_Text=Set program counter at (hex):

Back to the top