Package ghidra.program.model.data
Class AlignedStructurePacker
- java.lang.Object
-
- ghidra.program.model.data.AlignedStructurePacker
-
- Direct Known Subclasses:
AlignedStructureInspector
public class AlignedStructurePacker extends java.lang.Object
AlignedStructurePacker
provides support for performing aligned packing of Structure components.NOTE: We currently have no way of conveying or supporting explicit bitfield component pragmas supported by some compilers (e.g., bit_field_size, bit_field_align, bit_packing).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AlignedStructurePacker.StructurePackResult
StructurePackResult
provides access to aligned packing results
-
Constructor Summary
Constructors Modifier Constructor Description protected
AlignedStructurePacker(StructureInternal structure, java.util.List<? extends InternalDataTypeComponent> components)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AlignedStructurePacker.StructurePackResult
pack()
Perform packing on the structure components.static AlignedStructurePacker.StructurePackResult
packComponents(StructureInternal structure, java.util.List<? extends InternalDataTypeComponent> components)
Perform structure component packing.
-
-
-
Constructor Detail
-
AlignedStructurePacker
protected AlignedStructurePacker(StructureInternal structure, java.util.List<? extends InternalDataTypeComponent> components)
Constructor.- Parameters:
structure
- structure whose components need to be packed and updated during packing (ordinal, offset, length and bit-field datatypes may be modified)components
- list of mutable component
-
-
Method Detail
-
pack
protected AlignedStructurePacker.StructurePackResult pack()
Perform packing on the structure components.- Returns:
- pack result data
-
packComponents
public static AlignedStructurePacker.StructurePackResult packComponents(StructureInternal structure, java.util.List<? extends InternalDataTypeComponent> components)
Perform structure component packing. Specified components may be updated to reflect packing (ordinal, offset, length and bit-field datatypes may be modified). The caller is responsible for updating structure length and component count based upon returned result. Component count is should only change if component list includes DEFAULT members which will be ignored.- Parameters:
structure
- structure whose members are to be aligned/packed.components
- structure components.- Returns:
- aligned packing result
-
-