Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2016-04-19 00:38:56 +0000
committerEugene Tarassov2016-04-19 00:38:56 +0000
commit5ee4a8001eb982aa435064cd5098f8a98e3fd828 (patch)
treefa3c8ba5d5eb27db48f603b6378ec47b25ddae70 /plugins
parent04bbd9fef4543476ff5d766543d4d045aab1e92c (diff)
downloadorg.eclipse.tcf-5ee4a8001eb982aa435064cd5098f8a98e3fd828.tar.gz
org.eclipse.tcf-5ee4a8001eb982aa435064cd5098f8a98e3fd828.tar.xz
org.eclipse.tcf-5ee4a8001eb982aa435064cd5098f8a98e3fd828.zip
TCF Debugger: better presentation of registers:
1. ranges are used to display bits of a bit-field 2. fixed NPE when cannot get register properties 3. fixed writing to read-once registers
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeRegister.java34
1 files changed, 26 insertions, 8 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeRegister.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeRegister.java
index 5f5a85806..6a536c0f6 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeRegister.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeRegister.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2016 Wind River Systems, Inc. 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
@@ -145,14 +145,19 @@ public class TCFNodeRegister extends TCFNode implements IElementEditor, IWatchIn
}
if (!context.validate(this)) return false;
IRegisters.RegistersContext ctx = context.getData();
+ if (ctx == null) {
+ set(null, context.getError(), null);
+ return true;
+ }
int[] bits = ctx.getBitNumbers();
if (bits != null) {
// handle bit fields
TCFNodeRegister p = (TCFNodeRegister)parent;
if (!p.value.validate(this)) return false;
byte[] parent_value = p.value.getData();
- byte[] bitfield_value = new byte[(bits.length + 7) / 8];
+ byte[] bitfield_value = null;
if (parent_value != null) {
+ bitfield_value = new byte[(bits.length + 7) / 8];
for (int pos = 0; pos < bits.length; pos++) {
int bit = bits[pos];
if (bit / 8 >= parent_value.length) continue;
@@ -164,8 +169,8 @@ public class TCFNodeRegister extends TCFNode implements IElementEditor, IWatchIn
return true;
}
else {
- if (ctx == null || ctx.getSize() <= 0) {
- set(null, null, null);
+ if (ctx.getSize() <= 0) {
+ set(null, context.getError(), null);
return true;
}
final TCFDataCache<?> cache = this;
@@ -314,9 +319,22 @@ public class TCFNodeRegister extends TCFNode implements IElementEditor, IWatchIn
if (l < bf.length()) bf.append(", ");
bf.append("Bits: ", SWT.BOLD);
bf.append("[");
- for (int i = bits.length; i > 0; i--) {
+ int i = bits.length;
+ while (i > 0) {
if (i != bits.length) bf.append(",");
- bf.append(bits[i - 1]);
+ i--;
+ if (i > 2) {
+ int j = i;
+ while (j > 0 && bits[j - 1] == bits[j] - 1) j--;
+ if (i - j >= 3) {
+ bf.append(bits[i]);
+ bf.append("..");
+ bf.append(bits[j]);
+ i = j;
+ continue;
+ }
+ }
+ bf.append(bits[i]);
}
bf.append("]");
}
@@ -672,7 +690,7 @@ public class TCFNodeRegister extends TCFNode implements IElementEditor, IWatchIn
if (!node.context.validate(this)) return;
IRegisters.RegistersContext ctx = node.context.getData();
if (ctx != null && ctx.isWriteable()) {
- if (!ctx.isReadable()) {
+ if (!ctx.isReadable() || ctx.isReadOnce()) {
done(Boolean.TRUE);
return;
}
@@ -705,7 +723,7 @@ public class TCFNodeRegister extends TCFNode implements IElementEditor, IWatchIn
public void run() {
if (!node.context.validate(this)) return;
IRegisters.RegistersContext ctx = node.context.getData();
- if (!ctx.isReadable()) {
+ if (!ctx.isReadable() || ctx.isReadOnce()) {
done("");
return;
}

Back to the top