Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandy Rohrbach2013-01-18 21:59:30 +0000
committerRandy Rohrbach2013-01-18 22:07:29 +0000
commit46598455db3dc1f096a296a5735edb069f6838b2 (patch)
treeb47e40232154da473f389db8c88160264dd1eae9 /memory/org.eclipse.cdt.debug.ui.memory.transport
parent4b22b8c6bc6201ca9b27ed9e9bc9ea602e7ab661 (diff)
downloadorg.eclipse.cdt-46598455db3dc1f096a296a5735edb069f6838b2.tar.gz
org.eclipse.cdt-46598455db3dc1f096a296a5735edb069f6838b2.tar.xz
org.eclipse.cdt-46598455db3dc1f096a296a5735edb069f6838b2.zip
Bug 398329 : MemoryBrowser - switching between debuggees does not update the provider for browser operations like Import and Export
Bug 398332 : The validation logic and feedback for all of the Importers/Exporters is very bad I found some more editing edge cases as well as an NPE on starting a new connection with the Browser up, which was the result of a previous edit.
Diffstat (limited to 'memory/org.eclipse.cdt.debug.ui.memory.transport')
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java88
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java88
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordExporter.java54
3 files changed, 217 insertions, 13 deletions
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java
index 35766ded478..ffeb18f5788 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java
@@ -159,11 +159,41 @@ public class PlainTextExporter implements IMemoryExporter {
textValue = fProperties.get(TRANSFER_START);
fStartText.setText(textValue != null ? textValue : "0x0"); //$NON-NLS-1$
+
+ try
+ {
+ getStartAddress();
+ }
+ catch(Exception e)
+ {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
textValue = fProperties.get(TRANSFER_END);
fEndText.setText(textValue != null ? textValue : "0x0"); //$NON-NLS-1$
-
- fLengthText.setText(getEndAddress().subtract(getStartAddress()).toString());
+
+ try
+ {
+ getEndAddress();
+ }
+ catch(Exception e)
+ {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ try
+ {
+ BigInteger length = getEndAddress().subtract(getStartAddress());
+ fLengthText.setText(length.toString());
+ if(length.compareTo(BigInteger.ZERO) <= 0) {
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+ }
+ catch(Exception e)
+ {
+ fLengthText.setText("0");
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
fileButton.addSelectionListener(new SelectionAdapter() {
@@ -195,13 +225,25 @@ public class PlainTextExporter implements IMemoryExporter {
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
- BigInteger actualLength = getEndAddress().subtract(getStartAddress());
+ BigInteger startAddress = getStartAddress();
+ BigInteger actualLength = getEndAddress().subtract(startAddress);
fLengthText.setText(actualLength.toString());
if(actualLength.compareTo(BigInteger.ZERO) <= 0) {
fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
}
+
+ if(startAddress.compareTo(BigInteger.ZERO) < 0) {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ BigInteger endAddress = getEndAddress();
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
}
catch(Exception ex)
{
@@ -230,6 +272,18 @@ public class PlainTextExporter implements IMemoryExporter {
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
}
+
+ BigInteger startAddress = getStartAddress();
+ if(startAddress.compareTo(BigInteger.ZERO) < 0) {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ BigInteger endAddress = getEndAddress();
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
}
catch(Exception ex)
{
@@ -252,15 +306,39 @@ public class PlainTextExporter implements IMemoryExporter {
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
- BigInteger length = getLength();
- String endString = "0x" + getStartAddress().add(length).toString(16); //$NON-NLS-1$
fStartText.setText(fStartText.getText().trim());
+
+ BigInteger length = getLength();
+ String endString;
+ BigInteger startAddress = getStartAddress();
+ BigInteger endAddress = startAddress.add(length);
+
+ if(length.compareTo(BigInteger.ZERO) <= 0) {
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ endString = endAddress.toString(16); //$NON-NLS-1$
+ }
+ else {
+ endString = "0x" + endAddress.toString(16); //$NON-NLS-1$
+ }
+ }
+ else {
+ endString = "0x" + endAddress.toString(16); //$NON-NLS-1$
+ }
+
fEndText.setText(endString);
if(length.compareTo(BigInteger.ZERO) <= 0) {
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
}
+
+ if(startAddress.compareTo(BigInteger.ZERO) < 0) {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
}
catch(Exception ex)
{
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java
index 0a622e17333..1f4190cafbd 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java
@@ -158,11 +158,41 @@ public class RAWBinaryExporter implements IMemoryExporter
textValue = fProperties.get(TRANSFER_START);
fStartText.setText(textValue != null ? textValue : "0x0"); //$NON-NLS-1$
+
+ try
+ {
+ getStartAddress();
+ }
+ catch(Exception e)
+ {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
textValue = fProperties.get(TRANSFER_END);
fEndText.setText(textValue != null ? textValue : "0x0"); //$NON-NLS-1$
-
- fLengthText.setText(getEndAddress().subtract(getStartAddress()).toString());
+
+ try
+ {
+ getEndAddress();
+ }
+ catch(Exception e)
+ {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ try
+ {
+ BigInteger length = getEndAddress().subtract(getStartAddress());
+ fLengthText.setText(length.toString());
+ if(length.compareTo(BigInteger.ZERO) <= 0) {
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+ }
+ catch(Exception e)
+ {
+ fLengthText.setText("0");
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
fileButton.addSelectionListener(new SelectionListener() {
@@ -196,13 +226,25 @@ public class RAWBinaryExporter implements IMemoryExporter
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
- BigInteger actualLength = getEndAddress().subtract(getStartAddress());
+ BigInteger startAddress = getStartAddress();
+ BigInteger actualLength = getEndAddress().subtract(startAddress);
fLengthText.setText(actualLength.toString());
if(actualLength.compareTo(BigInteger.ZERO) <= 0) {
fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
}
+
+ if(startAddress.compareTo(BigInteger.ZERO) < 0) {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ BigInteger endAddress = getEndAddress();
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
}
catch(Exception ex)
{
@@ -231,6 +273,18 @@ public class RAWBinaryExporter implements IMemoryExporter
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
}
+
+ BigInteger startAddress = getStartAddress();
+ if(startAddress.compareTo(BigInteger.ZERO) < 0) {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ BigInteger endAddress = getEndAddress();
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
}
catch(Exception ex)
{
@@ -253,15 +307,39 @@ public class RAWBinaryExporter implements IMemoryExporter
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
- BigInteger length = getLength();
- String endString = "0x" + getStartAddress().add(length).toString(16); //$NON-NLS-1$
fStartText.setText(fStartText.getText().trim());
+
+ BigInteger length = getLength();
+ String endString;
+ BigInteger startAddress = getStartAddress();
+ BigInteger endAddress = startAddress.add(length);
+
+ if(length.compareTo(BigInteger.ZERO) <= 0) {
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ endString = endAddress.toString(16); //$NON-NLS-1$
+ }
+ else {
+ endString = "0x" + endAddress.toString(16); //$NON-NLS-1$
+ }
+ }
+ else {
+ endString = "0x" + endAddress.toString(16); //$NON-NLS-1$
+ }
+
fEndText.setText(endString);
if(length.compareTo(BigInteger.ZERO) <= 0) {
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
}
+
+ if(startAddress.compareTo(BigInteger.ZERO) < 0) {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
}
catch(Exception ex)
{
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordExporter.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordExporter.java
index c76326874f8..9484110a842 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordExporter.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordExporter.java
@@ -249,13 +249,25 @@ public class SRecordExporter implements IMemoryExporter
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
- BigInteger actualLength = getEndAddress().subtract(getStartAddress());
+ BigInteger startAddress = getStartAddress();
+ BigInteger actualLength = getEndAddress().subtract(startAddress);
fLengthText.setText(actualLength.toString());
if(actualLength.compareTo(BigInteger.ZERO) <= 0) {
fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
}
+
+ if(startAddress.compareTo(BigInteger.ZERO) < 0) {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ BigInteger endAddress = getEndAddress();
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
}
catch(Exception ex)
{
@@ -284,6 +296,18 @@ public class SRecordExporter implements IMemoryExporter
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
}
+
+ BigInteger startAddress = getStartAddress();
+ if(startAddress.compareTo(BigInteger.ZERO) < 0) {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ BigInteger endAddress = getEndAddress();
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
}
catch(Exception ex)
{
@@ -306,15 +330,39 @@ public class SRecordExporter implements IMemoryExporter
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
- BigInteger length = getLength();
- String endString = "0x" + getStartAddress().add(length).toString(16); //$NON-NLS-1$
fStartText.setText(fStartText.getText().trim());
+
+ BigInteger length = getLength();
+ String endString;
+ BigInteger startAddress = getStartAddress();
+ BigInteger endAddress = startAddress.add(length);
+
+ if(length.compareTo(BigInteger.ZERO) <= 0) {
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ endString = endAddress.toString(16); //$NON-NLS-1$
+ }
+ else {
+ endString = "0x" + endAddress.toString(16); //$NON-NLS-1$
+ }
+ }
+ else {
+ endString = "0x" + endAddress.toString(16); //$NON-NLS-1$
+ }
+
fEndText.setText(endString);
if(length.compareTo(BigInteger.ZERO) <= 0) {
fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
fLengthText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
}
+
+ if(startAddress.compareTo(BigInteger.ZERO) < 0) {
+ fStartText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
+
+ if(endAddress.compareTo(BigInteger.ZERO) < 0) {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ }
}
catch(Exception ex)
{

Back to the top