Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2008-05-05 21:07:00 +0000
committerAlena Laskavaia2008-05-05 21:07:00 +0000
commitc6ce322757fe31f9e7205538a3db4c698ebdec9e (patch)
treed9001960a302211ae40c169b35dcb8b5c941ce08 /jtag/org.eclipse.cdt.debug.gdbjtag.ui
parentdf1f2e40e1697ec1f0e9b686c58341f298f80549 (diff)
downloadorg.eclipse.cdt-c6ce322757fe31f9e7205538a3db4c698ebdec9e.tar.gz
org.eclipse.cdt-c6ce322757fe31f9e7205538a3db4c698ebdec9e.tar.xz
org.eclipse.cdt-c6ce322757fe31f9e7205538a3db4c698ebdec9e.zip
pr 98684 - ui updates and validator - patch from Andy
Diffstat (limited to 'jtag/org.eclipse.cdt.debug.gdbjtag.ui')
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF3
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java122
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties29
3 files changed, 133 insertions, 21 deletions
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
index cf9f44e8cff..c50dca5e33d 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.cdt.debug.gdbjtag.core,
org.eclipse.core.variables,
org.eclipse.cdt.managedbuilder.ui,
- org.eclipse.ui.ide
+ org.eclipse.ui.ide,
+ org.eclipse.cdt.debug.core
Eclipse-LazyStart: true
Bundle-Vendor: %providerName
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 f622c643ac2..9a1d1ef4fa8 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
@@ -14,10 +14,13 @@ package org.eclipse.cdt.debug.gdbjtag.ui;
import java.io.File;
+import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
@@ -52,6 +55,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
Text initCommands;
Text delay;
Button doReset;
+ Button doHalt;
Button loadImage;
Text imageFileName;
@@ -137,7 +141,13 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
group.setLayoutData(gd);
group.setText(Messages.getString("GDBJtagStartupTab.initGroup_Text"));
- doReset = new Button(group, SWT.CHECK);
+ Composite comp = new Composite(group, SWT.NONE);
+ layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 0;
+ comp.setLayout(layout);
+
+ doReset = new Button(comp, SWT.CHECK);
doReset.setText(Messages.getString("GDBJtagStartupTab.doReset_Text"));
doReset.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -145,16 +155,9 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
updateLaunchConfigurationDialog();
}
});
-
- Composite comp = new Composite(group, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 2;
- comp.setLayout(layout);
-
- Label delayLabel = new Label(comp, SWT.NONE);
- delayLabel.setText(Messages.getString("GDBJtagStartupTab.delayLabel_Text"));
delay = new Text(comp, SWT.BORDER);
gd = new GridData();
+ gd.horizontalSpan = 1;
gd.widthHint = 60;
delay.setLayoutData(gd);
delay.addVerifyListener(new VerifyListener() {
@@ -168,6 +171,23 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
}
});
+ comp = new Composite(group, SWT.NONE);
+ layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.marginHeight = 0;
+ comp.setLayout(layout);
+
+ doHalt = new Button(comp, SWT.CHECK);
+ doHalt.setText(Messages.getString("GDBJtagStartupTab.doHalt_Text"));
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ doHalt.setLayoutData(gd);
+ doHalt.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateLaunchConfigurationDialog();
+ }
+ });
+
initCommands = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 60;
@@ -441,15 +461,95 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
});
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ public boolean isValid(ILaunchConfiguration launchConfig) {
+ if (!super.isValid(launchConfig))
+ return false;
+ setErrorMessage(null);
+ 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()) {
+ 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()) {
+ setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_does_not_exist"));
+ return false;
+ }
+ } catch (CoreException e) {
+ Activator.getDefault().getLog().log(e.getStatus());
+ }
+ } else {
+ setErrorMessage(null);
+ }
+
+ if (setPcRegister.getSelection()) {
+ if (pcRegister.getText().trim().length() == 0) {
+ setErrorMessage(Messages.getString("GDBJtagStartupTab.pcRegister_not_specified"));
+ return false;
+ }
+ } else {
+ setErrorMessage(null);
+ }
+ if (setStopAt.getSelection()) {
+ if (stopAt.getText().trim().length() == 0) {
+ setErrorMessage(Messages.getString("GDBJtagStartupTab.stopAt_not_specified"));
+ }
+ } else {
+ setErrorMessage(null);
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
+ */
+// protected void updateLaunchConfigurationDialog() {
+// super.updateLaunchConfigurationDialog();
+// isValid(getLaunchConfigurationDialog());
+// }
+
public void initializeFrom(ILaunchConfiguration configuration) {
try {
initCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, "")); //$NON-NLS-1$
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)));
loadImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE));
loadImageChanged();
- imageFileName.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, "")); //$NON-NLS-1$
+ 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$
loadSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS));
loadSymbolsChanged();
@@ -473,6 +573,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, initCommands.getText());
configuration.setAttribute(IGDBJtagConstants.ATTR_DELAY, Integer.parseInt(delay.getText()));
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, doReset.getSelection());
+ configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, doHalt.getSelection());
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, loadImage.getSelection());
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, imageFileName.getText().trim());
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, imageOffset.getText());
@@ -493,6 +594,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
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);
}
}
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 8b979bdc2c6..51d2cc55bc9 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
@@ -1,31 +1,40 @@
GDBJtagStartupTab.initGroup_Text=Initialization Commands
-GDBJtagStartupTab.doReset_Text=Automatically reset board and halt
-GDBJtagStartupTab.delayLabel_Text=Delay (s):
+GDBJtagStartupTab.doReset_Text=Reset and Delay (seconds):
+GDBJtagStartupTab.doHalt_Text=Halt
GDBJtagStartupTab.loadGroup_Text=Load Image and Symbols
-GDBJtagStartupTab.loadImage_Text=Automatically load image
+GDBJtagStartupTab.loadImage_Text=Load image
GDBJtagStartupTab.imageLabel_Text=Image file name:
GDBJtagStartupTab.imageFileBrowseWs_Title=Select image file
GDBJtagStartupTab.imageFileBrowse_Title=Select image file
-GDBJtagStartupTab.imageOffsetLabel_Text=Image offset:
+GDBJtagStartupTab.imageOffsetLabel_Text=Image offset (hex):
GDBJtagStartupTab.FileBrowseWs_Label=Workspace...
GDBJtagStartupTab.FileBrowseWs_Message=Select a workspace resource
GDBJtagStartupTab.FileBrowse_Label=File System...
GDBJtagStartupTab.FileBrowse_Message=Select a file from file system
-GDBJtagStartupTab.loadSymbols_Text=Automatically load symbols
-GDBJtagStartupTab.symbolsLabel_Text=Symbol file name:
+GDBJtagStartupTab.loadSymbols_Text=Load symbols
+GDBJtagStartupTab.symbolsLabel_Text=Symbols file name:
GDBJtagStartupTab.symbolsFileBrowseWs_Title=Select symbols file
GDBJtagStartupTab.symbolsFileBrowse_Title=Select symbols file
-GDBJtagStartupTab.symbolsOffsetLabel_Text=Symbols offset:
+GDBJtagStartupTab.symbolsOffsetLabel_Text=Symbols offset (hex):
GDBJtagStartupTab.runOptionGroup_Text=Runtime Options
-GDBJtagStartupTab.setPcRegister_Text=Automatically set program counter at:
-GDBJtagStartupTab.setStopAt_Text=Automatically stop on startup at:
-GDBJtagStartupTab.setResume_Text=Automatically resume
+GDBJtagStartupTab.setPcRegister_Text=Set program counter at (hex):
+GDBJtagStartupTab.setStopAt_Text=Set breakpoint at:
+GDBJtagStartupTab.setResume_Text=Resume
GDBJtagStartupTab.runGroup_Text=Run Commands
+GDBJtagStartupTab.imageFileName_not_specified=Image file name not specified
+GDBJtagStartupTab.imageFileName_does_not_exist=Image file does not exist
+GDBJtagStartupTab.imageOffset_not_specified=Image offset not specified
+GDBJtagStartupTab.symbolsFileName_not_specified=Symbols file name not specified
+GDBJtagStartupTab.symbolsFileName_does_not_exist=Symbols file does not exist
+GDBJtagStartupTab.symbolsOffset_not_specified=Symbols offset not specified
+GDBJtagStartupTab.pcRegister_not_specified=Program counter not specified
+GDBJtagStartupTab.stopAt_not_specified=Breakpoint location not specified
+
GDBJtagDebuggerTab.gdbSetupGroup_Text=GDB Setup
GDBJtagDebuggerTab.gdbCommandLabel=GDB Command:
GDBJtagDebuggerTab.gdbCommandBrowse=Browse...

Back to the top