Interface Union
- All Known Subinterfaces:
UnionInternal
- All Known Implementing Classes:
UnionDataType
NOTE: The use of bitfields within all unions assumes a default packing where bit allocation always starts with byte-0 of the union. Bit allocation order is dictated by data organization endianness (byte-0 msb allocated first for big-endian, while byte-0 lsb allocated first for little-endian).
-
Field Summary
Fields inherited from interface ghidra.program.model.data.DataType
CONFLICT_SUFFIX, DEFAULT, NO_LAST_CHANGE_TIME, NO_SOURCE_SYNC_TIME, TYPEDEF_ATTRIBUTE_PREFIX, TYPEDEF_ATTRIBUTE_SUFFIX, VOID
-
Method Summary
Modifier and TypeMethodDescriptionclone
(DataTypeManager dtm) Returns an instance of this DataType using the specifiedDataTypeManager
to allow its use of the correspondingDataOrganization
while retaining its unique identity (seeDataType.getUniversalID()
and archive association (seeDataType.getSourceArchive()
) if applicable.insertBitField
(int ordinal, DataType baseDataType, int bitSize, String componentName, String comment) Inserts a new bitfield at the specified ordinal position in this union.Methods inherited from interface ghidra.program.model.data.Composite
add, add, add, add, addBitField, align, dataTypeAlignmentChanged, delete, delete, getAlignment, getAlignmentType, getComponent, getComponents, getDefinedComponents, getExplicitMinimumAlignment, getExplicitPackingValue, getNumComponents, getNumDefinedComponents, getPackingType, hasDefaultPacking, hasExplicitMinimumAlignment, hasExplicitPackingValue, insert, insert, insert, isDefaultAligned, isMachineAligned, isPackingEnabled, isPartOf, pack, repack, setDescription, setExplicitMinimumAlignment, setExplicitPackingValue, setPackingEnabled, setToDefaultAligned, setToDefaultPacking, setToMachineAligned
Methods inherited from interface ghidra.program.model.data.DataType
addParent, copy, dataTypeDeleted, dataTypeNameChanged, dataTypeReplaced, dataTypeSizeChanged, dependsOn, encodeRepresentation, encodeValue, getAlignedLength, getCategoryPath, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDefaultSettings, getDescription, getDisplayName, getDocs, getLastChangeTime, getLastChangeTimeInSourceArchive, getLength, getMnemonic, getName, getParents, getPathName, getRepresentation, getSettingsDefinitions, getSourceArchive, getTypeDefSettingsDefinitions, getUniversalID, getValue, getValueClass, hasLanguageDependantLength, isDeleted, isEncodable, isEquivalent, isNotYetDefined, isZeroLength, removeParent, replaceWith, setCategoryPath, setLastChangeTime, setLastChangeTimeInSourceArchive, setName, setNameAndCategory, setSourceArchive
-
Method Details
-
clone
Description copied from interface:DataType
Returns an instance of this DataType using the specifiedDataTypeManager
to allow its use of the correspondingDataOrganization
while retaining its unique identity (seeDataType.getUniversalID()
and archive association (seeDataType.getSourceArchive()
) if applicable.This instance will be returned if this datatype's DataTypeManager matches the specified dtm. The recursion depth of a clone will stop on any datatype whose
DataTypeManager
matches the specified dtm and simply use the existing datatype instance.NOTE: In general, this method should not be used to obtain an instance to be modified. In most cases changes may be made directly to this instance if supported or to a
DataType.copy(DataTypeManager)
of this type. -
insertBitField
DataTypeComponent insertBitField(int ordinal, DataType baseDataType, int bitSize, String componentName, String comment) throws InvalidDataTypeException, IndexOutOfBoundsException Inserts a new bitfield at the specified ordinal position in this union. For all Unions, bitfield starts with bit-0 (lsb) of the first byte for little-endian, and with bit-7 (msb) of the first byte for big-endian. This is the default behavior for most compilers. Insertion behavior may not work as expected if packing rules differ from this.- Parameters:
ordinal
- the ordinal where the new datatype is to be inserted (numbering starts at 0).baseDataType
- the bitfield base datatype (certain restrictions apply).bitSize
- the declared bitfield size in bits. The effective bit size may be adjusted based upon the specified baseDataType.componentName
- the field name to associate with this component.comment
- the comment to associate with this component.- Returns:
- the bitfield component created whose associated data type will be BitFieldDataType.
- Throws:
InvalidDataTypeException
- if the specified baseDataType is not a valid base type for bitfields.IndexOutOfBoundsException
- if ordinal is less than 0 or greater than the current number of components.
-