aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémie Galarneau2013-10-16 16:51:55 (EDT)
committerMatthew Khouzam2013-10-17 11:57:05 (EDT)
commit1e34d3c84d499dad12ee6ade80eda7514142b5c9 (patch)
tree0eb61ad446c19665a963219b4a0d492ca13c1c2b
parent596f83a51f82e26440c3a06bb276b22220260246 (diff)
downloadorg.eclipse.linuxtools-1e34d3c84d499dad12ee6ade80eda7514142b5c9.zip
org.eclipse.linuxtools-1e34d3c84d499dad12ee6ade80eda7514142b5c9.tar.gz
org.eclipse.linuxtools-1e34d3c84d499dad12ee6ade80eda7514142b5c9.tar.bz2
Fix Float reading in CTF tracesrefs/changes/32/17432/4
Ensure that the BitBuffer's potision is aligned properly with respect to the FloatDeclaration's alignment constraints before reading the value. Reference bug #419536 Change-Id: Ia0e5aadb7baa7899cbddaded1bfe593ea734e89c Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Reviewed-on: https://git.eclipse.org/r/17432 Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> IP-Clean: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FloatDefinition.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FloatDefinition.java b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FloatDefinition.java
index 4b0153d..14a8b2a 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FloatDefinition.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FloatDefinition.java
@@ -88,6 +88,9 @@ public class FloatDefinition extends Definition {
public void read(BitBuffer input) {
int exp = declaration.getExponent();
int mant = declaration.getMantissa();
+ int align = (int) declaration.getAlignment();
+ int pos = input.position() + ((align - (input.position() % align)) % align);
+ input.position(pos);
if ((exp + mant) == 32) {
value = readRawFloat32(input, mant, exp);
} else if ((exp + mant) == 64) {