Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2015-04-17 16:27:29 -0400
committerEugene Tarassov2015-04-17 16:27:29 -0400
commitdf8b5472db1628957b6356dcea5786beaaede391 (patch)
treee90b8b4a762b75cec5167a68a626e064bf22a782
parente947105edbd02ea5f463a3c3f465fa44cee789b3 (diff)
downloadorg.eclipse.tcf-df8b5472db1628957b6356dcea5786beaaede391.tar.gz
org.eclipse.tcf-df8b5472db1628957b6356dcea5786beaaede391.tar.xz
org.eclipse.tcf-df8b5472db1628957b6356dcea5786beaaede391.zip
TCF Core: Symbols service: new symbol attribute: BitStride
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java4
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java7
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java22
3 files changed, 30 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java
index 39fb88d83..f32d2ba3b 100644
--- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java
+++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java
@@ -78,6 +78,10 @@ public class SymbolsProxy implements ISymbols {
return (Number)props.get(PROP_UPPER_BOUND);
}
+ public Number getBitStride() {
+ return (Number)props.get(PROP_BIT_STRIDE);
+ }
+
public String getName() {
return (String)props.get(PROP_NAME);
}
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java
index 51ff9641e..ac1dd07a4 100644
--- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java
+++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java
@@ -192,6 +192,12 @@ public interface ISymbols extends IService {
Number getUpperBound();
/**
+ * If symbol is an array type - return array stride in bits.
+ * @return stride in bits.
+ */
+ Number getBitStride();
+
+ /**
* Return offset from 'this' for member of class, struct or union.
* @return offset in bytes.
*/
@@ -259,6 +265,7 @@ public interface ISymbols extends IService {
PROP_LENGTH = "Length",
PROP_LOWER_BOUND = "LowerBound",
PROP_UPPER_BOUND = "UpperBound",
+ PROP_BIT_STRIDE = "BitStride",
PROP_BINARY_SCALE = "BinaryScale",
PROP_DECIMAL_SCALE = "DecimalScale",
PROP_OFFSET = "Offset",
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java
index adb0cec4b..ab318bee6 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java
@@ -1481,17 +1481,33 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
byte[] data, int offs, int size, boolean big_endian, Runnable done) {
assert offs + size <= data.length;
int length = type.getLength();
+ Number stride = type.getBitStride();
bf.append('[');
if (length > 0) {
- int elem_size = size / length;
for (int n = 0; n < length; n++) {
if (n >= 100) {
bf.append("...");
break;
}
if (n > 0) bf.append(", ");
- if (!appendValueText(bf, level + 1, type.getBaseTypeID(), null,
- data, offs + n * elem_size, elem_size, big_endian, done)) return false;
+ if (stride != null) {
+ int bits = stride.intValue();
+ byte[] buf = new byte[(bits + 7) / 8];
+ for (int i = 0; i < bits; i++) {
+ int j = n * bits + i;
+ int k = j / 8;
+ if (k < size && offs + k < data.length && (data[offs + k] & (1 << (j % 8))) != 0) {
+ buf[i / 8] |= 1 << (i % 8);
+ }
+ }
+ if (!appendValueText(bf, level + 1, type.getBaseTypeID(), null,
+ buf, 0, buf.length, big_endian, done)) return false;
+ }
+ else {
+ int elem_size = size / length;
+ if (!appendValueText(bf, level + 1, type.getBaseTypeID(), null,
+ data, offs + n * elem_size, elem_size, big_endian, done)) return false;
+ }
}
}
bf.append(']');

Back to the top