Class AbstractComplexDataType
- All Implemented Interfaces:
BuiltInDataType
,DataType
,ExtensionPoint
- Direct Known Subclasses:
Complex16DataType
,Complex32DataType
,Complex8DataType
,DoubleComplexDataType
,FloatComplexDataType
,LongDoubleComplexDataType
-
Field Summary
Fields inherited from class ghidra.program.model.data.DataTypeImpl
defaultSettings
Fields inherited from class ghidra.program.model.data.AbstractDataType
categoryPath, dataMgr, name
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
-
Constructor Summary
ConstructorDescriptionAbstractComplexDataType
(String name, AbstractFloatDataType floats, DataTypeManager dtm) -
Method Summary
Modifier and TypeMethodDescriptionint
Get the aligned-length of this datatype as a number of 8-bit bytes.static DataType
getComplexDataType
(int size, DataTypeManager dtm) protected static AbstractComplexDataType
getDefaultComplexDataType
(int size) Get a String briefly describing this DataType.int
Get the length of this DataType as a number of 8-bit bytes.getMnemonic
(Settings settings) Get the mnemonic for this DataType.getRepresentation
(MemBuffer buf, Settings settings, int length) Get bytes from memory in a printable format for this type.Returns the interpreted data value as an instance of theadvertised value class
.Methods inherited from class ghidra.program.model.data.BuiltIn
addParent, copy, dataTypeDeleted, dataTypeNameChanged, dataTypeReplaced, dataTypeSizeChanged, dependsOn, getBuiltInSettingsDefinitions, getCTypeDeclaration, getCTypeDeclaration, getCTypeDeclaration, getCTypeDeclaration, getDecompilerDisplayName, getLastChangeTime, getSettingsDefinitions, getUniversalID, isEquivalent, removeParent, setCategoryPath, setDefaultSettings, setName, setNameAndCategory
Methods inherited from class ghidra.program.model.data.DataTypeImpl
equals, getAlignment, getDefaultSettings, getLastChangeTimeInSourceArchive, getParents, getPathName, getSourceArchive, getValueClass, hashCode, notifyAlignmentChanged, notifyDeleted, notifyNameChanged, notifyParents, notifyReplaced, notifySizeChanged, replaceWith, setDescription, setLastChangeTime, setLastChangeTimeInSourceArchive, setSourceArchive
Methods inherited from class ghidra.program.model.data.AbstractDataType
dataTypeAlignmentChanged, encodeRepresentation, encodeValue, getCategoryPath, getDataOrganization, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDisplayName, getDocs, getName, getTypeDefSettingsDefinitions, hasLanguageDependantLength, isDeleted, isEncodable, isNotYetDefined, isZeroLength, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ghidra.program.model.data.DataType
clone, dataTypeAlignmentChanged, encodeRepresentation, encodeValue, getAlignment, getCategoryPath, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDefaultSettings, getDisplayName, getDocs, getLastChangeTimeInSourceArchive, getName, getParents, getPathName, getSourceArchive, getTypeDefSettingsDefinitions, getValueClass, hasLanguageDependantLength, isDeleted, isEncodable, isNotYetDefined, isZeroLength, replaceWith, setDescription, setLastChangeTime, setLastChangeTimeInSourceArchive, setSourceArchive
-
Constructor Details
-
AbstractComplexDataType
-
-
Method Details
-
getDefaultComplexDataType
-
getComplexDataType
-
getMnemonic
Description copied from interface:DataType
Get the mnemonic for this DataType.- Specified by:
getMnemonic
in interfaceDataType
- Overrides:
getMnemonic
in classAbstractDataType
- Parameters:
settings
- settings which may influence the result or null- Returns:
- the mnemonic for this DataType.
-
getLength
public int getLength()Description copied from interface:DataType
Get the length of this DataType as a number of 8-bit bytes.For primitive datatypes this reflects the smallest varnode which can be used to contain its value (i.e., raw data length).
Example: For x86 32-bit gcc an 80-bit
long double
raw data length
of 10-bytes will fit within a floating point register while itsaligned-length
of 12-bytes is used by the gcc compiler for data/array/component allocations to maintain alignment (i.e.,sizeof(long double)
).NOTE: Other than the
VoidDataType
, no datatype should ever return 0, even ifDataType.isZeroLength()
, and onlyDynamic
/FactoryDataType
datatypes should return -1. IfDataType.isZeroLength()
is true a length of 1 should be returned. Where a zero-length datatype can be handled (e.g.,Composite
) theDataType.isZeroLength()
method should be used.- Returns:
- the length of this DataType
-
getAlignedLength
public int getAlignedLength()Description copied from interface:DataType
Get the aligned-length of this datatype as a number of 8-bit bytes.For primitive datatypes this is equivalent to the C/C++ "sizeof" operation within source code and should be used when determining
Array
element length or component sizing for aComposite
. ForPointer
,Composite
andArray
types this will return the same value asDataType.getLength()
.Example: For x86 32-bit gcc an 80-bit
long double
raw data length
of 10-bytes will fit within a floating point register while itsaligned-length
of 12-bytes is used by the gcc compiler for data/array/component allocations to maintain alignment (i.e.,sizeof(long double)
).NOTE: Other than the
VoidDataType
, no datatype should ever return 0, even ifDataType.isZeroLength()
, and onlyDynamic
/FactoryDataType
/FunctionDefinition
datatypes should return -1. IfDataType.isZeroLength()
is true a length of 1 should be returned.- Specified by:
getAlignedLength
in interfaceDataType
- Overrides:
getAlignedLength
in classDataTypeImpl
- Returns:
- byte length of binary encoding.
-
getDescription
Description copied from interface:DataType
Get a String briefly describing this DataType.- Returns:
- a one-liner describing this DataType.
-
getValue
Description copied from interface:DataType
Returns the interpreted data value as an instance of theadvertised value class
.For instance,
Pointer
data types should return an Address object (or null), or integer data types should return aScalar
object.- Parameters:
buf
- the data buffersettings
- the settings to use.length
- indicates the maximum number of bytes that may be consumed by aDynamic
datatype, otherwise this value is ignored. A value of -1 may be specified to allow a Dynamic datatype to determine the length based upon the actual data bytes- Returns:
- the data object, or null if data is invalid
-
getRepresentation
Description copied from interface:DataType
Get bytes from memory in a printable format for this type.- Parameters:
buf
- the data.settings
- the settings to use for the representation.length
- the number of bytes to represent.- Returns:
- the representation of the data in this format, never null.
-