diff options
author | Eugene Tarassov | 2015-06-11 00:43:12 +0000 |
---|---|---|
committer | Eugene Tarassov | 2015-06-11 00:43:12 +0000 |
commit | 8fb5fcf1af152f6a05e4bc9ef231a5f1c3b59a13 (patch) | |
tree | bbac80a94f711d346a18c8fe2e6350300b284656 | |
parent | 12fc75b6bd627c9996b9505d8ee00bc55db6f564 (diff) | |
download | org.eclipse.tcf-8fb5fcf1af152f6a05e4bc9ef231a5f1c3b59a13.tar.gz org.eclipse.tcf-8fb5fcf1af152f6a05e4bc9ef231a5f1c3b59a13.tar.xz org.eclipse.tcf-8fb5fcf1af152f6a05e4bc9ef231a5f1c3b59a13.zip |
Bug 469353 - Enum evaluation issue : Endianness issue
4 files changed, 17 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 0c1e338d0..6917f99d7 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,7 @@ 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 */ 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 ac48eed5b..93059657e 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 @@ -224,7 +224,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; } } } |