mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bugzilla 292660.
This commit is contained in:
parent
7c27796dbd
commit
3abb81f9e4
18 changed files with 289 additions and 210 deletions
|
@ -51,10 +51,10 @@ public class GoToAddressBarWidget {
|
||||||
fExpression.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
fExpression.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
fOKButton = new Button(fComposite, SWT.NONE);
|
fOKButton = new Button(fComposite, SWT.NONE);
|
||||||
fOKButton.setText("Go");
|
fOKButton.setText(Messages.getString("GoToAddressBarWidget.Go")); //$NON-NLS-1$
|
||||||
|
|
||||||
fOKNewTabButton = new Button(fComposite, SWT.NONE);
|
fOKNewTabButton = new Button(fComposite, SWT.NONE);
|
||||||
fOKNewTabButton.setText("New Tab");
|
fOKNewTabButton.setText(Messages.getString("GoToAddressBarWidget.NewTab")); //$NON-NLS-1$
|
||||||
|
|
||||||
return fComposite;
|
return fComposite;
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,7 +235,7 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IL
|
||||||
for (int i = 0; i < managerTypes.length; i++) {
|
for (int i = 0; i < managerTypes.length; i++) {
|
||||||
if (managerTypes[i] instanceof Class<?>) {
|
if (managerTypes[i] instanceof Class<?>) {
|
||||||
Class<?> clazz = (Class<?>)managerTypes[i];
|
Class<?> clazz = (Class<?>)managerTypes[i];
|
||||||
if ("org.eclipse.debug.ui.contexts.IBug145635Marker".equals(clazz.getName()) ) {
|
if ("org.eclipse.debug.ui.contexts.IBug145635Marker".equals(clazz.getName()) ) { //$NON-NLS-1$
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IL
|
||||||
*/
|
*/
|
||||||
private String getPresentationContextId() {
|
private String getPresentationContextId() {
|
||||||
IViewSite site = (IViewSite)getSite();
|
IViewSite site = (IViewSite)getSite();
|
||||||
return site.getId() + (site.getSecondaryId() != null ? (":" + site.getSecondaryId()) : "");
|
return site.getId() + (site.getSecondaryId() != null ? (":" + site.getSecondaryId()) : ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
|
@ -615,7 +615,7 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IL
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IMemoryBlock block = createMemoryBlock(retrieval, "0", context);
|
IMemoryBlock block = createMemoryBlock(retrieval, "0", context); //$NON-NLS-1$
|
||||||
|
|
||||||
fCurrentContainers.add(container);
|
fCurrentContainers.add(container);
|
||||||
rendering.init(container, block);
|
rendering.init(container, block);
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.osgi.framework.BundleContext;
|
||||||
public class MemoryBrowserPlugin extends AbstractUIPlugin {
|
public class MemoryBrowserPlugin extends AbstractUIPlugin {
|
||||||
|
|
||||||
// The plug-in ID
|
// The plug-in ID
|
||||||
public static final String PLUGIN_ID = "org.eclipse.cdt.debug.ui.memory.memorybrowser";
|
public static final String PLUGIN_ID = "org.eclipse.cdt.debug.ui.memory.memorybrowser"; //$NON-NLS-1$
|
||||||
|
|
||||||
// The shared instance
|
// The shared instance
|
||||||
private static MemoryBrowserPlugin plugin;
|
private static MemoryBrowserPlugin plugin;
|
||||||
|
|
|
@ -10,5 +10,7 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
GoToAddressBarWidget.Go=Go
|
GoToAddressBarWidget.Go=Go
|
||||||
|
GoToAddressBarWidget.Go=Go
|
||||||
|
GoToAddressBarWidget.NewTab=New Tab
|
||||||
GoToAddressBarWidget.NewTab=New Tab
|
GoToAddressBarWidget.NewTab=New Tab
|
||||||
MemoryBrowser.DefaultRendering=Default Rendering
|
MemoryBrowser.DefaultRendering=Default Rendering
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<action
|
<action
|
||||||
class="org.eclipse.cdt.debug.ui.memory.search.FindAction"
|
class="org.eclipse.cdt.debug.ui.memory.search.FindAction"
|
||||||
enablesFor="1"
|
enablesFor="1"
|
||||||
id="org.eclipse.cdt.debug.ui.memory.search.FindAction"
|
id="org.eclipse.cdt.debug.ui.memory.search.FindNextAction"
|
||||||
helpContextId="FindNextAction_context"
|
helpContextId="FindNextAction_context"
|
||||||
label="%action.label.0"
|
label="%action.label.0"
|
||||||
menubarPath="additions">
|
menubarPath="additions">
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<action
|
<action
|
||||||
class="org.eclipse.cdt.debug.ui.memory.search.FindAction"
|
class="org.eclipse.cdt.debug.ui.memory.search.FindAction"
|
||||||
enablesFor="1"
|
enablesFor="1"
|
||||||
id="org.eclipse.cdt.debug.ui.memory.search.FindAction"
|
id="org.eclipse.cdt.debug.ui.memory.search.FindNextAction"
|
||||||
helpContextId="FindNextAction_context"
|
helpContextId="FindNextAction_context"
|
||||||
label="%action.label.2"
|
label="%action.label.2"
|
||||||
menubarPath="additions">
|
menubarPath="additions">
|
||||||
|
|
|
@ -27,6 +27,8 @@ import org.eclipse.ui.IViewPart;
|
||||||
|
|
||||||
public class FindAction implements IViewActionDelegate {
|
public class FindAction implements IViewActionDelegate {
|
||||||
|
|
||||||
|
private static String FIND_NEXT_ID = "org.eclipse.cdt.debug.ui.memory.search.FindNextAction"; //$NON-NLS-1$
|
||||||
|
|
||||||
private IMemoryRenderingSite fView;
|
private IMemoryRenderingSite fView;
|
||||||
|
|
||||||
private static Properties fSearchDialogProperties = new Properties();
|
private static Properties fSearchDialogProperties = new Properties();
|
||||||
|
@ -63,9 +65,9 @@ public class FindAction implements IViewActionDelegate {
|
||||||
Shell shell = CDebugUIPlugin.getActiveWorkbenchShell();
|
Shell shell = CDebugUIPlugin.getActiveWorkbenchShell();
|
||||||
FindReplaceDialog dialog = new FindReplaceDialog(shell, (IMemoryBlockExtension) memBlock,
|
FindReplaceDialog dialog = new FindReplaceDialog(shell, (IMemoryBlockExtension) memBlock,
|
||||||
fView, (Properties) fSearchDialogProperties);
|
fView, (Properties) fSearchDialogProperties);
|
||||||
if(action.getText().equalsIgnoreCase("Find Next"))
|
if(action.getId().equals(FIND_NEXT_ID))
|
||||||
{
|
{
|
||||||
if(fSearchDialogProperties.getProperty(FindReplaceDialog.SEARCH_ENABLE_FIND_NEXT, "false").equals("true"))
|
if(Boolean.valueOf(fSearchDialogProperties.getProperty(FindReplaceDialog.SEARCH_ENABLE_FIND_NEXT, Boolean.FALSE.toString())))
|
||||||
{
|
{
|
||||||
dialog.performFindNext();
|
dialog.performFindNext();
|
||||||
}
|
}
|
||||||
|
@ -83,10 +85,9 @@ public class FindAction implements IViewActionDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void selectionChanged(IAction action, ISelection selection) {
|
public void selectionChanged(IAction action, ISelection selection) {
|
||||||
if(action.getText().equalsIgnoreCase("Find Next"))
|
if(action.getId().equals(FIND_NEXT_ID))
|
||||||
{
|
{
|
||||||
action.setEnabled(fSearchDialogProperties.getProperty(FindReplaceDialog.SEARCH_ENABLE_FIND_NEXT, "false")
|
action.setEnabled(Boolean.valueOf(fSearchDialogProperties.getProperty(FindReplaceDialog.SEARCH_ENABLE_FIND_NEXT, Boolean.FALSE.toString())));
|
||||||
.equals("true"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -332,13 +332,13 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
else if(fFormatOctalButton.getSelection())
|
else if(fFormatOctalButton.getSelection())
|
||||||
fProperties.setProperty(SEARCH_FORMAT, SEARCH_FORMAT_OCTAL);
|
fProperties.setProperty(SEARCH_FORMAT, SEARCH_FORMAT_OCTAL);
|
||||||
|
|
||||||
fProperties.setProperty(SEARCH_FORMAT_FORWARD, "" + fForwardButton.getSelection());
|
fProperties.setProperty(SEARCH_FORMAT_FORWARD, Boolean.toString(fForwardButton.getSelection()));
|
||||||
|
|
||||||
fProperties.setProperty(SEARCH_FORMAT_CASEINSENSTIVE, "" + fCaseInSensitiveCheckbox.getSelection());
|
fProperties.setProperty(SEARCH_FORMAT_CASEINSENSTIVE, Boolean.toString(fCaseInSensitiveCheckbox.getSelection()));
|
||||||
|
|
||||||
fProperties.setProperty(SEARCH_FORMAT_WRAP, "" + fWrapCheckbox.getSelection());
|
fProperties.setProperty(SEARCH_FORMAT_WRAP, Boolean.toString(fWrapCheckbox.getSelection()));
|
||||||
|
|
||||||
fProperties.setProperty(SEARCH_ENABLE_FIND_NEXT, "false");
|
fProperties.setProperty(SEARCH_ENABLE_FIND_NEXT, Boolean.FALSE.toString());
|
||||||
|
|
||||||
setResult(null);
|
setResult(null);
|
||||||
|
|
||||||
|
@ -547,7 +547,7 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
data.left = new FormAttachment(fReplaceText, 0, SWT.LEFT);
|
data.left = new FormAttachment(fReplaceText, 0, SWT.LEFT);
|
||||||
data.width = 260;
|
data.width = 260;
|
||||||
fFindText.setLayoutData(data);
|
fFindText.setLayoutData(data);
|
||||||
fFindText.setText(fProperties.getProperty(SEARCH_FIND, ""));
|
fFindText.setText(fProperties.getProperty(SEARCH_FIND, "")); //$NON-NLS-1$
|
||||||
|
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fFindText, 0, SWT.CENTER);
|
data.top = new FormAttachment(fFindText, 0, SWT.CENTER);
|
||||||
|
@ -565,7 +565,7 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
data.left = new FormAttachment(replaceLabel);
|
data.left = new FormAttachment(replaceLabel);
|
||||||
data.width = 260;
|
data.width = 260;
|
||||||
fReplaceText.setLayoutData(data);
|
fReplaceText.setLayoutData(data);
|
||||||
fReplaceText.setText(fProperties.getProperty(SEARCH_REPLACE, ""));
|
fReplaceText.setText(fProperties.getProperty(SEARCH_REPLACE, "")); //$NON-NLS-1$
|
||||||
|
|
||||||
// group direction
|
// group direction
|
||||||
|
|
||||||
|
@ -582,7 +582,7 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
fForwardButton.setText(Messages.getString("FindReplaceDialog.ButtonForward")); //$NON-NLS-1$
|
fForwardButton.setText(Messages.getString("FindReplaceDialog.ButtonForward")); //$NON-NLS-1$
|
||||||
final Button backwardButton = new Button(directionGroup, SWT.RADIO);
|
final Button backwardButton = new Button(directionGroup, SWT.RADIO);
|
||||||
backwardButton.setText(Messages.getString("FindReplaceDialog.ButtonBackward")); //$NON-NLS-1$
|
backwardButton.setText(Messages.getString("FindReplaceDialog.ButtonBackward")); //$NON-NLS-1$
|
||||||
final boolean isForward = fProperties.getProperty(SEARCH_FORMAT_FORWARD, "true").equalsIgnoreCase("true");
|
final boolean isForward = Boolean.parseBoolean(fProperties.getProperty(SEARCH_FORMAT_FORWARD, Boolean.TRUE.toString()));
|
||||||
fForwardButton.setSelection(isForward);
|
fForwardButton.setSelection(isForward);
|
||||||
backwardButton.setSelection(!isForward);
|
backwardButton.setSelection(!isForward);
|
||||||
|
|
||||||
|
@ -824,7 +824,7 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
|
|
||||||
private BigInteger parseHexBigInteger(String s)
|
private BigInteger parseHexBigInteger(String s)
|
||||||
{
|
{
|
||||||
if(s.toUpperCase().startsWith("0X"))
|
if(s.toUpperCase().startsWith("0X")) //$NON-NLS-1$
|
||||||
return new BigInteger(s.substring(2), 16);
|
return new BigInteger(s.substring(2), 16);
|
||||||
else
|
else
|
||||||
return new BigInteger(s, 16);
|
return new BigInteger(s, 16);
|
||||||
|
@ -836,8 +836,8 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
{
|
{
|
||||||
BigInteger start = parseHexBigInteger(fProperties.getProperty(SEARCH_LAST_FOUND));
|
BigInteger start = parseHexBigInteger(fProperties.getProperty(SEARCH_LAST_FOUND));
|
||||||
BigInteger end = parseHexBigInteger(fProperties.getProperty(SEARCH_END));
|
BigInteger end = parseHexBigInteger(fProperties.getProperty(SEARCH_END));
|
||||||
boolean searchForward = fProperties.getProperty(SEARCH_FORMAT_FORWARD, "false").equals("true");
|
boolean searchForward = Boolean.parseBoolean(fProperties.getProperty(SEARCH_FORMAT_FORWARD, Boolean.FALSE.toString()));
|
||||||
boolean caseInSensitive = fProperties.getProperty(SEARCH_FORMAT_CASEINSENSTIVE, "false").equals("true");
|
boolean caseInSensitive = Boolean.parseBoolean(fProperties.getProperty(SEARCH_FORMAT_CASEINSENSTIVE, Boolean.FALSE.toString()));
|
||||||
if(searchForward)
|
if(searchForward)
|
||||||
start = start.add(BigInteger.ONE);
|
start = start.add(BigInteger.ONE);
|
||||||
else
|
else
|
||||||
|
@ -866,7 +866,7 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
MemorySearchPlugin.logError(Messages.getString("FindReplaceDialog.MemorySearchFailure"), e);
|
MemorySearchPlugin.logError(Messages.getString("FindReplaceDialog.MemorySearchFailure"), e); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -979,7 +979,7 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
{
|
{
|
||||||
// Temporary, until platform accepts/adds new interface for setting the selection
|
// Temporary, until platform accepts/adds new interface for setting the selection
|
||||||
try {
|
try {
|
||||||
Method m = rendering.getClass().getMethod("setSelection", new Class[] { BigInteger.class, BigInteger.class } );
|
Method m = rendering.getClass().getMethod("setSelection", new Class[] { BigInteger.class, BigInteger.class } ); //$NON-NLS-1$
|
||||||
if(m != null)
|
if(m != null)
|
||||||
m.invoke(rendering, finalCurrentPosition, finalCurrentPosition.add(searchPhraseLength));
|
m.invoke(rendering, finalCurrentPosition, finalCurrentPosition.add(searchPhraseLength));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -991,8 +991,8 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
fProperties.setProperty(SEARCH_ENABLE_FIND_NEXT, "true");
|
fProperties.setProperty(SEARCH_ENABLE_FIND_NEXT, Boolean.TRUE.toString());
|
||||||
fProperties.setProperty(SEARCH_LAST_FOUND, "0x" + finalCurrentPosition.toString(16));
|
fProperties.setProperty(SEARCH_LAST_FOUND, "0x" + finalCurrentPosition.toString(16)); //$NON-NLS-1$
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class ExportMemoryDialog extends SelectionDialog
|
||||||
public ExportMemoryDialog(Shell parent, IMemoryBlock memoryBlock, BigInteger initialStartAddr)
|
public ExportMemoryDialog(Shell parent, IMemoryBlock memoryBlock, BigInteger initialStartAddr)
|
||||||
{
|
{
|
||||||
super(parent);
|
super(parent);
|
||||||
super.setTitle("Export Memory");
|
super.setTitle(Messages.getString("ExportMemoryDialog.Title")); //$NON-NLS-1$
|
||||||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||||
|
|
||||||
fMemoryBlock = memoryBlock;
|
fMemoryBlock = memoryBlock;
|
||||||
|
@ -123,7 +123,7 @@ public class ExportMemoryDialog extends SelectionDialog
|
||||||
// format
|
// format
|
||||||
|
|
||||||
Label textLabel = new Label(composite, SWT.NONE);
|
Label textLabel = new Label(composite, SWT.NONE);
|
||||||
textLabel.setText("Format: ");
|
textLabel.setText(Messages.getString("ExportMemoryDialog.Format")); //$NON-NLS-1$
|
||||||
|
|
||||||
fFormatCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
|
fFormatCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
|
||||||
|
|
||||||
|
@ -135,26 +135,26 @@ public class ExportMemoryDialog extends SelectionDialog
|
||||||
data.left = new FormAttachment(textLabel);
|
data.left = new FormAttachment(textLabel);
|
||||||
fFormatCombo.setLayoutData(data);
|
fFormatCombo.setLayoutData(data);
|
||||||
|
|
||||||
Vector exporters = new Vector();
|
Vector<IMemoryExporter> exporters = new Vector<IMemoryExporter>();
|
||||||
|
|
||||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||||
IExtensionPoint extensionPoint =
|
IExtensionPoint extensionPoint =
|
||||||
registry.getExtensionPoint("org.eclipse.cdt.debug.ui.memory.transport.memoryTransport");
|
registry.getExtensionPoint("org.eclipse.cdt.debug.ui.memory.transport.memoryTransport"); //$NON-NLS-1$
|
||||||
IConfigurationElement points[] =
|
IConfigurationElement points[] =
|
||||||
extensionPoint.getConfigurationElements();
|
extensionPoint.getConfigurationElements();
|
||||||
|
|
||||||
for (int i = 0; i < points.length; i++)
|
for (int i = 0; i < points.length; i++)
|
||||||
{
|
{
|
||||||
IConfigurationElement element = points[i];
|
IConfigurationElement element = points[i];
|
||||||
if("exporter".equals(element.getName()))
|
if("exporter".equals(element.getName())) //$NON-NLS-1$
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
exporters.addElement((IMemoryExporter) element.createExecutableExtension("class"));
|
exporters.addElement((IMemoryExporter) element.createExecutableExtension("class")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
catch(Exception e) {
|
catch(Exception e) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure", e));
|
DebugException.INTERNAL_ERROR, "Failure", e)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ public class ExportMemoryDialog extends SelectionDialog
|
||||||
* and only if we have a fresh/clean properties object.
|
* and only if we have a fresh/clean properties object.
|
||||||
*/
|
*/
|
||||||
static void initProperties(Properties properties, BigInteger addr) {
|
static void initProperties(Properties properties, BigInteger addr) {
|
||||||
final String addrstr = "0x" + addr.toString(16);
|
final String addrstr = "0x" + addr.toString(16); //$NON-NLS-1$
|
||||||
if (!properties.containsKey(IMemoryExporter.TRANSFER_START)) {
|
if (!properties.containsKey(IMemoryExporter.TRANSFER_START)) {
|
||||||
properties.setProperty(IMemoryExporter.TRANSFER_START, addrstr);
|
properties.setProperty(IMemoryExporter.TRANSFER_START, addrstr);
|
||||||
properties.setProperty(IMemoryExporter.TRANSFER_END, addrstr);
|
properties.setProperty(IMemoryExporter.TRANSFER_END, addrstr);
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class ImportMemoryDialog extends SelectionDialog
|
||||||
public ImportMemoryDialog(Shell parent, IMemoryBlock memoryBlock, BigInteger initialStartAddr, IMemoryRenderingSite renderingSite)
|
public ImportMemoryDialog(Shell parent, IMemoryBlock memoryBlock, BigInteger initialStartAddr, IMemoryRenderingSite renderingSite)
|
||||||
{
|
{
|
||||||
super(parent);
|
super(parent);
|
||||||
super.setTitle("Download to Memory");
|
super.setTitle(Messages.getString("ImportMemoryDialog.Title")); //$NON-NLS-1$
|
||||||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||||
|
|
||||||
fMemoryBlock = memoryBlock;
|
fMemoryBlock = memoryBlock;
|
||||||
|
@ -168,7 +168,7 @@ public class ImportMemoryDialog extends SelectionDialog
|
||||||
// format
|
// format
|
||||||
|
|
||||||
Label textLabel = new Label(composite, SWT.NONE);
|
Label textLabel = new Label(composite, SWT.NONE);
|
||||||
textLabel.setText("Format: ");
|
textLabel.setText(Messages.getString("ImportMemoryDialog.Format")); //$NON-NLS-1$
|
||||||
|
|
||||||
fFormatCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
|
fFormatCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
|
||||||
|
|
||||||
|
@ -184,22 +184,22 @@ public class ImportMemoryDialog extends SelectionDialog
|
||||||
|
|
||||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||||
IExtensionPoint extensionPoint =
|
IExtensionPoint extensionPoint =
|
||||||
registry.getExtensionPoint("org.eclipse.cdt.debug.ui.memory.transport.memoryTransport");
|
registry.getExtensionPoint("org.eclipse.cdt.debug.ui.memory.transport.memoryTransport"); //$NON-NLS-1$
|
||||||
IConfigurationElement points[] =
|
IConfigurationElement points[] =
|
||||||
extensionPoint.getConfigurationElements();
|
extensionPoint.getConfigurationElements();
|
||||||
|
|
||||||
for (int i = 0; i < points.length; i++)
|
for (int i = 0; i < points.length; i++)
|
||||||
{
|
{
|
||||||
IConfigurationElement element = points[i];
|
IConfigurationElement element = points[i];
|
||||||
if("importer".equals(element.getName()))
|
if("importer".equals(element.getName())) //$NON-NLS-1$
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
importers.addElement(element.createExecutableExtension("class"));
|
importers.addElement(element.createExecutableExtension("class")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
catch(Exception e) {
|
catch(Exception e) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure", e));
|
DebugException.INTERNAL_ERROR, "Failure", e)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ public class ImportMemoryDialog extends SelectionDialog
|
||||||
* and only if we have a fresh/clean properties object.
|
* and only if we have a fresh/clean properties object.
|
||||||
*/
|
*/
|
||||||
static void initProperties(Properties properties, BigInteger addr) {
|
static void initProperties(Properties properties, BigInteger addr) {
|
||||||
final String addrstr = "0x" + addr.toString(16);
|
final String addrstr = "0x" + addr.toString(16); //$NON-NLS-1$
|
||||||
if (!properties.containsKey(IMemoryImporter.TRANSFER_START)) {
|
if (!properties.containsKey(IMemoryImporter.TRANSFER_START)) {
|
||||||
properties.setProperty(IMemoryImporter.TRANSFER_START, addrstr);
|
properties.setProperty(IMemoryImporter.TRANSFER_START, addrstr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
// start address
|
// start address
|
||||||
|
|
||||||
Label startLabel = new Label(composite, SWT.NONE);
|
Label startLabel = new Label(composite, SWT.NONE);
|
||||||
startLabel.setText("Start address: ");
|
startLabel.setText(Messages.getString("PlainTextExporter.StartAddress")); //$NON-NLS-1$
|
||||||
FormData data = new FormData();
|
FormData data = new FormData();
|
||||||
startLabel.setLayoutData(data);
|
startLabel.setLayoutData(data);
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
// end address
|
// end address
|
||||||
|
|
||||||
Label endLabel = new Label(composite, SWT.NONE);
|
Label endLabel = new Label(composite, SWT.NONE);
|
||||||
endLabel.setText("End address: ");
|
endLabel.setText(Messages.getString("PlainTextExporter.EndAddress")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
||||||
data.left = new FormAttachment(fStartText);
|
data.left = new FormAttachment(fStartText);
|
||||||
|
@ -118,7 +118,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
// length
|
// length
|
||||||
|
|
||||||
Label lengthLabel = new Label(composite, SWT.NONE);
|
Label lengthLabel = new Label(composite, SWT.NONE);
|
||||||
lengthLabel.setText("Length: ");
|
lengthLabel.setText(Messages.getString("PlainTextExporter.Length")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
||||||
data.left = new FormAttachment(fEndText);
|
data.left = new FormAttachment(fEndText);
|
||||||
|
@ -137,7 +137,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
fFileText = new Text(composite, SWT.NONE);
|
fFileText = new Text(composite, SWT.NONE);
|
||||||
Button fileButton = new Button(composite, SWT.PUSH);
|
Button fileButton = new Button(composite, SWT.PUSH);
|
||||||
|
|
||||||
fileLabel.setText("File name: ");
|
fileLabel.setText(Messages.getString("Exporter.FileName")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
||||||
fileLabel.setLayoutData(data);
|
fileLabel.setLayoutData(data);
|
||||||
|
@ -148,14 +148,14 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
data.width = 300;
|
data.width = 300;
|
||||||
fFileText.setLayoutData(data);
|
fFileText.setLayoutData(data);
|
||||||
|
|
||||||
fileButton.setText("Browse...");
|
fileButton.setText(Messages.getString("Exporter.Browse")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fLengthText);
|
data.top = new FormAttachment(fLengthText);
|
||||||
data.left = new FormAttachment(fFileText);
|
data.left = new FormAttachment(fFileText);
|
||||||
fileButton.setLayoutData(data);
|
fileButton.setLayoutData(data);
|
||||||
|
|
||||||
|
|
||||||
fFileText.setText(properties.getProperty(TRANSFER_FILE, ""));
|
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fStartText.setText(properties.getProperty(TRANSFER_START));
|
fStartText.setText(properties.getProperty(TRANSFER_START));
|
||||||
|
@ -165,7 +165,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
catch(IllegalArgumentException e)
|
catch(IllegalArgumentException e)
|
||||||
{
|
{
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure", e));
|
DebugException.INTERNAL_ERROR, "Failure", e)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
fileButton.addSelectionListener(new SelectionListener() {
|
fileButton.addSelectionListener(new SelectionListener() {
|
||||||
|
@ -177,9 +177,9 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
||||||
dialog.setText("Choose memory export file");
|
dialog.setText(Messages.getString("PlainTextExporter.ChooseFile")); //$NON-NLS-1$
|
||||||
dialog.setFilterExtensions(new String[] { "*.*;*" } );
|
dialog.setFilterExtensions(new String[] { "*.*;*" } ); //$NON-NLS-1$
|
||||||
dialog.setFilterNames(new String[] { "All Files" } );
|
dialog.setFilterNames(new String[] { Messages.getString("Exporter.AllFiles") } ); //$NON-NLS-1$
|
||||||
dialog.setFileName(fFileText.getText());
|
dialog.setFileName(fFileText.getText());
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
BigInteger length = getLength();
|
BigInteger length = getLength();
|
||||||
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
|
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
|
||||||
BigInteger startAddress = getStartAddress();
|
BigInteger startAddress = getStartAddress();
|
||||||
String endString = "0x" + startAddress.add(length).toString(16);
|
String endString = "0x" + startAddress.add(length).toString(16); //$NON-NLS-1$
|
||||||
if(!fEndText.getText().equals(endString))
|
if(!fEndText.getText().equals(endString))
|
||||||
fEndText.setText(endString);
|
fEndText.setText(endString);
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
public BigInteger getEndAddress()
|
public BigInteger getEndAddress()
|
||||||
{
|
{
|
||||||
String text = fEndText.getText();
|
String text = fEndText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger endAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger endAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
public BigInteger getStartAddress()
|
public BigInteger getStartAddress()
|
||||||
{
|
{
|
||||||
String text = fStartText.getText();
|
String text = fStartText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
public BigInteger getLength()
|
public BigInteger getLength()
|
||||||
{
|
{
|
||||||
String text = fLengthText.getText();
|
String text = fLengthText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger lengthAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger lengthAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -354,12 +354,12 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
|
|
||||||
public String getId()
|
public String getId()
|
||||||
{
|
{
|
||||||
return "PlainTextExporter";
|
return "PlainTextExporter"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return "Plain Text";
|
return Messages.getString("PlainTextExporter.Name"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exportMemory() {
|
public void exportMemory() {
|
||||||
|
@ -387,7 +387,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
jobs = jobs.divide(factor);
|
jobs = jobs.divide(factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.beginTask("Transferring Data", jobs.intValue());
|
monitor.beginTask(Messages.getString("Exporter.ProgressTitle"), jobs.intValue()); //$NON-NLS-1$
|
||||||
|
|
||||||
BigInteger jobCount = BigInteger.ZERO;
|
BigInteger jobCount = BigInteger.ZERO;
|
||||||
while(transferAddress.compareTo(fEndAddress) < 0 && !monitor.isCanceled())
|
while(transferAddress.compareTo(fEndAddress) < 0 && !monitor.isCanceled())
|
||||||
|
@ -396,7 +396,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
if(fEndAddress.subtract(transferAddress).compareTo(length) < 0)
|
if(fEndAddress.subtract(transferAddress).compareTo(length) < 0)
|
||||||
length = fEndAddress.subtract(transferAddress);
|
length = fEndAddress.subtract(transferAddress);
|
||||||
|
|
||||||
monitor.subTask(String.format("Transfering %s bytes at address 0x%s", length.toString(10), transferAddress.toString(16)));
|
monitor.subTask(String.format(Messages.getString("Exporter.Progress"), length.toString(10), transferAddress.toString(16))); //$NON-NLS-1$
|
||||||
|
|
||||||
StringBuffer buf = new StringBuffer();
|
StringBuffer buf = new StringBuffer();
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
for(int i = 0; i < length.divide(CELLSIZE).intValue(); i++)
|
for(int i = 0; i < length.divide(CELLSIZE).intValue(); i++)
|
||||||
{
|
{
|
||||||
if(i != 0)
|
if(i != 0)
|
||||||
buf.append(" ");
|
buf.append(" "); //$NON-NLS-1$
|
||||||
MemoryByte bytes[] = ((IMemoryBlockExtension) fMemoryBlock).getBytesFromAddress(
|
MemoryByte bytes[] = ((IMemoryBlockExtension) fMemoryBlock).getBytesFromAddress(
|
||||||
transferAddress.add(CELLSIZE.multiply(BigInteger.valueOf(i))),
|
transferAddress.add(CELLSIZE.multiply(BigInteger.valueOf(i))),
|
||||||
CELLSIZE.longValue() / ((IMemoryBlockExtension) fMemoryBlock).getAddressableSize());
|
CELLSIZE.longValue() / ((IMemoryBlockExtension) fMemoryBlock).getAddressableSize());
|
||||||
|
@ -421,13 +421,13 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
{
|
{
|
||||||
String bString = BigInteger.valueOf(0xFF & bytes[byteIndex].getValue()).toString(16);
|
String bString = BigInteger.valueOf(0xFF & bytes[byteIndex].getValue()).toString(16);
|
||||||
if(bString.length() == 1)
|
if(bString.length() == 1)
|
||||||
buf.append("0");
|
buf.append("0"); //$NON-NLS-1$
|
||||||
buf.append(bString);
|
buf.append(bString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.write(buf.toString().toUpperCase());
|
writer.write(buf.toString().toUpperCase());
|
||||||
writer.write("\n");
|
writer.write("\n"); //$NON-NLS-1$
|
||||||
|
|
||||||
transferAddress = transferAddress.add(length);
|
transferAddress = transferAddress.add(length);
|
||||||
|
|
||||||
|
@ -443,20 +443,20 @@ public class PlainTextExporter implements IMemoryExporter {
|
||||||
monitor.done();
|
monitor.done();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to file.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrFile"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to file.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrFile"), ex); //$NON-NLS-1$
|
||||||
|
|
||||||
} catch (DebugException ex) {
|
} catch (DebugException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could read from target.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrReadTarget"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could read from target.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrReadTarget"), ex); //$NON-NLS-1$
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure exporting memory", ex));
|
DebugException.INTERNAL_ERROR, Messages.getString("Exporter.Falure"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure exporting memory", ex);
|
DebugException.INTERNAL_ERROR, Messages.getString("Exporter.Falure"), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}};
|
}};
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
// fComboRestoreToThisAddress.setLayoutData(data);
|
// fComboRestoreToThisAddress.setLayoutData(data);
|
||||||
|
|
||||||
Label labelStartText = new Label(composite, SWT.NONE);
|
Label labelStartText = new Label(composite, SWT.NONE);
|
||||||
labelStartText.setText("Restore to address: ");
|
labelStartText.setText(Messages.getString("PlainTextImporter.RestoreAddress")); //$NON-NLS-1$
|
||||||
|
|
||||||
fStartText = new Text(composite, SWT.NONE);
|
fStartText = new Text(composite, SWT.NONE);
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
|
@ -124,7 +124,7 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
fFileText = new Text(composite, SWT.NONE);
|
fFileText = new Text(composite, SWT.NONE);
|
||||||
Button fileButton = new Button(composite, SWT.PUSH);
|
Button fileButton = new Button(composite, SWT.PUSH);
|
||||||
|
|
||||||
fileLabel.setText("File name: ");
|
fileLabel.setText(Messages.getString("Importer.File")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
||||||
fileLabel.setLayoutData(data);
|
fileLabel.setLayoutData(data);
|
||||||
|
@ -135,14 +135,14 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
data.width = 300;
|
data.width = 300;
|
||||||
fFileText.setLayoutData(data);
|
fFileText.setLayoutData(data);
|
||||||
|
|
||||||
fileButton.setText("Browse...");
|
fileButton.setText(Messages.getString("Importer.Browse")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fStartText);
|
data.top = new FormAttachment(fStartText);
|
||||||
data.left = new FormAttachment(fFileText);
|
data.left = new FormAttachment(fFileText);
|
||||||
fileButton.setLayoutData(data);
|
fileButton.setLayoutData(data);
|
||||||
|
|
||||||
fFileText.setText(properties.getProperty(TRANSFER_FILE, ""));
|
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
|
||||||
fScrollToStart = new Boolean(properties.getProperty(TRANSFER_SCROLL_TO_START, "true"));
|
fScrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString()));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fStartText.setText(properties.getProperty(TRANSFER_START));
|
fStartText.setText(properties.getProperty(TRANSFER_START));
|
||||||
|
@ -150,7 +150,7 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
catch(IllegalArgumentException e)
|
catch(IllegalArgumentException e)
|
||||||
{
|
{
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure", e));
|
DebugException.INTERNAL_ERROR, "Failure", e)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
fileButton.addSelectionListener(new SelectionListener() {
|
fileButton.addSelectionListener(new SelectionListener() {
|
||||||
|
@ -162,9 +162,9 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
||||||
dialog.setText("Choose memory import file");
|
dialog.setText(Messages.getString("PlainTextImporter.ChooseFile")); //$NON-NLS-1$
|
||||||
dialog.setFilterExtensions(new String[] { "*.*;*" } );
|
dialog.setFilterExtensions(new String[] { "*.*;*" } ); //$NON-NLS-1$
|
||||||
dialog.setFilterNames(new String[] { "All Files" } );
|
dialog.setFilterNames(new String[] { Messages.getString("Importer.AllFiles") } ); //$NON-NLS-1$
|
||||||
dialog.setFileName(fFileText.getText());
|
dialog.setFileName(fFileText.getText());
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
});
|
});
|
||||||
|
|
||||||
fScrollToBeginningOnImportComplete = new Button(composite, SWT.CHECK);
|
fScrollToBeginningOnImportComplete = new Button(composite, SWT.CHECK);
|
||||||
fScrollToBeginningOnImportComplete.setText("Scroll to File Start Address");
|
fScrollToBeginningOnImportComplete.setText(Messages.getString("PlainTextImporter.ScrollToStart")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fileButton);
|
data.top = new FormAttachment(fileButton);
|
||||||
fScrollToBeginningOnImportComplete.setLayoutData(data);
|
fScrollToBeginningOnImportComplete.setLayoutData(data);
|
||||||
|
@ -251,7 +251,7 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
public BigInteger getStartAddress()
|
public BigInteger getStartAddress()
|
||||||
{
|
{
|
||||||
String text = fStartText.getText();
|
String text = fStartText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -265,12 +265,12 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
|
|
||||||
public String getId()
|
public String getId()
|
||||||
{
|
{
|
||||||
return "PlainTextImporter";
|
return "PlainTextImporter"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return "Plain Text";
|
return Messages.getString("PlainTextImporter.Name"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void importMemory() {
|
public void importMemory() {
|
||||||
|
@ -293,14 +293,14 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
jobs = jobs.divide(factor);
|
jobs = jobs.divide(factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.beginTask("Transferring Data", jobs.intValue()); //$NON-NLS-1$
|
monitor.beginTask(Messages.getString("Importer.ProgressTitle"), jobs.intValue()); //$NON-NLS-1$
|
||||||
|
|
||||||
BigInteger recordAddress = fStartAddress;
|
BigInteger recordAddress = fStartAddress;
|
||||||
String line = reader.readLine();
|
String line = reader.readLine();
|
||||||
int lineNo = 1; // line error reporting
|
int lineNo = 1; // line error reporting
|
||||||
while(line != null && !monitor.isCanceled())
|
while(line != null && !monitor.isCanceled())
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(line, " ");
|
StringTokenizer st = new StringTokenizer(line, " "); //$NON-NLS-1$
|
||||||
int bytesRead = 0;
|
int bytesRead = 0;
|
||||||
while(st.hasMoreElements())
|
while(st.hasMoreElements())
|
||||||
{
|
{
|
||||||
|
@ -313,7 +313,7 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
data[i] = new BigInteger(valueString.substring(position++, position++ + 1), 16).byteValue();
|
data[i] = new BigInteger(valueString.substring(position++, position++ + 1), 16).byteValue();
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, String.format("Invalid file format. Expected integer at line %d", lineNo ), ex);
|
DebugException.REQUEST_FAILED, String.format(Messages.getString("PlainTextImporter.ErrInvalidFormat"), lineNo ), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,24 +344,24 @@ public class PlainTextImporter implements IMemoryImporter {
|
||||||
reader.close();
|
reader.close();
|
||||||
monitor.done();
|
monitor.done();
|
||||||
|
|
||||||
if(fProperties.getProperty(TRANSFER_SCROLL_TO_START, "false").equals("true"))
|
if(Boolean.parseBoolean(fProperties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.FALSE.toString())))
|
||||||
fParentDialog.scrollRenderings(scrollToAddress);
|
fParentDialog.scrollRenderings(scrollToAddress);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not read from file.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrReadFile"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not read from file.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrReadFile"), ex); //$NON-NLS-1$
|
||||||
|
|
||||||
} catch (DebugException ex) {
|
} catch (DebugException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to target.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrWriteTarget"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to target.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrWriteTarget"), ex); //$NON-NLS-1$
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure importing from file", ex));
|
DebugException.INTERNAL_ERROR, Messages.getString("Importer.FalureImporting"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure importing from file", ex);
|
DebugException.INTERNAL_ERROR, Messages.getString("Importer.FalureImporting"), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}};
|
}};
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
// start address
|
// start address
|
||||||
|
|
||||||
Label startLabel = new Label(composite, SWT.NONE);
|
Label startLabel = new Label(composite, SWT.NONE);
|
||||||
startLabel.setText("Start address: ");
|
startLabel.setText(Messages.getString("RAWBinaryExporter.StartAddress")); //$NON-NLS-1$
|
||||||
FormData data = new FormData();
|
FormData data = new FormData();
|
||||||
startLabel.setLayoutData(data);
|
startLabel.setLayoutData(data);
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
// end address
|
// end address
|
||||||
|
|
||||||
Label endLabel = new Label(composite, SWT.NONE);
|
Label endLabel = new Label(composite, SWT.NONE);
|
||||||
endLabel.setText("End address: ");
|
endLabel.setText(Messages.getString("RAWBinaryExporter.EndAddress")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
||||||
data.left = new FormAttachment(fStartText);
|
data.left = new FormAttachment(fStartText);
|
||||||
|
@ -117,7 +117,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
// length
|
// length
|
||||||
|
|
||||||
Label lengthLabel = new Label(composite, SWT.NONE);
|
Label lengthLabel = new Label(composite, SWT.NONE);
|
||||||
lengthLabel.setText("Length: ");
|
lengthLabel.setText(Messages.getString("RAWBinaryExporter.Length")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
||||||
data.left = new FormAttachment(fEndText);
|
data.left = new FormAttachment(fEndText);
|
||||||
|
@ -136,7 +136,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
fFileText = new Text(composite, SWT.NONE);
|
fFileText = new Text(composite, SWT.NONE);
|
||||||
Button fileButton = new Button(composite, SWT.PUSH);
|
Button fileButton = new Button(composite, SWT.PUSH);
|
||||||
|
|
||||||
fileLabel.setText("File name: ");
|
fileLabel.setText(Messages.getString("Exporter.FileName")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
||||||
fileLabel.setLayoutData(data);
|
fileLabel.setLayoutData(data);
|
||||||
|
@ -147,13 +147,13 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
data.width = 300;
|
data.width = 300;
|
||||||
fFileText.setLayoutData(data);
|
fFileText.setLayoutData(data);
|
||||||
|
|
||||||
fileButton.setText("Browse...");
|
fileButton.setText(Messages.getString("Exporter.Browse")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fLengthText);
|
data.top = new FormAttachment(fLengthText);
|
||||||
data.left = new FormAttachment(fFileText);
|
data.left = new FormAttachment(fFileText);
|
||||||
fileButton.setLayoutData(data);
|
fileButton.setLayoutData(data);
|
||||||
|
|
||||||
fFileText.setText(properties.getProperty(TRANSFER_FILE, ""));
|
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fStartText.setText(properties.getProperty(TRANSFER_START));
|
fStartText.setText(properties.getProperty(TRANSFER_START));
|
||||||
|
@ -163,7 +163,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
catch(IllegalArgumentException e)
|
catch(IllegalArgumentException e)
|
||||||
{
|
{
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure", e));
|
DebugException.INTERNAL_ERROR, "Failure", e)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
fileButton.addSelectionListener(new SelectionListener() {
|
fileButton.addSelectionListener(new SelectionListener() {
|
||||||
|
@ -173,9 +173,9 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
||||||
dialog.setText("Choose memory export file");
|
dialog.setText(Messages.getString("RAWBinaryExporter.ChooseFile")); //$NON-NLS-1$
|
||||||
dialog.setFilterExtensions(new String[] { "*.*;*" } );
|
dialog.setFilterExtensions(new String[] { "*.*;*" } ); //$NON-NLS-1$
|
||||||
dialog.setFilterNames(new String[] { "All Files" } );
|
dialog.setFilterNames(new String[] { Messages.getString("Exporter.AllFiles") } ); //$NON-NLS-1$
|
||||||
dialog.setFileName(fFileText.getText());
|
dialog.setFileName(fFileText.getText());
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
BigInteger length = getLength();
|
BigInteger length = getLength();
|
||||||
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
|
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
|
||||||
BigInteger startAddress = getStartAddress();
|
BigInteger startAddress = getStartAddress();
|
||||||
String endString = "0x" + startAddress.add(length).toString(16);
|
String endString = "0x" + startAddress.add(length).toString(16); //$NON-NLS-1$
|
||||||
if(!fEndText.getText().equals(endString))
|
if(!fEndText.getText().equals(endString))
|
||||||
fEndText.setText(endString);
|
fEndText.setText(endString);
|
||||||
}
|
}
|
||||||
|
@ -305,7 +305,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
public BigInteger getEndAddress()
|
public BigInteger getEndAddress()
|
||||||
{
|
{
|
||||||
String text = fEndText.getText();
|
String text = fEndText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger endAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger endAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
public BigInteger getStartAddress()
|
public BigInteger getStartAddress()
|
||||||
{
|
{
|
||||||
String text = fStartText.getText();
|
String text = fStartText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
public BigInteger getLength()
|
public BigInteger getLength()
|
||||||
{
|
{
|
||||||
String text = fLengthText.getText();
|
String text = fLengthText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger lengthAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger lengthAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -366,12 +366,12 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
|
|
||||||
public String getId()
|
public String getId()
|
||||||
{
|
{
|
||||||
return "rawbinary";
|
return "rawbinary"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return "RAW Binary";
|
return Messages.getString("RAWBinaryExporter.Name"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exportMemory()
|
public void exportMemory()
|
||||||
|
@ -394,7 +394,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
jobs = jobs.divide(factor);
|
jobs = jobs.divide(factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.beginTask("Transferring Data", jobs.intValue());
|
monitor.beginTask(Messages.getString("Exporter.ProgressTitle"), jobs.intValue()); //$NON-NLS-1$
|
||||||
|
|
||||||
BigInteger jobCount = BigInteger.ZERO;
|
BigInteger jobCount = BigInteger.ZERO;
|
||||||
while(transferAddress.compareTo(fEndAddress) < 0 && !monitor.isCanceled())
|
while(transferAddress.compareTo(fEndAddress) < 0 && !monitor.isCanceled())
|
||||||
|
@ -403,7 +403,7 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
if(fEndAddress.subtract(transferAddress).compareTo(length) < 0)
|
if(fEndAddress.subtract(transferAddress).compareTo(length) < 0)
|
||||||
length = fEndAddress.subtract(transferAddress);
|
length = fEndAddress.subtract(transferAddress);
|
||||||
|
|
||||||
monitor.subTask(String.format("Transfering %s bytes at address 0x%s", length.toString(10), transferAddress.toString(16)));
|
monitor.subTask(String.format(Messages.getString("Exporter.Progress"), length.toString(10), transferAddress.toString(16))); //$NON-NLS-1$
|
||||||
|
|
||||||
// data
|
// data
|
||||||
byte[] byteValues = new byte[length.intValue()];
|
byte[] byteValues = new byte[length.intValue()];
|
||||||
|
@ -432,20 +432,20 @@ public class RAWBinaryExporter implements IMemoryExporter
|
||||||
monitor.done();
|
monitor.done();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to file.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrFile"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to file.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrFile"), ex); //$NON-NLS-1$
|
||||||
|
|
||||||
} catch (DebugException ex) {
|
} catch (DebugException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not read from target.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrReadTarget"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not read from target.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrReadTarget"), ex); //$NON-NLS-1$
|
||||||
} catch (Exception e) {
|
} catch (Exception ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure exporting memory", e));
|
DebugException.INTERNAL_ERROR, Messages.getString("Exporter.Falure"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure exporting memory", e);
|
DebugException.INTERNAL_ERROR, Messages.getString("Exporter.Falure"), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}};
|
}};
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
||||||
// restore to this address
|
// restore to this address
|
||||||
|
|
||||||
Label labelStartText = new Label(composite, SWT.NONE);
|
Label labelStartText = new Label(composite, SWT.NONE);
|
||||||
labelStartText.setText("Restore to address: ");
|
labelStartText.setText(Messages.getString("RAWBinaryImporter.RestoreAddress")); //$NON-NLS-1$
|
||||||
|
|
||||||
fStartText = new Text(composite, SWT.NONE);
|
fStartText = new Text(composite, SWT.NONE);
|
||||||
FormData data = new FormData();
|
FormData data = new FormData();
|
||||||
|
@ -101,7 +101,7 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
||||||
fFileText = new Text(composite, SWT.NONE);
|
fFileText = new Text(composite, SWT.NONE);
|
||||||
Button fileButton = new Button(composite, SWT.PUSH);
|
Button fileButton = new Button(composite, SWT.PUSH);
|
||||||
|
|
||||||
fileLabel.setText("File name: ");
|
fileLabel.setText(Messages.getString("Importer.File")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
||||||
fileLabel.setLayoutData(data);
|
fileLabel.setLayoutData(data);
|
||||||
|
@ -112,14 +112,14 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
||||||
data.width = 300;
|
data.width = 300;
|
||||||
fFileText.setLayoutData(data);
|
fFileText.setLayoutData(data);
|
||||||
|
|
||||||
fileButton.setText("Browse...");
|
fileButton.setText(Messages.getString("Importer.Browse")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fStartText);
|
data.top = new FormAttachment(fStartText);
|
||||||
data.left = new FormAttachment(fFileText);
|
data.left = new FormAttachment(fFileText);
|
||||||
fileButton.setLayoutData(data);
|
fileButton.setLayoutData(data);
|
||||||
|
|
||||||
fFileText.setText(properties.getProperty(TRANSFER_FILE, ""));
|
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
|
||||||
fScrollToStart = new Boolean(properties.getProperty(TRANSFER_SCROLL_TO_START, "true"));
|
fScrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString()));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fStartText.setText(properties.getProperty(TRANSFER_START));
|
fStartText.setText(properties.getProperty(TRANSFER_START));
|
||||||
|
@ -127,7 +127,7 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
||||||
catch(IllegalArgumentException e)
|
catch(IllegalArgumentException e)
|
||||||
{
|
{
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure", e));
|
DebugException.INTERNAL_ERROR, "Failure", e)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
fileButton.addSelectionListener(new SelectionListener() {
|
fileButton.addSelectionListener(new SelectionListener() {
|
||||||
|
@ -137,9 +137,9 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
||||||
dialog.setText("Choose memory import file");
|
dialog.setText(Messages.getString("RAWBinaryImporter.ChooseFile")); //$NON-NLS-1$
|
||||||
dialog.setFilterExtensions(new String[] { "*.*;*" } );
|
dialog.setFilterExtensions(new String[] { "*.*;*" } ); //$NON-NLS-1$
|
||||||
dialog.setFilterNames(new String[] { "All Files" } );
|
dialog.setFilterNames(new String[] { Messages.getString("Importer.AllFiles") } ); //$NON-NLS-1$
|
||||||
dialog.setFileName(fFileText.getText());
|
dialog.setFileName(fFileText.getText());
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
||||||
});
|
});
|
||||||
|
|
||||||
fScrollToBeginningOnImportComplete = new Button(composite, SWT.CHECK);
|
fScrollToBeginningOnImportComplete = new Button(composite, SWT.CHECK);
|
||||||
fScrollToBeginningOnImportComplete.setText("Scroll to File Start Address");
|
fScrollToBeginningOnImportComplete.setText(Messages.getString("RAWBinaryImporter.ScrollToStart")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fileButton);
|
data.top = new FormAttachment(fileButton);
|
||||||
fScrollToBeginningOnImportComplete.setLayoutData(data);
|
fScrollToBeginningOnImportComplete.setLayoutData(data);
|
||||||
|
@ -226,7 +226,7 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
||||||
public BigInteger getStartAddress()
|
public BigInteger getStartAddress()
|
||||||
{
|
{
|
||||||
String text = fStartText.getText();
|
String text = fStartText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -240,12 +240,12 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
||||||
|
|
||||||
public String getId()
|
public String getId()
|
||||||
{
|
{
|
||||||
return "rawbinary";
|
return "rawbinary"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return "RAW Binary";
|
return Messages.getString("RAWBinaryImporter.Name"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void importMemory() {
|
public void importMemory() {
|
||||||
|
@ -270,7 +270,7 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
||||||
|
|
||||||
byte[] byteValues = new byte[1024];
|
byte[] byteValues = new byte[1024];
|
||||||
|
|
||||||
monitor.beginTask("Transferring Data", jobs.intValue()); //$NON-NLS-1$
|
monitor.beginTask(Messages.getString("Importer.ProgressTitle"), jobs.intValue()); //$NON-NLS-1$
|
||||||
|
|
||||||
int actualByteCount = reader.read(byteValues);
|
int actualByteCount = reader.read(byteValues);
|
||||||
BigInteger recordAddress = fStartAddress;
|
BigInteger recordAddress = fStartAddress;
|
||||||
|
@ -307,24 +307,25 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
||||||
reader.close();
|
reader.close();
|
||||||
monitor.done();
|
monitor.done();
|
||||||
|
|
||||||
if(fProperties.getProperty(TRANSFER_SCROLL_TO_START, "false").equals("true"))
|
if(Boolean.parseBoolean(fProperties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.FALSE.toString())))
|
||||||
fParentDialog.scrollRenderings(scrollToAddress);
|
fParentDialog.scrollRenderings(scrollToAddress);
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not read from file.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrReadFile"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not read from file.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrReadFile"), ex); //$NON-NLS-1$
|
||||||
|
|
||||||
} catch (DebugException ex) {
|
} catch (DebugException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to target.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrWriteTarget"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to target.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrWriteTarget"), ex); //$NON-NLS-1$
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure importing from file", ex));
|
DebugException.INTERNAL_ERROR, Messages.getString("Importer.FalureImporting"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure importing from file", ex);
|
DebugException.INTERNAL_ERROR, Messages.getString("Importer.FalureImporting"), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}};
|
}};
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
// start address
|
// start address
|
||||||
|
|
||||||
Label startLabel = new Label(composite, SWT.NONE);
|
Label startLabel = new Label(composite, SWT.NONE);
|
||||||
startLabel.setText("Start address: ");
|
startLabel.setText(Messages.getString("SRecordExporter.StartAddress")); //$NON-NLS-1$
|
||||||
FormData data = new FormData();
|
FormData data = new FormData();
|
||||||
startLabel.setLayoutData(data);
|
startLabel.setLayoutData(data);
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
// end address
|
// end address
|
||||||
|
|
||||||
Label endLabel = new Label(composite, SWT.NONE);
|
Label endLabel = new Label(composite, SWT.NONE);
|
||||||
endLabel.setText("End address: ");
|
endLabel.setText(Messages.getString("SRecordExporter.EndAddress")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
||||||
data.left = new FormAttachment(fStartText);
|
data.left = new FormAttachment(fStartText);
|
||||||
|
@ -117,7 +117,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
// length
|
// length
|
||||||
|
|
||||||
Label lengthLabel = new Label(composite, SWT.NONE);
|
Label lengthLabel = new Label(composite, SWT.NONE);
|
||||||
lengthLabel.setText("Length: ");
|
lengthLabel.setText(Messages.getString("SRecordExporter.Length")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
data.top = new FormAttachment(fStartText, 0, SWT.CENTER);
|
||||||
data.left = new FormAttachment(fEndText);
|
data.left = new FormAttachment(fEndText);
|
||||||
|
@ -136,7 +136,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
fFileText = new Text(composite, SWT.NONE);
|
fFileText = new Text(composite, SWT.NONE);
|
||||||
Button fileButton = new Button(composite, SWT.PUSH);
|
Button fileButton = new Button(composite, SWT.PUSH);
|
||||||
|
|
||||||
fileLabel.setText("File name: ");
|
fileLabel.setText(Messages.getString("Exporter.FileName")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
||||||
fileLabel.setLayoutData(data);
|
fileLabel.setLayoutData(data);
|
||||||
|
@ -147,13 +147,13 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
data.width = 300;
|
data.width = 300;
|
||||||
fFileText.setLayoutData(data);
|
fFileText.setLayoutData(data);
|
||||||
|
|
||||||
fileButton.setText("Browse...");
|
fileButton.setText(Messages.getString("Exporter.Browse")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fLengthText);
|
data.top = new FormAttachment(fLengthText);
|
||||||
data.left = new FormAttachment(fFileText);
|
data.left = new FormAttachment(fFileText);
|
||||||
fileButton.setLayoutData(data);
|
fileButton.setLayoutData(data);
|
||||||
|
|
||||||
fFileText.setText(properties.getProperty(TRANSFER_FILE, ""));
|
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fStartText.setText(properties.getProperty(TRANSFER_START));
|
fStartText.setText(properties.getProperty(TRANSFER_START));
|
||||||
|
@ -163,7 +163,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
catch(IllegalArgumentException e)
|
catch(IllegalArgumentException e)
|
||||||
{
|
{
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure", e));
|
DebugException.INTERNAL_ERROR, "Failure", e)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
fileButton.addSelectionListener(new SelectionListener() {
|
fileButton.addSelectionListener(new SelectionListener() {
|
||||||
|
@ -175,9 +175,9 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
||||||
dialog.setText("Choose memory export file");
|
dialog.setText(Messages.getString("SRecordExporter.ChooseFile")); //$NON-NLS-1$
|
||||||
dialog.setFilterExtensions(new String[] { "*.*;*" } );
|
dialog.setFilterExtensions(new String[] { "*.*;*" } ); //$NON-NLS-1$
|
||||||
dialog.setFilterNames(new String[] { "All Files" } );
|
dialog.setFilterNames(new String[] { Messages.getString("Exporter.AllFiles") } ); //$NON-NLS-1$
|
||||||
dialog.setFileName(fFileText.getText());
|
dialog.setFileName(fFileText.getText());
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
BigInteger length = getLength();
|
BigInteger length = getLength();
|
||||||
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
|
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
|
||||||
BigInteger startAddress = getStartAddress();
|
BigInteger startAddress = getStartAddress();
|
||||||
String endString = "0x" + startAddress.add(length).toString(16);
|
String endString = "0x" + startAddress.add(length).toString(16); //$NON-NLS-1$
|
||||||
if(!fEndText.getText().equals(endString))
|
if(!fEndText.getText().equals(endString))
|
||||||
fEndText.setText(endString);
|
fEndText.setText(endString);
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
public BigInteger getEndAddress()
|
public BigInteger getEndAddress()
|
||||||
{
|
{
|
||||||
String text = fEndText.getText();
|
String text = fEndText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger endAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger endAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
public BigInteger getStartAddress()
|
public BigInteger getStartAddress()
|
||||||
{
|
{
|
||||||
String text = fStartText.getText();
|
String text = fStartText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
public BigInteger getLength()
|
public BigInteger getLength()
|
||||||
{
|
{
|
||||||
String text = fLengthText.getText();
|
String text = fLengthText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger lengthAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger lengthAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -368,12 +368,12 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
|
|
||||||
public String getId()
|
public String getId()
|
||||||
{
|
{
|
||||||
return "srecord";
|
return "srecord"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return "SRecord";
|
return Messages.getString("SRecordExporter.Name"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exportMemory()
|
public void exportMemory()
|
||||||
|
@ -398,7 +398,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
jobs = jobs.divide(factor);
|
jobs = jobs.divide(factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.beginTask("Transferring Data", jobs.intValue());
|
monitor.beginTask(Messages.getString("Exporter.ProgressTitle"), jobs.intValue()); //$NON-NLS-1$
|
||||||
|
|
||||||
BigInteger jobCount = BigInteger.ZERO;
|
BigInteger jobCount = BigInteger.ZERO;
|
||||||
while(transferAddress.compareTo(fEndAddress) < 0 && !monitor.isCanceled())
|
while(transferAddress.compareTo(fEndAddress) < 0 && !monitor.isCanceled())
|
||||||
|
@ -407,9 +407,9 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
if(fEndAddress.subtract(transferAddress).compareTo(length) < 0)
|
if(fEndAddress.subtract(transferAddress).compareTo(length) < 0)
|
||||||
length = fEndAddress.subtract(transferAddress);
|
length = fEndAddress.subtract(transferAddress);
|
||||||
|
|
||||||
monitor.subTask(String.format("Transfering %s bytes at address 0x%s", length.toString(10), transferAddress.toString(16)));
|
monitor.subTask(String.format(Messages.getString("Exporter.Progress"), length.toString(10), transferAddress.toString(16))); //$NON-NLS-1$
|
||||||
|
|
||||||
writer.write("S3"); // FIXME 4 byte address
|
writer.write("S3"); // FIXME 4 byte address //$NON-NLS-1$
|
||||||
|
|
||||||
StringBuffer buf = new StringBuffer();
|
StringBuffer buf = new StringBuffer();
|
||||||
|
|
||||||
|
@ -421,10 +421,10 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
|
|
||||||
String lengthString = sRecordLength.toString(16);
|
String lengthString = sRecordLength.toString(16);
|
||||||
if(lengthString.length() == 1)
|
if(lengthString.length() == 1)
|
||||||
buf.append("0");
|
buf.append("0"); //$NON-NLS-1$
|
||||||
buf.append(lengthString);
|
buf.append(lengthString);
|
||||||
for(int i = 0; i < 8 - transferAddressString.length(); i++)
|
for(int i = 0; i < 8 - transferAddressString.length(); i++)
|
||||||
buf.append("0");
|
buf.append("0"); //$NON-NLS-1$
|
||||||
buf.append(transferAddressString);
|
buf.append(transferAddressString);
|
||||||
|
|
||||||
// data
|
// data
|
||||||
|
@ -435,7 +435,7 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
{
|
{
|
||||||
String bString = BigInteger.valueOf(0xFF & bytes[byteIndex].getValue()).toString(16);
|
String bString = BigInteger.valueOf(0xFF & bytes[byteIndex].getValue()).toString(16);
|
||||||
if(bString.length() == 1)
|
if(bString.length() == 1)
|
||||||
buf.append("0");
|
buf.append("0"); //$NON-NLS-1$
|
||||||
buf.append(bString);
|
buf.append(bString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,11 +454,11 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
|
|
||||||
String bString = BigInteger.valueOf(0xFF - checksum).and(BigInteger.valueOf(0xFF)).toString(16);
|
String bString = BigInteger.valueOf(0xFF - checksum).and(BigInteger.valueOf(0xFF)).toString(16);
|
||||||
if(bString.length() == 1)
|
if(bString.length() == 1)
|
||||||
buf.append("0");
|
buf.append("0"); //$NON-NLS-1$
|
||||||
buf.append(bString);
|
buf.append(bString);
|
||||||
|
|
||||||
writer.write(buf.toString().toUpperCase());
|
writer.write(buf.toString().toUpperCase());
|
||||||
writer.write("\n");
|
writer.write("\n"); //$NON-NLS-1$
|
||||||
|
|
||||||
transferAddress = transferAddress.add(length);
|
transferAddress = transferAddress.add(length);
|
||||||
|
|
||||||
|
@ -474,20 +474,20 @@ public class SRecordExporter implements IMemoryExporter
|
||||||
monitor.done();
|
monitor.done();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to file.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrFile"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to file.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrFile"), ex); //$NON-NLS-1$
|
||||||
|
|
||||||
} catch (DebugException ex) {
|
} catch (DebugException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not read from target.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrReadTarget"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not read from target.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Exporter.ErrReadTarget"), ex); //$NON-NLS-1$
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure exporting memory", ex));
|
DebugException.INTERNAL_ERROR, Messages.getString("Exporter.Falure"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure exporting memory", ex);
|
DebugException.INTERNAL_ERROR, Messages.getString("Exporter.Falure"), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}};
|
}};
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
fProperties.setProperty(TRANSFER_FILE, fFileText.getText());
|
fProperties.setProperty(TRANSFER_FILE, fFileText.getText());
|
||||||
fProperties.setProperty(TRANSFER_START, fStartText.getText());
|
fProperties.setProperty(TRANSFER_START, fStartText.getText());
|
||||||
fProperties.setProperty(TRANSFER_SCROLL_TO_START, fScrollToStart.toString());
|
fProperties.setProperty(TRANSFER_SCROLL_TO_START, fScrollToStart.toString());
|
||||||
fProperties.setProperty(TRANSFER_CUSTOM_START_ADDRESS, "" + fComboRestoreToThisAddress.getSelection());
|
fProperties.setProperty(TRANSFER_CUSTOM_START_ADDRESS, "" + fComboRestoreToThisAddress.getSelection()); //$NON-NLS-1$
|
||||||
|
|
||||||
fStartAddress = getStartAddress();
|
fStartAddress = getStartAddress();
|
||||||
fInputFile = getFile();
|
fInputFile = getFile();
|
||||||
|
@ -95,15 +95,15 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
|
|
||||||
fComboRestoreToFileAddress = new Button(composite, SWT.RADIO);
|
fComboRestoreToFileAddress = new Button(composite, SWT.RADIO);
|
||||||
fComboRestoreToFileAddress.setSelection(true);
|
fComboRestoreToFileAddress.setSelection(true);
|
||||||
fComboRestoreToFileAddress.setText("Restore to address specified in the file");
|
fComboRestoreToFileAddress.setText(Messages.getString("SRecordImporter.FileAddressRestore")); //$NON-NLS-1$
|
||||||
fComboRestoreToFileAddress.setSelection(!new Boolean(properties.getProperty(TRANSFER_CUSTOM_START_ADDRESS, "false")).booleanValue());
|
fComboRestoreToFileAddress.setSelection(!Boolean.getBoolean(properties.getProperty(TRANSFER_CUSTOM_START_ADDRESS, Boolean.FALSE.toString())));
|
||||||
//comboRestoreToFileAddress.setLayoutData(data);
|
//comboRestoreToFileAddress.setLayoutData(data);
|
||||||
|
|
||||||
// restore to this address
|
// restore to this address
|
||||||
|
|
||||||
fComboRestoreToThisAddress = new Button(composite, SWT.RADIO);
|
fComboRestoreToThisAddress = new Button(composite, SWT.RADIO);
|
||||||
fComboRestoreToThisAddress.setText("Restore to this address: ");
|
fComboRestoreToThisAddress.setText(Messages.getString("SRecordImporter.CustomAddressRestore")); //$NON-NLS-1$
|
||||||
fComboRestoreToThisAddress.setSelection(new Boolean(properties.getProperty(TRANSFER_CUSTOM_START_ADDRESS, "false")).booleanValue());
|
fComboRestoreToThisAddress.setSelection(Boolean.parseBoolean(properties.getProperty(TRANSFER_CUSTOM_START_ADDRESS, Boolean.FALSE.toString())));
|
||||||
FormData data = new FormData();
|
FormData data = new FormData();
|
||||||
data.top = new FormAttachment(fComboRestoreToFileAddress);
|
data.top = new FormAttachment(fComboRestoreToFileAddress);
|
||||||
fComboRestoreToThisAddress.setLayoutData(data);
|
fComboRestoreToThisAddress.setLayoutData(data);
|
||||||
|
@ -139,7 +139,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
fFileText = new Text(composite, SWT.NONE);
|
fFileText = new Text(composite, SWT.NONE);
|
||||||
Button fileButton = new Button(composite, SWT.PUSH);
|
Button fileButton = new Button(composite, SWT.PUSH);
|
||||||
|
|
||||||
fileLabel.setText("File name: ");
|
fileLabel.setText(Messages.getString("Importer.File")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
data.top = new FormAttachment(fileButton, 0, SWT.CENTER);
|
||||||
fileLabel.setLayoutData(data);
|
fileLabel.setLayoutData(data);
|
||||||
|
@ -150,14 +150,14 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
data.width = 300;
|
data.width = 300;
|
||||||
fFileText.setLayoutData(data);
|
fFileText.setLayoutData(data);
|
||||||
|
|
||||||
fileButton.setText("Browse...");
|
fileButton.setText(Messages.getString("Importer.Browse")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fStartText);
|
data.top = new FormAttachment(fStartText);
|
||||||
data.left = new FormAttachment(fFileText);
|
data.left = new FormAttachment(fFileText);
|
||||||
fileButton.setLayoutData(data);
|
fileButton.setLayoutData(data);
|
||||||
|
|
||||||
fFileText.setText(properties.getProperty(TRANSFER_FILE, ""));
|
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
|
||||||
fScrollToStart = new Boolean(properties.getProperty(TRANSFER_SCROLL_TO_START, "true"));
|
fScrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString()));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fStartText.setText(properties.getProperty(TRANSFER_START));
|
fStartText.setText(properties.getProperty(TRANSFER_START));
|
||||||
|
@ -165,7 +165,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
catch(IllegalArgumentException e)
|
catch(IllegalArgumentException e)
|
||||||
{
|
{
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure", e));
|
DebugException.INTERNAL_ERROR, "Failure", e)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
fileButton.addSelectionListener(new SelectionListener() {
|
fileButton.addSelectionListener(new SelectionListener() {
|
||||||
|
@ -177,9 +177,9 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE);
|
||||||
dialog.setText("Choose memory import file");
|
dialog.setText(Messages.getString("SRecordImporter.ChooseFile")); //$NON-NLS-1$
|
||||||
dialog.setFilterExtensions(new String[] { "*.*;*" } );
|
dialog.setFilterExtensions(new String[] { "*.*;*" } ); //$NON-NLS-1$
|
||||||
dialog.setFilterNames(new String[] { "All Files" } );
|
dialog.setFilterNames(new String[] { Messages.getString("Importer.AllFiles") } ); //$NON-NLS-1$
|
||||||
dialog.setFileName(fFileText.getText());
|
dialog.setFileName(fFileText.getText());
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
});
|
});
|
||||||
|
|
||||||
fScrollToBeginningOnImportComplete = new Button(composite, SWT.CHECK);
|
fScrollToBeginningOnImportComplete = new Button(composite, SWT.CHECK);
|
||||||
fScrollToBeginningOnImportComplete.setText("Scroll to File Start Address");
|
fScrollToBeginningOnImportComplete.setText(Messages.getString("SRecordImporter.ScrollToStart")); //$NON-NLS-1$
|
||||||
data = new FormData();
|
data = new FormData();
|
||||||
data.top = new FormAttachment(fileButton);
|
data.top = new FormAttachment(fileButton);
|
||||||
fScrollToBeginningOnImportComplete.setLayoutData(data);
|
fScrollToBeginningOnImportComplete.setLayoutData(data);
|
||||||
|
@ -274,7 +274,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
public BigInteger getStartAddress()
|
public BigInteger getStartAddress()
|
||||||
{
|
{
|
||||||
String text = fStartText.getText();
|
String text = fStartText.getText();
|
||||||
boolean hex = text.startsWith("0x");
|
boolean hex = text.startsWith("0x"); //$NON-NLS-1$
|
||||||
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
BigInteger startAddress = new BigInteger(hex ? text.substring(2) : text,
|
||||||
hex ? 16 : 10);
|
hex ? 16 : 10);
|
||||||
|
|
||||||
|
@ -288,12 +288,12 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
|
|
||||||
public String getId()
|
public String getId()
|
||||||
{
|
{
|
||||||
return "srecord";
|
return "srecord"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return "SRecord";
|
return Messages.getString("SRecordImporter.Name"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void importMemory() {
|
public void importMemory() {
|
||||||
|
@ -312,7 +312,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
BigInteger scrollToAddress = null;
|
BigInteger scrollToAddress = null;
|
||||||
|
|
||||||
BigInteger offset = null;
|
BigInteger offset = null;
|
||||||
if(!fProperties.getProperty(TRANSFER_CUSTOM_START_ADDRESS, "false").equals("true"))
|
if(!Boolean.parseBoolean(fProperties.getProperty(TRANSFER_CUSTOM_START_ADDRESS, Boolean.FALSE.toString())))
|
||||||
offset = BigInteger.ZERO;
|
offset = BigInteger.ZERO;
|
||||||
|
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(fInputFile)));
|
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(fInputFile)));
|
||||||
|
@ -325,7 +325,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
jobs = jobs.divide(factor);
|
jobs = jobs.divide(factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.beginTask("Transferring Data", jobs.intValue()); //$NON-NLS-1$
|
monitor.beginTask(Messages.getString("Importer.ProgressTitle"), jobs.intValue()); //$NON-NLS-1$
|
||||||
|
|
||||||
String line = reader.readLine();
|
String line = reader.readLine();
|
||||||
int lineNo = 1; // line error reporting
|
int lineNo = 1; // line error reporting
|
||||||
|
@ -337,7 +337,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
recordCount = Integer.parseInt(line.substring(2, 4), 16);
|
recordCount = Integer.parseInt(line.substring(2, 4), 16);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, String.format("Invalid file format. Invalid line length at line %d", lineNo ), ex);
|
DebugException.REQUEST_FAILED, String.format(Messages.getString("SRecordImporter.InvalidLineLength"), lineNo ), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
int bytesRead = 4 + recordCount;
|
int bytesRead = 4 + recordCount;
|
||||||
|
@ -346,18 +346,18 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
|
|
||||||
BigInteger recordAddress = null;
|
BigInteger recordAddress = null;
|
||||||
|
|
||||||
if("S3".equals(recordType)) //$NON-NLS-1$
|
if("S3".equals(recordType)) //$NON-NLS-1$
|
||||||
addressSize = 4;
|
addressSize = 4;
|
||||||
else if("S1".equals(recordType)) //$NON-NLS-1$
|
else if("S1".equals(recordType)) //$NON-NLS-1$
|
||||||
addressSize = 2;
|
addressSize = 2;
|
||||||
else if("S2".equals(recordType)) //$NON-NLS-1$
|
else if("S2".equals(recordType)) //$NON-NLS-1$
|
||||||
addressSize = 3;
|
addressSize = 3;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
recordAddress = new BigInteger(line.substring(position, position + addressSize * 2), 16);
|
recordAddress = new BigInteger(line.substring(position, position + addressSize * 2), 16);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, String.format("Invalid file format. Invalid address at line %d", lineNo ), ex);
|
DebugException.REQUEST_FAILED, String.format(Messages.getString("SRecordImporter.InvalidAddress"), lineNo ), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
recordCount -= addressSize;
|
recordCount -= addressSize;
|
||||||
position += addressSize * 2;
|
position += addressSize * 2;
|
||||||
|
@ -374,7 +374,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
data[i] = new BigInteger(line.substring(position++, position++ + 1), 16).byteValue();
|
data[i] = new BigInteger(line.substring(position++, position++ + 1), 16).byteValue();
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, String.format("Invalid file format. Invalid data at line %d", lineNo ), ex);
|
DebugException.REQUEST_FAILED, String.format(Messages.getString("SRecordImporter.InvalidData"), lineNo ), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
value = new BigInteger(buf.substring(i, i+2), 16);
|
value = new BigInteger(buf.substring(i, i+2), 16);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, String.format("Invalid file format. Invalid checksum format at line %d", lineNo ), ex);
|
DebugException.REQUEST_FAILED, String.format(Messages.getString("SRecordImporter.InvalidChecksum"), lineNo ), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
checksum += value.byteValue();
|
checksum += value.byteValue();
|
||||||
}
|
}
|
||||||
|
@ -406,7 +406,7 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
if ( checksum != (byte) -1 ) {
|
if ( checksum != (byte) -1 ) {
|
||||||
reader.close();
|
reader.close();
|
||||||
monitor.done();
|
monitor.done();
|
||||||
return new Status( IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(), "Checksum failure of line = " + line); //$NON-NLS-1$
|
return new Status( IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(), Messages.getString("SRecordImporter.ChecksumFalure") + line); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
if(scrollToAddress == null)
|
if(scrollToAddress == null)
|
||||||
|
@ -429,24 +429,25 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
reader.close();
|
reader.close();
|
||||||
monitor.done();
|
monitor.done();
|
||||||
|
|
||||||
if(fProperties.getProperty(TRANSFER_SCROLL_TO_START, "false").equals("true"))
|
if(Boolean.parseBoolean(fProperties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.FALSE.toString())))
|
||||||
fParentDialog.scrollRenderings(scrollToAddress);
|
fParentDialog.scrollRenderings(scrollToAddress);
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not read from file.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrReadFile"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not read from file.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrReadFile"), ex); //$NON-NLS-1$
|
||||||
|
|
||||||
} catch (DebugException ex) {
|
} catch (DebugException ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to target.", ex));
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrWriteTarget"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.REQUEST_FAILED, "Could not write to target.", ex);
|
DebugException.REQUEST_FAILED, Messages.getString("Importer.ErrWriteTarget"), ex); //$NON-NLS-1$
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure importing from file", ex));
|
DebugException.INTERNAL_ERROR, Messages.getString("Importer.FalureImporting"), ex)); //$NON-NLS-1$
|
||||||
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
return new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||||
DebugException.INTERNAL_ERROR, "Failure importing from file", ex);
|
DebugException.INTERNAL_ERROR, Messages.getString("Importer.FalureImporting"), ex); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}};
|
}};
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
###############################################################################
|
||||||
|
# Copyright (c) 2009 Wind River 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:
|
||||||
|
# Ted R Williams (Wind River) - initial API and implementation
|
||||||
|
# Teodor Madan (Freescale) -
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
ExportMemoryDialog.Format=Format:
|
||||||
|
ExportMemoryDialog.Title=Export Memory
|
||||||
|
|
||||||
|
ImportMemoryDialog.Format=Format:
|
||||||
|
ImportMemoryDialog.Title=Download to Memory
|
||||||
|
|
||||||
|
Exporter.AllFiles=All Files
|
||||||
|
Exporter.Browse=Browse...
|
||||||
|
Exporter.ErrFile=Could not write to file.
|
||||||
|
Exporter.ErrReadTarget=Could not read from target.
|
||||||
|
Exporter.Falure=Failure exporting memory
|
||||||
|
Exporter.FileName=File name:
|
||||||
|
Exporter.Progress=Transferring %s bytes at address 0x%s
|
||||||
|
Exporter.ProgressTitle=Transferring Data
|
||||||
|
|
||||||
|
Importer.AllFiles=All Files
|
||||||
|
Importer.Browse=Browse...
|
||||||
|
Importer.ErrReadFile=Could not read from file.
|
||||||
|
Importer.ErrWriteTarget=Could not write to target.
|
||||||
|
Importer.FalureImporting=Failure importing from file
|
||||||
|
Importer.File=File name:
|
||||||
|
Importer.ProgressTitle=Transferring Data
|
||||||
|
|
||||||
|
PlainTextExporter.ChooseFile=Choose memory export file
|
||||||
|
PlainTextExporter.EndAddress=End address:
|
||||||
|
PlainTextExporter.Length=Length:
|
||||||
|
PlainTextExporter.Name=Plain Text
|
||||||
|
PlainTextExporter.StartAddress=Start address:
|
||||||
|
|
||||||
|
PlainTextImporter.ChooseFile=Choose memory import file
|
||||||
|
PlainTextImporter.ErrInvalidFormat=Invalid file format. Expected integer at line %d
|
||||||
|
PlainTextImporter.Name=Plain Text
|
||||||
|
PlainTextImporter.RestoreAddress=Restore to address:
|
||||||
|
PlainTextImporter.ScrollToStart=Scroll to File Start Address
|
||||||
|
|
||||||
|
SRecordExporter.ChooseFile=Choose memory export file
|
||||||
|
SRecordExporter.EndAddress=End address:
|
||||||
|
SRecordExporter.Length=Length:
|
||||||
|
SRecordExporter.Name=SRecord
|
||||||
|
SRecordExporter.StartAddress=Start address:
|
||||||
|
|
||||||
|
SRecordImporter.ChecksumFalure=Checksum failure of line =
|
||||||
|
SRecordImporter.ChooseFile=Choose memory import file
|
||||||
|
SRecordImporter.CustomAddressRestore=Restore to this address:
|
||||||
|
SRecordImporter.FileAddressRestore=Restore to address specified in the file
|
||||||
|
SRecordImporter.InvalidAddress=Invalid file format. Invalid address at line %d
|
||||||
|
SRecordImporter.InvalidChecksum=Invalid file format. Invalid checksum format at line %d
|
||||||
|
SRecordImporter.InvalidData=Invalid file format. Invalid data at line %d
|
||||||
|
SRecordImporter.InvalidLineLength=Invalid file format. Invalid line length at line %d
|
||||||
|
SRecordImporter.Name=SRecord
|
||||||
|
SRecordImporter.ScrollToStart=Scroll to File Start Address
|
||||||
|
|
||||||
|
RAWBinaryExporter.ChooseFile=Choose memory export file
|
||||||
|
RAWBinaryExporter.EndAddress=End address:
|
||||||
|
RAWBinaryExporter.Length=Length:
|
||||||
|
RAWBinaryExporter.Name=RAW Binary
|
||||||
|
RAWBinaryExporter.StartAddress=Start address:
|
||||||
|
|
||||||
|
RAWBinaryImporter.ChooseFile=Choose memory import file
|
||||||
|
RAWBinaryImporter.Name=RAW Binary
|
||||||
|
RAWBinaryImporter.RestoreAddress=Restore to address:
|
||||||
|
RAWBinaryImporter.ScrollToStart=Scroll to File Start Address
|
|
@ -20,9 +20,9 @@ import org.eclipse.swt.widgets.Control;
|
||||||
|
|
||||||
public interface IMemoryExporter
|
public interface IMemoryExporter
|
||||||
{
|
{
|
||||||
public static final String TRANSFER_FILE = "File";
|
public static final String TRANSFER_FILE = "File"; //$NON-NLS-1$
|
||||||
public static final String TRANSFER_START = "Start";
|
public static final String TRANSFER_START = "Start"; //$NON-NLS-1$
|
||||||
public static final String TRANSFER_END = "End";
|
public static final String TRANSFER_END = "End"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parent
|
* @param parent
|
||||||
|
|
|
@ -20,10 +20,10 @@ import org.eclipse.swt.widgets.Control;
|
||||||
|
|
||||||
public interface IMemoryImporter
|
public interface IMemoryImporter
|
||||||
{
|
{
|
||||||
public static final String TRANSFER_FILE = "File";
|
public static final String TRANSFER_FILE = "File"; //$NON-NLS-1$
|
||||||
public static final String TRANSFER_START = "Start";
|
public static final String TRANSFER_START = "Start"; //$NON-NLS-1$
|
||||||
public static final String TRANSFER_CUSTOM_START_ADDRESS = "CustomStartAddress";
|
public static final String TRANSFER_CUSTOM_START_ADDRESS = "CustomStartAddress"; //$NON-NLS-1$
|
||||||
public static final String TRANSFER_SCROLL_TO_START = "ScrollToStart";
|
public static final String TRANSFER_SCROLL_TO_START = "ScrollToStart"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parent
|
* @param parent
|
||||||
|
|
Loading…
Add table
Reference in a new issue