Package ghidra.program.model.data
Class BuiltIn
java.lang.Object
ghidra.program.model.data.AbstractDataType
ghidra.program.model.data.DataTypeImpl
ghidra.program.model.data.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
NOTE: ALL DATATYPE CLASSES MUST END IN "DataType". If not,
the ClassSearcher will not find them.
Base class for built-in Datatypes. A built-in data type is
searched for in the classpath and added automatically to the available
data types in the data type manager.
NOTE: Settings are immutable when a DataTypeManager has not been specified (i.e., null).
-
Field Summary
Fields inherited from class ghidra.program.model.data.DataTypeImpl
defaultSettingsFields inherited from class ghidra.program.model.data.AbstractDataType
categoryPath, dataMgr, EMPTY_TYPEDEF_DEFINITIONS, nameFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidInform this data type that it has the given parent
TODO: This method is reserved for internal DB use.final DataTypecopy(DataTypeManager dtm) Returns a clone of this built-in DataTypeprotected SettingsDefinition[]Gets a list of all the settingsDefinitions used by this datatype.protected StringgetCTypeDeclaration(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 StringgetCTypeDeclaration(String typeName, int typeLen, boolean signed, DataOrganization dataOrganization, boolean useDefine) protected StringgetCTypeDeclaration(String typeName, String ctypeName, boolean useDefine) getDecompilerDisplayName(DecompilerLanguage language) Return token used to represent this type in decompiler/source-code outputlongGet 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.booleanisEquivalent(DataType dt) Check if the given datatype is equivalent to this datatype.final voidremoveParent(DataType dt) Remove a parent datatypevoidsetDefaultSettings(Settings settings) Set the default settings for this data type.Methods inherited from class ghidra.program.model.data.DataTypeImpl
equals, getAlignedLength, getAlignment, getDefaultSettings, getLastChangeTimeInSourceArchive, getParents, getSourceArchive, getValueClass, hashCode, notifyAlignmentChanged, notifyDeleted, notifyNameChanged, notifyParents, notifyReplaced, notifySizeChanged, replaceWith, setDescription, setLastChangeTime, setLastChangeTimeInSourceArchive, setSourceArchiveMethods inherited from class ghidra.program.model.data.AbstractDataType
dataTypeAlignmentChanged, dataTypeDeleted, dataTypeNameChanged, dataTypeReplaced, dataTypeSizeChanged, dependsOn, encodeRepresentation, encodeValue, getCategoryPath, getDataOrganization, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDisplayName, getMnemonic, getName, getPathName, getTypeDefSettingsDefinitions, hasLanguageDependantLength, isDeleted, isEncodable, isNotYetDefined, isZeroLength, setCategoryPath, setName, setNameAndCategory, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.program.model.data.DataType
clone, dataTypeAlignmentChanged, dataTypeDeleted, dataTypeNameChanged, dataTypeReplaced, dataTypeSizeChanged, dependsOn, encodeRepresentation, encodeValue, getAlignedLength, getAlignment, getCategoryPath, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDefaultSettings, getDescription, getDisplayName, getLastChangeTimeInSourceArchive, getLength, getMnemonic, getName, getParents, getPathName, getRepresentation, getSourceArchive, getTypeDefSettingsDefinitions, getValue, getValueClass, hasLanguageDependantLength, isDeleted, isEncodable, isNotYetDefined, isZeroLength, replaceWith, setCategoryPath, setDescription, setLastChangeTime, setLastChangeTimeInSourceArchive, setName, setNameAndCategory, 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:
getSettingsDefinitionsin interfaceDataType- Overrides:
getSettingsDefinitionsin 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:BuiltInDataTypeSet the default settings for this data type.
NOTE: This method is reserved for internal DB use.- Specified by:
setDefaultSettingsin interfaceBuiltInDataType- Parameters:
settings- the settings to be used as this dataTypes default settings.
-
isEquivalent
Description copied from interface:DataTypeCheck 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:
isEquivalentin interfaceDataType- Parameters:
dt- the datatype being tested for equivalence.- Returns:
- true if the if the given datatype is equivalent to this datatype.
-
addParent
Description copied from interface:DataTypeInform this data type that it has the given parent
TODO: This method is reserved for internal DB use.- Specified by:
addParentin interfaceDataType- Overrides:
addParentin classDataTypeImpl- Parameters:
dt- parent data type
-
removeParent
Description copied from interface:DataTypeRemove a parent datatypeTODO: This method is reserved for internal DB use.
- Specified by:
removeParentin interfaceDataType- Overrides:
removeParentin classDataTypeImpl- Parameters:
dt- parent datatype
-
getUniversalID
Description copied from interface:DataTypeGet 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:
getUniversalIDin interfaceDataType- Overrides:
getUniversalIDin classDataTypeImpl- Returns:
- datatype UniversalID
-
getLastChangeTime
public long getLastChangeTime()Description copied from interface:DataTypeGet the timestamp corresponding to the last time this type was changed within its datatype manager- Specified by:
getLastChangeTimein interfaceDataType- Overrides:
getLastChangeTimein 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:
getCTypeDeclarationin 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:
-