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:
parent
2bb959feda
commit
cd837027a9
5 changed files with 30 additions and 35 deletions
|
@ -12,6 +12,7 @@
|
|||
package org.eclipse.cdt.debug.ui.memory.transport;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Properties;
|
||||
import java.util.Vector;
|
||||
|
||||
|
@ -25,7 +26,6 @@ import org.eclipse.core.runtime.Platform;
|
|||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
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.IMemoryRenderingContainer;
|
||||
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.progress.UIJob;
|
||||
|
||||
@SuppressWarnings("restriction")
|
||||
public class ImportMemoryDialog extends SelectionDialog
|
||||
{
|
||||
|
||||
|
@ -81,23 +80,15 @@ public class ImportMemoryDialog extends SelectionDialog
|
|||
{
|
||||
UIJob job = new UIJob("repositionRenderings"){ //$NON-NLS-1$
|
||||
public IStatus runInUIThread(IProgressMonitor monitor) {
|
||||
final IMemoryRenderingContainer containers[] = fMemoryView.getMemoryRenderingContainers();
|
||||
for(int i = 0; i < containers.length; i++)
|
||||
{
|
||||
if(containers[i] instanceof RenderingViewPane)
|
||||
{
|
||||
IMemoryRendering rendering = containers[i].getActiveRendering();
|
||||
|
||||
if(rendering instanceof IRepositionableMemoryRendering)
|
||||
{
|
||||
try
|
||||
{
|
||||
((IRepositionableMemoryRendering) rendering).goToAddress(address);
|
||||
}
|
||||
catch (DebugException e)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
for (IMemoryRenderingContainer container : fMemoryView.getMemoryRenderingContainers()) {
|
||||
IMemoryRendering rendering = container.getActiveRendering();
|
||||
if(rendering instanceof IRepositionableMemoryRendering) {
|
||||
try {
|
||||
((IRepositionableMemoryRendering) rendering).goToAddress(address);
|
||||
}
|
||||
catch (DebugException ex) {
|
||||
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$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,10 +53,6 @@ public class PlainTextImporter implements IMemoryImporter {
|
|||
|
||||
private Text fStartText;
|
||||
private Text fFileText;
|
||||
|
||||
// private Button fComboRestoreToThisAddress;
|
||||
// private Button fComboRestoreToFileAddress;
|
||||
|
||||
private Button fScrollToBeginningOnImportComplete;
|
||||
|
||||
private IMemoryBlock fMemoryBlock;
|
||||
|
@ -81,10 +77,11 @@ public class PlainTextImporter implements IMemoryImporter {
|
|||
{
|
||||
fProperties.setProperty(TRANSFER_FILE, fFileText.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();
|
||||
fInputFile = getFile();
|
||||
fScrollToStart = getScrollToStart();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
@ -142,7 +139,6 @@ public class PlainTextImporter implements IMemoryImporter {
|
|||
fileButton.setLayoutData(data);
|
||||
|
||||
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
|
||||
fScrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString()));
|
||||
try
|
||||
{
|
||||
fStartText.setText(properties.getProperty(TRANSFER_START));
|
||||
|
@ -211,6 +207,8 @@ public class PlainTextImporter implements IMemoryImporter {
|
|||
data = new FormData();
|
||||
data.top = new FormAttachment(fileButton);
|
||||
fScrollToBeginningOnImportComplete.setLayoutData(data);
|
||||
final boolean scrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString())).booleanValue();
|
||||
fScrollToBeginningOnImportComplete.setSelection(scrollToStart);
|
||||
|
||||
composite.pack();
|
||||
parent.pack();
|
||||
|
@ -344,7 +342,7 @@ public class PlainTextImporter implements IMemoryImporter {
|
|||
reader.close();
|
||||
monitor.done();
|
||||
|
||||
if(Boolean.parseBoolean(fProperties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.FALSE.toString())))
|
||||
if (fScrollToStart)
|
||||
fParentDialog.scrollRenderings(scrollToAddress);
|
||||
} catch (IOException ex) {
|
||||
MemoryTransportPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MemoryTransportPlugin.getUniqueIdentifier(),
|
||||
|
|
|
@ -72,9 +72,11 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
|||
{
|
||||
fProperties.setProperty(TRANSFER_FILE, fFileText.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();
|
||||
fInputFile = getFile();
|
||||
fScrollToStart = getScrollToStart();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
@ -119,7 +121,6 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
|||
fileButton.setLayoutData(data);
|
||||
|
||||
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
|
||||
fScrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString()));
|
||||
try
|
||||
{
|
||||
fStartText.setText(properties.getProperty(TRANSFER_START));
|
||||
|
@ -186,6 +187,8 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
|||
data = new FormData();
|
||||
data.top = new FormAttachment(fileButton);
|
||||
fScrollToBeginningOnImportComplete.setLayoutData(data);
|
||||
final boolean scrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString())).booleanValue();
|
||||
fScrollToBeginningOnImportComplete.setSelection(scrollToStart);
|
||||
|
||||
composite.pack();
|
||||
parent.pack();
|
||||
|
@ -307,7 +310,7 @@ public class RAWBinaryImporter implements IMemoryImporter {
|
|||
reader.close();
|
||||
monitor.done();
|
||||
|
||||
if(Boolean.parseBoolean(fProperties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.FALSE.toString())))
|
||||
if (fScrollToStart)
|
||||
fParentDialog.scrollRenderings(scrollToAddress);
|
||||
|
||||
} catch (IOException ex) {
|
||||
|
|
|
@ -77,11 +77,12 @@ public class SRecordImporter implements IMemoryImporter {
|
|||
{
|
||||
fProperties.setProperty(TRANSFER_FILE, fFileText.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$
|
||||
|
||||
fStartAddress = getStartAddress();
|
||||
fInputFile = getFile();
|
||||
fScrollToStart = getScrollToStart();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
@ -157,7 +158,6 @@ public class SRecordImporter implements IMemoryImporter {
|
|||
fileButton.setLayoutData(data);
|
||||
|
||||
fFileText.setText(properties.getProperty(TRANSFER_FILE, "")); //$NON-NLS-1$
|
||||
fScrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString()));
|
||||
try
|
||||
{
|
||||
fStartText.setText(properties.getProperty(TRANSFER_START));
|
||||
|
@ -226,6 +226,8 @@ public class SRecordImporter implements IMemoryImporter {
|
|||
data = new FormData();
|
||||
data.top = new FormAttachment(fileButton);
|
||||
fScrollToBeginningOnImportComplete.setLayoutData(data);
|
||||
final boolean scrollToStart = Boolean.valueOf(properties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.TRUE.toString())).booleanValue();
|
||||
fScrollToBeginningOnImportComplete.setSelection(scrollToStart);
|
||||
|
||||
composite.pack();
|
||||
parent.pack();
|
||||
|
@ -429,7 +431,7 @@ public class SRecordImporter implements IMemoryImporter {
|
|||
reader.close();
|
||||
monitor.done();
|
||||
|
||||
if(Boolean.parseBoolean(fProperties.getProperty(TRANSFER_SCROLL_TO_START, Boolean.FALSE.toString())))
|
||||
if (fScrollToStart)
|
||||
fParentDialog.scrollRenderings(scrollToAddress);
|
||||
|
||||
} catch (IOException ex) {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
ExportMemoryDialog.Format=Format:
|
||||
ExportMemoryDialog.Title=Export Memory
|
||||
|
||||
ImportMemoryDialog.ErrRepositioningRendering=Could not reposition rendering to address 0x{0}.
|
||||
ImportMemoryDialog.Format=Format:
|
||||
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.Name=Plain Text
|
||||
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.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.InvalidLineLength=Invalid file format. Invalid line length at line %d
|
||||
SRecordImporter.Name=SRecord
|
||||
SRecordImporter.ScrollToStart=Scroll to File Start Address
|
||||
SRecordImporter.ScrollToStart=Scroll to restore address
|
||||
|
||||
RAWBinaryExporter.ChooseFile=Choose memory export file
|
||||
RAWBinaryExporter.EndAddress=End address:
|
||||
|
@ -71,4 +72,4 @@ 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
|
||||
RAWBinaryImporter.ScrollToStart=Scroll to restore address
|
||||
|
|
Loading…
Add table
Reference in a new issue