Fix bug when tracefile is not aligned. Now supports exotic architectures.
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / internal / ctf / core / event / metadata / IOStructGen.java
index 45707a7df9af074f335f481a35a7bde4e2e6e666..7e3071960d424357027bff3dbc61bb1fbe9dfdeb 100644 (file)
@@ -1256,7 +1256,7 @@ public class IOStructGen {
             }
         }
 
-        floatDeclaration = new FloatDeclaration(exponent, mantissa, byteOrder, encoding);
+        floatDeclaration = new FloatDeclaration(exponent, mantissa, byteOrder, encoding, alignment);
 
         assert (floatDeclaration != null);
         return floatDeclaration;
@@ -1387,7 +1387,7 @@ public class IOStructGen {
         }
 
         integerDeclaration = new IntegerDeclaration((int) size, signed, base,
-                byteOrder, encoding, clock);
+                byteOrder, encoding, clock, alignment);
 
         assert (integerDeclaration != null);
         return integerDeclaration;
@@ -1551,6 +1551,12 @@ public class IOStructGen {
 
             /* Parse the body */
             parseStructBody(structBody, structDeclaration);
+            long maxFieldAlign = -1;
+            for( IDeclaration field : structDeclaration.getFields().values())
+            {
+                maxFieldAlign = Math.max(maxFieldAlign, field.getAlignment());
+            }
+            structDeclaration.setMinAlign(maxFieldAlign);
 
             /* If struct has name, add it to the current scope. */
             if (hasName) {
This page took 0.026285 seconds and 5 git commands to generate.