Skip to content

Commit f760a5b

Browse files
ctf: add float support for ctf2
Change-Id: I018e6cfa1f3e7aeed14953de76d6d9f34adf8e64 Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
1 parent bc1f0bc commit f760a5b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/metadata/tsdl/TypeAliasParser.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.eclipse.tracecompass.internal.ctf.core.event.metadata.tsdl.dynamicarray.DynamicLengthArrayParser;
2828
import org.eclipse.tracecompass.internal.ctf.core.event.metadata.tsdl.dynamicstring.DynamicLengthStringParser;
2929
import org.eclipse.tracecompass.internal.ctf.core.event.metadata.tsdl.enumeration.EnumParser;
30+
import org.eclipse.tracecompass.internal.ctf.core.event.metadata.tsdl.floatingpoint.FloatDeclarationParser;
3031
import org.eclipse.tracecompass.internal.ctf.core.event.metadata.tsdl.integer.IntegerDeclarationParser;
3132
import org.eclipse.tracecompass.internal.ctf.core.event.metadata.tsdl.staticarray.StaticLengthArrayParser;
3233
import org.eclipse.tracecompass.internal.ctf.core.event.metadata.tsdl.staticstring.StaticLengthStringParser;
@@ -179,6 +180,10 @@ public IDeclaration parse(ICTFMetadataNode typealias, ICommonTreeParserParameter
179180
targetDeclaration = DynamicLengthArrayParser.INSTANCE.parse(typealias, new DynamicLengthArrayParser.Param(trace, scope));
180181
} else if (JsonMetadataStrings.STRUCTURE.equals(type)) {
181182
targetDeclaration = StructParser.INSTANCE.parse(typealias, new StructParser.Param(trace, null, scope));
183+
} else if (JsonMetadataStrings.FIXED_LENGTH_FLOATING_POINT.equals(type)) {
184+
targetDeclaration = FloatDeclarationParser.INSTANCE.parse(typealias, new FloatDeclarationParser.Param(trace));
185+
} else if (JsonMetadataStrings.VARIABLE_LENGTH_FLOATING_POINT.equals(type)) {
186+
targetDeclaration = FloatDeclarationParser.INSTANCE.parse(typealias, new FloatDeclarationParser.Param(trace));
182187
} else {
183188
throw new ParseException("Invalid field class: " + type); //$NON-NLS-1$
184189
}

ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/utils/JsonMetadataStrings.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ private JsonMetadataStrings() {
157157
*/
158158
public static final String VARIABLE_SIGNED_INTEGER_FIELD = "variable-length-signed-integer"; //$NON-NLS-1$
159159

160+
/**
161+
* Type string for a fixed length floating point field class
162+
*/
163+
public static final String FIXED_LENGTH_FLOATING_POINT = "fixed-length-floating-point-number"; //$NON-NLS-1$
164+
/**
165+
* Type string for a variable length floating point field class
166+
*/
167+
public static final String VARIABLE_LENGTH_FLOATING_POINT = "variable-length-floating-point-number"; //$NON-NLS-1$
168+
160169
/**
161170
* Type string for a static length blob field class
162171
*/

0 commit comments

Comments
 (0)