Class BuiltIn
- All Implemented Interfaces:
BuiltInDataType
,DataType
,ExtensionPoint
- Direct Known Subclasses:
AbstractComplexDataType
,AbstractFloatDataType
,AbstractIntegerDataType
,AbstractLeb128DataType
,AbstractPointerTypedefBuiltIn
,AbstractStringDataType
,AIFFDataType
,AlignmentDataType
,AUDataType
,BadDataType
,DwarfEncodingModeDataType
,DynamicDataType
,FactoryStructureDataType
,FileTimeDataType
,GifDataType
,GuidDataType
,HTMLResourceDataType
,JPEGDataType
,MacintoshTimeStampDataType
,MIDIDataType
,PcRelative31AddressDataType
,PngDataType
,PointerDataType
,SegmentedCodePointerDataType
,ShiftedAddressDataType
,Undefined
,VoidDataType
,WAVEDataType
,WideChar16DataType
,WideChar32DataType
,WideCharDataType
-
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
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Inform this data type that it has the given parent
TODO: This method is reserved for internal DB use.final DataType
copy
(DataTypeManager dtm) Returns a clone of this built-in DataTypevoid
Informs this datatype that the given datatype has been deleted.void
dataTypeNameChanged
(DataType dt, String oldName) Informs this datatype that its name has changed from the indicated old name.void
dataTypeReplaced
(DataType oldDt, DataType newDt) Informs this datatype that the given oldDT has been replaced with newDTvoid
Notification that the given datatype's size has changed.boolean
Check if this datatype depends on the existence of the given datatype.protected SettingsDefinition[]
Gets a list of all the settingsDefinitions used by this datatype.protected String
getCTypeDeclaration
(BuiltIn dt, boolean signed, DataOrganization dataOrganization, boolean useDefine) getCTypeDeclaration
(DataOrganization dataOrganization) Returns null for FactoryDataType (which should never be used) and Dynamic types which should generally be replaced by a primitive array (e.g., char[5]) or, a primitive pointer (e.g., char *).protected String
getCTypeDeclaration
(String typeName, int typeLen, boolean signed, DataOrganization dataOrganization, boolean useDefine) protected String
getCTypeDeclaration
(String typeName, String ctypeName, boolean useDefine) getDecompilerDisplayName
(DecompilerLanguage language) Return token used to represent this type in decompiler/source-code outputlong
Get the timestamp corresponding to the last time this type was changed within its datatype managerfinal SettingsDefinition[]
Gets a list of all the settingsDefinitions used by this datatype.Get the universal ID for this datatype.boolean
isEquivalent
(DataType dt) Check if the given datatype is equivalent to this datatype.final void
removeParent
(DataType dt) Remove a parent datatypefinal void
setCategoryPath
(CategoryPath path) Set the categoryPath associated with this datatypevoid
setDefaultSettings
(Settings settings) Set the default settings for this data type.final void
Sets the name of the datatypefinal void
setNameAndCategory
(CategoryPath path, String name) Sets the name and category of a datatype at the same time.Methods inherited from class ghidra.program.model.data.DataTypeImpl
equals, getAlignedLength, 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, getMnemonic, 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, getAlignedLength, getAlignment, getCategoryPath, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDefaultSettings, getDescription, getDisplayName, getDocs, getLastChangeTimeInSourceArchive, getLength, getMnemonic, getName, getParents, getPathName, getRepresentation, getSourceArchive, getTypeDefSettingsDefinitions, getValue, getValueClass, hasLanguageDependantLength, isDeleted, isEncodable, isNotYetDefined, isZeroLength, replaceWith, setDescription, setLastChangeTime, setLastChangeTimeInSourceArchive, setSourceArchive
-
Constructor Details
-
BuiltIn
-
-
Method Details
-
copy
Returns a clone of this built-in DataType -
getSettingsDefinitions
Gets a list of all the settingsDefinitions used by this datatype.- Specified by:
getSettingsDefinitions
in interfaceDataType
- Overrides:
getSettingsDefinitions
in classDataTypeImpl
- Returns:
- a list of the settingsDefinitions used by this datatype.
-
getBuiltInSettingsDefinitions
Gets a list of all the settingsDefinitions used by this datatype.- Returns:
- a list of the settingsDefinitions used by this datatype.
-
setDefaultSettings
Description copied from interface:BuiltInDataType
Set the default settings for this data type.
NOTE: This method is reserved for internal DB use.- Specified by:
setDefaultSettings
in interfaceBuiltInDataType
- Parameters:
settings
- the settings to be used as this dataTypes default settings.
-
isEquivalent
Description copied from interface:DataType
Check if the given datatype is equivalent to this datatype.The precise meaning of "equivalent" is datatype dependent.
NOTE: if invoked by a DB object or manager it should be invoked on the DataTypeDB object passing the other datatype as the argument.- Specified by:
isEquivalent
in interfaceDataType
- Parameters:
dt
- the datatype being tested for equivalence.- Returns:
- true if the if the given datatype is equivalent to this datatype.
-
dataTypeSizeChanged
Description copied from interface:DataType
Notification that the given datatype's size has changed.DataTypes may need to make internal changes in response.
TODO: This method is reserved for internal DB use.- Specified by:
dataTypeSizeChanged
in interfaceDataType
- Overrides:
dataTypeSizeChanged
in classAbstractDataType
- Parameters:
dt
- the datatype that has changed.
-
setCategoryPath
Description copied from interface:DataType
Set the categoryPath associated with this datatype- Specified by:
setCategoryPath
in interfaceDataType
- Overrides:
setCategoryPath
in classAbstractDataType
- Parameters:
path
- the new path- Throws:
DuplicateNameException
- if an attempt to place this datatype into the specified category resulted in a name collision. This should not occur for non-DB DataType instances.
-
setName
Description copied from interface:DataType
Sets the name of the datatype- Specified by:
setName
in interfaceDataType
- Overrides:
setName
in classAbstractDataType
- Parameters:
name
- the new name for this datatype.- Throws:
InvalidNameException
- if the given name does not form a valid name.
-
setNameAndCategory
public final void setNameAndCategory(CategoryPath path, String name) throws InvalidNameException, DuplicateNameException Description copied from interface:DataType
Sets the name and category of a datatype at the same time.- Specified by:
setNameAndCategory
in interfaceDataType
- Overrides:
setNameAndCategory
in classAbstractDataType
- Parameters:
path
- the new category path.name
- the new name- Throws:
InvalidNameException
- if the name is invalidDuplicateNameException
- if name change on storedDataType
is a duplicate of another datatype within the same category (only applies to DB storedDataType
).
-
addParent
Description copied from interface:DataType
Inform this data type that it has the given parent
TODO: This method is reserved for internal DB use.- Specified by:
addParent
in interfaceDataType
- Overrides:
addParent
in classDataTypeImpl
- Parameters:
dt
- parent data type
-
removeParent
Description copied from interface:DataType
Remove a parent datatypeTODO: This method is reserved for internal DB use.
- Specified by:
removeParent
in interfaceDataType
- Overrides:
removeParent
in classDataTypeImpl
- Parameters:
dt
- parent datatype
-
dataTypeNameChanged
Description copied from interface:DataType
Informs this datatype that its name has changed from the indicated old name.TODO: This method is reserved for internal DB use.
- Specified by:
dataTypeNameChanged
in interfaceDataType
- Overrides:
dataTypeNameChanged
in classAbstractDataType
- Parameters:
dt
- the datatype whose name changedoldName
- the datatype's old name
-
dataTypeReplaced
Description copied from interface:DataType
Informs this datatype that the given oldDT has been replaced with newDTTODO: This method is reserved for internal DB use.
- Specified by:
dataTypeReplaced
in interfaceDataType
- Overrides:
dataTypeReplaced
in classAbstractDataType
- Parameters:
oldDt
- old datatypenewDt
- new datatype
-
dataTypeDeleted
Description copied from interface:DataType
Informs this datatype that the given datatype has been deleted.TODO: This method is reserved for internal DB use.
- Specified by:
dataTypeDeleted
in interfaceDataType
- Overrides:
dataTypeDeleted
in classAbstractDataType
- Parameters:
dt
- the datatype that has been deleted.
-
dependsOn
Description copied from interface:DataType
Check if this datatype depends on the existence of the given datatype.For example byte[] depends on byte. If byte were deleted, then byte[] would also be deleted.
- Specified by:
dependsOn
in interfaceDataType
- Overrides:
dependsOn
in classAbstractDataType
- Parameters:
dt
- the datatype to test that this datatype depends on.- Returns:
- true if the existence of this datatype relies on the existence of the specified datatype dt.
-
getUniversalID
Description copied from interface:DataType
Get the universal ID for this datatype.This value is intended to be a unique identifier across all programs and archives. The same ID indicates that two datatypes were originally the same one. Keep in mind names, categories, and component makeup may differ and have changed since there origin.
- Specified by:
getUniversalID
in interfaceDataType
- Overrides:
getUniversalID
in classDataTypeImpl
- Returns:
- datatype UniversalID
-
getLastChangeTime
public long getLastChangeTime()Description copied from interface:DataType
Get the timestamp corresponding to the last time this type was changed within its datatype manager- Specified by:
getLastChangeTime
in interfaceDataType
- Overrides:
getLastChangeTime
in classDataTypeImpl
- Returns:
- timestamp of last change within datatype manager
-
getDecompilerDisplayName
Return token used to represent this type in decompiler/source-code output- Parameters:
language
- is the language being displayed- Returns:
- the name string
-
getCTypeDeclaration
-
getCTypeDeclaration
protected String getCTypeDeclaration(String typeName, int typeLen, boolean signed, DataOrganization dataOrganization, boolean useDefine) -
getCTypeDeclaration
protected String getCTypeDeclaration(BuiltIn dt, boolean signed, DataOrganization dataOrganization, boolean useDefine) -
getCTypeDeclaration
Returns null for FactoryDataType (which should never be used) and Dynamic types which should generally be replaced by a primitive array (e.g., char[5]) or, a primitive pointer (e.g., char *). For other types an appropriately sized unsigned integer typedef is returned.- Specified by:
getCTypeDeclaration
in interfaceBuiltInDataType
- Parameters:
dataOrganization
- or null for default- Returns:
- definition C-statement (e.g., #define or typedef) or null if type name is a standard C-primitive name or if type is FactoryDataType or Dynamic.
- See Also:
-