1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00

[297085] "Scroll to File Start Address" checkbox has no effect. Additionally, the scrolling logic does not support Memory Browser or Traditional Rendering.

This commit is contained in:
John Cortell 2009-12-07 22:02:41 +00:00
parent 2bb959feda
commit cd837027a9
5 changed files with 30 additions and 35 deletions

View file

@ -12,6 +12,7 @@
package org.eclipse.cdt.debug.ui.memory.transport; package org.eclipse.cdt.debug.ui.memory.transport;
import java.math.BigInteger; import java.math.BigInteger;
import java.text.MessageFormat;
import java.util.Properties; import java.util.Properties;
import java.util.Vector; import java.util.Vector;
@ -25,7 +26,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IMemoryBlock; import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.internal.ui.views.memory.RenderingViewPane;
import org.eclipse.debug.ui.memory.IMemoryRendering; import org.eclipse.debug.ui.memory.IMemoryRendering;
import org.eclipse.debug.ui.memory.IMemoryRenderingContainer; import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
import org.eclipse.debug.ui.memory.IMemoryRenderingSite; import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
@ -47,7 +47,6 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.SelectionDialog; import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.ui.progress.UIJob; import org.eclipse.ui.progress.UIJob;
@SuppressWarnings("restriction")
public class ImportMemoryDialog extends SelectionDialog public class ImportMemoryDialog extends SelectionDialog
{ {
@ -81,23 +80,15 @@ public class ImportMemoryDialog extends SelectionDialog
{ {
UIJob job = new UIJob("repositionRenderings"){ //$NON-NLS-1$ UIJob job = new UIJob("repositionRenderings"){ //$NON-NLS-1$
public IStatus runInUIThread(IProgressMonitor monitor) { public IStatus runInUIThread(IProgressMonitor monitor) {
final IMemoryRenderingContainer containers[] = fMemoryView.getMemoryRenderingContainers(); for (IMemoryRenderingContainer container : fMemoryView.getMemoryRenderingContainers()) {
for(int i = 0; i < containers.length; i++) IMemoryRendering rendering = container.getActiveRendering();
{ if(rendering instanceof IRepositionableMemoryRendering) {
if(containers[i] instanceof RenderingViewPane) try {
{ ((IRepositionableMemoryRendering) rendering).goToAddress(address);
IMemoryRendering rendering = containers[i].getActiveRendering(); }
catch (DebugException ex) {
if(rendering instanceof IRepositionableMemoryRendering) MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
{ DebugException.REQUEST_FAILED, MessageFormat.format(Messages.getString("ImportMemoryDialog.ErrRepositioningRendering"), address.toString(16)), ex)); //$NON-NLS-1$
try
{
((IRepositionableMemoryRendering) rendering).goToAddress(address);
}
catch (DebugException e)
{
// do nothing
}
} }
} }
} }

View file

@ -53,10 +53,6 @@ public class PlainTextImporter implements IMemoryImporter {
private Text fStartText; private Text fStartText;
private Text fFileText; private Text fFileText;
// private Button fComboRestoreToThisAddress;
// private Button fComboRestoreToFileAddress;
private Button fScrollToBeginningOnImportComplete; private Button fScrollToBeginningOnImportComplete;
private IMemoryBlock fMemoryBlock; private IMemoryBlock fMemoryBlock;
@ -81,10 +77,11 @@ public class PlainTextImporter 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, Boolean.toString(fScrollToBeginningOnImportComplete.getSelection()));
fStartAddress = getStartAddress(); fStartAddress = getStartAddress();
fInputFile = getFile(); fInputFile = getFile();
fScrollToStart = getScrollToStart();
super.dispose(); super.dispose();
} }
@ -142,7 +139,6 @@ public class PlainTextImporter implements IMemoryImporter {
fileButton.setLayoutData(data); fileButton.setLayoutData(data);
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$ fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
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));
@ -211,6 +207,8 @@ public class PlainTextImporter implements IMemoryImporter {
data = new FormData(); data = new FormData();
data.top = new FormAttachment(fileButton); data.top = new FormAttachment(fileButton);
fScrollToBeginningOnImportComplete.setLayoutData(data); fScrollToBeginningOnImportComplete.setLayoutData(data);
final boolean scrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString())).booleanValue();
fScrollToBeginningOnImportComplete.setSelection(scrollToStart);
composite.pack(); composite.pack();
parent.pack(); parent.pack();
@ -344,7 +342,7 @@ public class PlainTextImporter implements IMemoryImporter {
reader.close(); reader.close();
monitor.done(); monitor.done();
if(Boolean.parseBoolean(fProperties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.FALSE.toString()))) if (fScrollToStart)
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(),

View file

@ -72,9 +72,11 @@ public class RAWBinaryImporter 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, Boolean.toString(fScrollToBeginningOnImportComplete.getSelection()));
fStartAddress = getStartAddress(); fStartAddress = getStartAddress();
fInputFile = getFile(); fInputFile = getFile();
fScrollToStart = getScrollToStart();
super.dispose(); super.dispose();
} }
@ -119,7 +121,6 @@ public class RAWBinaryImporter implements IMemoryImporter {
fileButton.setLayoutData(data); fileButton.setLayoutData(data);
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$ fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
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));
@ -186,6 +187,8 @@ public class RAWBinaryImporter implements IMemoryImporter {
data = new FormData(); data = new FormData();
data.top = new FormAttachment(fileButton); data.top = new FormAttachment(fileButton);
fScrollToBeginningOnImportComplete.setLayoutData(data); fScrollToBeginningOnImportComplete.setLayoutData(data);
final boolean scrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString())).booleanValue();
fScrollToBeginningOnImportComplete.setSelection(scrollToStart);
composite.pack(); composite.pack();
parent.pack(); parent.pack();
@ -307,7 +310,7 @@ public class RAWBinaryImporter implements IMemoryImporter {
reader.close(); reader.close();
monitor.done(); monitor.done();
if(Boolean.parseBoolean(fProperties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.FALSE.toString()))) if (fScrollToStart)
fParentDialog.scrollRenderings(scrollToAddress); fParentDialog.scrollRenderings(scrollToAddress);
} catch (IOException ex) { } catch (IOException ex) {

View file

@ -77,11 +77,12 @@ 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, Boolean.toString(fScrollToBeginningOnImportComplete.getSelection()));
fProperties.setProperty(TRANSFER_CUSTOM_START_ADDRESS, "" + fComboRestoreToThisAddress.getSelection()); //$NON-NLS-1$ fProperties.setProperty(TRANSFER_CUSTOM_START_ADDRESS, "" + fComboRestoreToThisAddress.getSelection()); //$NON-NLS-1$
fStartAddress = getStartAddress(); fStartAddress = getStartAddress();
fInputFile = getFile(); fInputFile = getFile();
fScrollToStart = getScrollToStart();
super.dispose(); super.dispose();
} }
@ -157,7 +158,6 @@ public class SRecordImporter implements IMemoryImporter {
fileButton.setLayoutData(data); fileButton.setLayoutData(data);
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$ fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
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));
@ -226,6 +226,8 @@ public class SRecordImporter implements IMemoryImporter {
data = new FormData(); data = new FormData();
data.top = new FormAttachment(fileButton); data.top = new FormAttachment(fileButton);
fScrollToBeginningOnImportComplete.setLayoutData(data); fScrollToBeginningOnImportComplete.setLayoutData(data);
final boolean scrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString())).booleanValue();
fScrollToBeginningOnImportComplete.setSelection(scrollToStart);
composite.pack(); composite.pack();
parent.pack(); parent.pack();
@ -429,7 +431,7 @@ public class SRecordImporter implements IMemoryImporter {
reader.close(); reader.close();
monitor.done(); monitor.done();
if(Boolean.parseBoolean(fProperties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.FALSE.toString()))) if (fScrollToStart)
fParentDialog.scrollRenderings(scrollToAddress); fParentDialog.scrollRenderings(scrollToAddress);
} catch (IOException ex) { } catch (IOException ex) {

View file

@ -13,6 +13,7 @@
ExportMemoryDialog.Format=Format: ExportMemoryDialog.Format=Format:
ExportMemoryDialog.Title=Export Memory ExportMemoryDialog.Title=Export Memory
ImportMemoryDialog.ErrRepositioningRendering=Could not reposition rendering to address 0x{0}.
ImportMemoryDialog.Format=Format: ImportMemoryDialog.Format=Format:
ImportMemoryDialog.Title=Download to Memory ImportMemoryDialog.Title=Download to Memory
@ -43,7 +44,7 @@ PlainTextImporter.ChooseFile=Choose memory import file
PlainTextImporter.ErrInvalidFormat=Invalid file format. Expected integer at line %d PlainTextImporter.ErrInvalidFormat=Invalid file format. Expected integer at line %d
PlainTextImporter.Name=Plain Text PlainTextImporter.Name=Plain Text
PlainTextImporter.RestoreAddress=Restore to address: PlainTextImporter.RestoreAddress=Restore to address:
PlainTextImporter.ScrollToStart=Scroll to File Start Address PlainTextImporter.ScrollToStart=Scroll to restore address
SRecordExporter.ChooseFile=Choose memory export file SRecordExporter.ChooseFile=Choose memory export file
SRecordExporter.EndAddress=End address: SRecordExporter.EndAddress=End address:
@ -60,7 +61,7 @@ SRecordImporter.InvalidChecksum=Invalid file format. Invalid checksum format at
SRecordImporter.InvalidData=Invalid file format. Invalid data 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.InvalidLineLength=Invalid file format. Invalid line length at line %d
SRecordImporter.Name=SRecord SRecordImporter.Name=SRecord
SRecordImporter.ScrollToStart=Scroll to File Start Address SRecordImporter.ScrollToStart=Scroll to restore address
RAWBinaryExporter.ChooseFile=Choose memory export file RAWBinaryExporter.ChooseFile=Choose memory export file
RAWBinaryExporter.EndAddress=End address: RAWBinaryExporter.EndAddress=End address:
@ -71,4 +72,4 @@ RAWBinaryExporter.StartAddress=Start address:
RAWBinaryImporter.ChooseFile=Choose memory import file RAWBinaryImporter.ChooseFile=Choose memory import file
RAWBinaryImporter.Name=RAW Binary RAWBinaryImporter.Name=RAW Binary
RAWBinaryImporter.RestoreAddress=Restore to address: RAWBinaryImporter.RestoreAddress=Restore to address:
RAWBinaryImporter.ScrollToStart=Scroll to File Start Address RAWBinaryImporter.ScrollToStart=Scroll to restore address