diff options
author | Eugene Tarassov | 2014-11-26 19:49:33 +0000 |
---|---|---|
committer | Eugene Tarassov | 2014-11-26 19:49:33 +0000 |
commit | 6d1ac9403b659ccf4d9d189ca285157fe838c7bf (patch) | |
tree | 150b745812cf3ee8af45d9715560e453a64a6aaf | |
parent | 136af638da0700d6b94467584896f031c140439b (diff) | |
download | org.eclipse.tcf-6d1ac9403b659ccf4d9d189ca285157fe838c7bf.tar.gz org.eclipse.tcf-6d1ac9403b659ccf4d9d189ca285157fe838c7bf.tar.xz org.eclipse.tcf-6d1ac9403b659ccf4d9d189ca285157fe838c7bf.zip |
Bug 451283 - TCF debugger does not support native complex types
6 files changed, 35 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/hover/TCFDebugTextHover.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/hover/TCFDebugTextHover.java index e01d9f21e..e7c541b72 100644 --- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/hover/TCFDebugTextHover.java +++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/hover/TCFDebugTextHover.java @@ -177,6 +177,8 @@ public class TCFDebugTextHover extends AbstractDebugTextHover implements ITextHo return TCFNumberFormat.toBigInteger(data, value.isBigEndian(), true).toString(); case real: return TCFNumberFormat.toFPString(data, value.isBigEndian()); + case complex: + return TCFNumberFormat.toComplexFPString(data, value.isBigEndian()); default: return "0x" + TCFNumberFormat.toBigInteger(data, value.isBigEndian(), false).toString(16); } diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/ExpressionsProxy.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/ExpressionsProxy.java index db45fd63b..381b11b95 100644 --- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/ExpressionsProxy.java +++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/ExpressionsProxy.java @@ -136,6 +136,8 @@ public class ExpressionsProxy implements IExpressions { case 6: return TypeClass.composite; case 7: return TypeClass.enumeration; case 8: return TypeClass.function; + case 9: return TypeClass.member_pointer; + case 10: return TypeClass.complex; } } return TypeClass.unknown; 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 7cbeb1d75..39fb88d83 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 @@ -129,6 +129,7 @@ public class SymbolsProxy implements ISymbols { case 7: return TypeClass.enumeration; case 8: return TypeClass.function; case 9: return TypeClass.member_pointer; + case 10: return TypeClass.complex; } } return TypeClass.unknown; 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 7b46cf80a..65316c129 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 @@ -50,7 +50,8 @@ public interface ISymbols extends IService { composite, // struct, union, or class. enumeration, // enumeration type. function, // function type. - member_pointer // pointer to member type + member_pointer, // pointer to member type + complex // complex float } static final int 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 7a7a73740..2c7f6acdd 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 @@ -874,6 +874,9 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT case real: if (size == 0) return null; return "<Float-" + (size * 8) + ">"; + case complex: + if (size == 0) return null; + return "<Complex-" + (size / 2 * 8) + ">"; } return null; } @@ -1057,7 +1060,8 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT @SuppressWarnings("incomplete-switch") private String toNumberString(int radix, ISymbols.TypeClass t, byte[] data, int offs, int size, boolean big_endian) { - if (size <= 0 || size > 16) return ""; + if (size <= 0) return ""; + if (size > (t == ISymbols.TypeClass.complex ? 32: 16)) return ""; if (radix != 16) { switch (t) { case array: @@ -1089,6 +1093,8 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT return TCFNumberFormat.toBigInteger(data, offs, size, big_endian, true).toString(); case real: return TCFNumberFormat.toFPString(data, offs, size, big_endian); + case complex: + return TCFNumberFormat.toComplexFPString(data, offs, size, big_endian); } } String s = TCFNumberFormat.toBigInteger(data, offs, size, big_endian, false).toString(radix); @@ -1573,7 +1579,9 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT bf.append(s); bf.append('\n'); } - else if (type_class == ISymbols.TypeClass.integer || type_class == ISymbols.TypeClass.real) { + else if (type_class == ISymbols.TypeClass.integer || + type_class == ISymbols.TypeClass.real || + type_class == ISymbols.TypeClass.complex) { bf.append(toNumberString(10, type_class, data, offs, size, big_endian), StyledStringBuffer.MONOSPACED); } else { @@ -1601,6 +1609,7 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT case integer: case cardinal: case real: + case complex: if (level == 0) { assert offs == 0 && size == data.length && data_node == this; if (!appendNumericValueText(bf, type_class, data, big_endian, done)) return false; diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java index 05f6f5d62..afa19d8aa 100644 --- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java +++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java @@ -304,6 +304,23 @@ public class TCFNumberFormat { return s; } + public static String toComplexFPString(byte[] data, boolean big_endian) { + return toComplexFPString(data, 0, data.length, big_endian); + } + + public static String toComplexFPString(byte[] data, int offs, int size, boolean big_endian) { + int fp_size = size / 2; + StringBuffer bf = new StringBuffer(); + bf.append(toFPString(data, offs, fp_size, big_endian)); + String i = toFPString(data, offs + fp_size, fp_size, big_endian); + if (!i.equals("0")) { + if (!i.startsWith("-")) bf.append('+'); + bf.append(i); + bf.append('i'); + } + return bf.toString(); + } + public static BigInteger toBigInteger(byte[] data, boolean big_endian, boolean sign_extension) { return toBigInteger(data, 0, data.length, big_endian, sign_extension); } |