Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2015-06-11 00:43:12 +0000
committerAnton Leherbauer2015-06-11 06:48:04 +0000
commitc177320e2460f3e44bb54708621147e029e92f95 (patch)
tree6bc2247748a3bf991fd3d566bca922d76af3ccd2
parent9f8a3af3bdd856d591b30249d0bb3366c870ee04 (diff)
downloadorg.eclipse.tcf-c177320e2460f3e44bb54708621147e029e92f95.tar.gz
org.eclipse.tcf-c177320e2460f3e44bb54708621147e029e92f95.tar.xz
org.eclipse.tcf-c177320e2460f3e44bb54708621147e029e92f95.zip
Bug 469353 - Enum evaluation issue : Endianness issue
Conflicts: plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IMemory.java
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/SymbolsProxy.java3
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IMemory.java4
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/ISymbols.java6
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java25
4 files changed, 19 insertions, 19 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 f32d2ba3b..420c58a26 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
@@ -149,8 +149,7 @@ public class SymbolsProxy implements ISymbols {
public boolean isBigEndian() {
Boolean b = (Boolean)props.get(PROP_BIG_ENDIAN);
- if (b != null) b.booleanValue();
- return (getFlags() & SYM_FLAG_BIG_ENDIAN) != 0;
+ return b != null && b.booleanValue();
}
public String getRegisterID() {
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IMemory.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IMemory.java
index 4564905e0..363c2f533 100644
--- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IMemory.java
+++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IMemory.java
@@ -42,7 +42,9 @@ public interface IMemory extends IService {
PROP_NAME = "Name", /** String, name of the context, can be used for UI purposes */
PROP_START_BOUND = "StartBound", /** Number, lowest address (inclusive) which is valid for the context */
PROP_END_BOUND = "EndBound", /** Number, highest address (inclusive) which is valid for the context */
- PROP_ACCESS_TYPES = "AccessTypes", /** Array of String, the access types allowed for this context */
+ PROP_ACCESS_TYPES = "AccessTypes"; /** Array of String, the access types allowed for this context */
+ /** @since 1.3*/
+ static final String
PROP_ADDRESSABLE_UNIT_SIZE = "AddressableUnitSize", /** Number, addressable unit size in number of bytes */
PROP_DEFAULT_WORD_SIZE = "DefaultWordSize"; /** Number, default word size in number of bytes */
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 ac1dd07a4..e564b2125 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
@@ -217,7 +217,11 @@ public interface ISymbols extends IService {
/**
* Get symbol values endianness.
- * @return true if symbol is big-endian.
+ * Only valid when getValue() != null.
+ * Note: this is endianness of byte array returned by getValue() method,
+ * and it can be different from endianness of the symbol itself,
+ * which is reported by SYM_FLAG_BIG_ENDIAN/SYM_FLAG_LITTLE_ENDIAN.
+ * @return true if symbol value is big-endian.
*/
boolean isBigEndian();
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 15f5a21eb..2e91c4511 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
@@ -466,25 +466,20 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
if (!type_children_cache.validate(this)) return false;
String[] type_children_data = type_children_cache.getData();
if (type_children_data == null) break;
+ BigInteger value_int = TCFNumberFormat.toBigInteger(
+ value_data.getValue(), value_data.isBigEndian(), false);
for (String const_id : type_children_data) {
TCFDataCache<ISymbols.Symbol> const_cache = model.getSymbolInfoCache(const_id);
if (!const_cache.validate(this)) return false;
ISymbols.Symbol const_data = const_cache.getData();
- if (const_data != null && const_data.getName() != null) {
- byte[] const_bytes = const_data.getValue();
- if (const_bytes != null) {
- boolean ok = true;
- byte[] data = value_data.getValue();
- for (int i = 0; ok && i < data.length; i++) {
- if (i < const_bytes.length) ok = const_bytes[i] == data[i];
- else ok = data[i] == 0;
- }
- if (ok && const_data.getName() != null) {
- StyledStringBuffer bf = new StyledStringBuffer();
- bf.append(const_data.getName());
- set(null, null, bf);
- return true;
- }
+ if (const_data != null && const_data.getName() != null && const_data.getValue() != null) {
+ BigInteger const_int = TCFNumberFormat.toBigInteger(
+ const_data.getValue(), const_data.isBigEndian(), false);
+ if (value_int.equals(const_int)) {
+ StyledStringBuffer bf = new StyledStringBuffer();
+ bf.append(const_data.getName());
+ set(null, null, bf);
+ return true;
}
}
}

Back to the top