Package ghidra.program.database.data
Class ProgramBasedDataTypeManagerDB
java.lang.Object
ghidra.program.database.data.DataTypeManagerDB
ghidra.program.database.data.ProgramBasedDataTypeManagerDB
- All Implemented Interfaces:
DataTypeManager,DomainFileBasedDataTypeManager,FileBasedDataTypeManager,ProgramBasedDataTypeManager
- Direct Known Subclasses:
ProgramDataTypeManager
public abstract class ProgramBasedDataTypeManagerDB
extends DataTypeManagerDB
implements ProgramBasedDataTypeManager
DB-based Program datatype manager implementation
which has the concept of an address-based listing and corresponding
datatype instance settings.
-
Field Summary
Fields inherited from class ghidra.program.database.data.DataTypeManagerDB
addrMap, dbHandle, DEFAULT_CALLING_CONVENTION_ID, defaultListener, errHandler, lock, readOnlyMode, sourceArchiveAdapter, tablePrefix, universalID, UNKNOWN_CALLING_CONVENTION_IDFields inherited from interface ghidra.program.model.data.DataTypeManager
BAD_DATATYPE_ID, BUILT_IN_ARCHIVE_KEY, BUILT_IN_ARCHIVE_UNIVERSAL_ID, BUILT_IN_DATA_TYPES_NAME, DEFAULT_DATATYPE_ID, LOCAL_ARCHIVE_KEY, LOCAL_ARCHIVE_UNIVERSAL_ID, NULL_DATATYPE_ID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProgramBasedDataTypeManagerDB(DBHandle handle, AddressMap addrMap, OpenMode openMode, String tablePrefix, ErrorHandler errHandler, Lock lock, TaskMonitor monitor) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidclearAllSettings(Data data) Clear all settings for the given data.booleanclearSetting(Data data, String name) Clear the specified setting for the given dataprotected abstract voiddataSettingChanged(Address address) Provides notification when a data instance setting has changed at a specific address.voiddeleteAddressRange(Address startAddr, Address endAddr, TaskMonitor monitor) Removes all settings in the rangestatic AddressgetDataSettingsAddress(Data data) String[]getInstanceSettingsNames(Data data) Returns all the instance Settings names used for the specified datagetLongSettingsValue(Data data, String name) Get the long value for data instance settings.getSettings(Data data, String name) Gets the value for data instance settings in Object form.getStringSettingsValue(Data data, String name) Get the String value for data instance settings.protected voidinitializeOtherAdapters(OpenMode openMode, TaskMonitor monitor) Initialize other DB adapters after base implementation adapters has been initialized.voidInvalidates the cache.booleanisChangeAllowed(Data data, SettingsDefinition settingsDefinition) Determine if a settings change is permitted for the specified settingsDefinition.booleanisEmptySetting(Data data) Returns true if no settings are set for the given datavoidmoveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) Move the settings in the range to the new start addressbooleansetLongSettingsValue(Data data, String name, long value) Set the long value for data instance settings.booleansetSettings(Data data, String name, Object value) Set the Object value for data instance settings.booleansetStringSettingsValue(Data data, String name, String value) Set the string value for data instance settings.Methods inherited from class ghidra.program.database.data.DataTypeManagerDB
addDataType, addDataTypeManagerListener, addDataTypes, addDataTypeToDelete, addDataTypeToReplace, addInvalidatedListener, allowsDefaultBuiltInSettings, allowsDefaultComponentSettings, associateDataTypeWithArchive, categoryCreated, categoryMoved, categoryRemoved, categoryRenamed, close, compilerSpecChanged, contains, containsCategory, createCategory, dataTypeAdded, dataTypeChanged, dataTypeDeleted, dataTypeMoved, dataTypeNameChanged, dataTypeReplaced, dataTypeSettingsChanged, dbError, dedupeAllConflicts, dedupeConflicts, deleteDataTypesUsed, disassociate, dispose, doSourceArchiveUpdates, favoritesChanged, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, fixupComposites, getAddressMap, getAllComposites, getAllDataTypes, getAllDataTypes, getAllFunctionDefinitions, getAllStructures, getCallingConvention, getCallingConventionID, getCallingConventionName, getCategory, getCategory, getCategoryCount, getChildIds, getDataMap, getDataOrganization, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypes, getDataTypesContaining, getDefaultCallingConvention, getDefinedCallingConventionNames, getDomainFileID, getFavorites, getID, getKnownCallingConventionNames, getLastChangeTimeForMyManager, getLocalSourceArchive, getPath, getPointer, getPointer, getProgramArchitecture, getProgramArchitectureSummary, getProgramArchitectureSummary, getResolvedID, getRootCategory, getSourceArchive, getSourceArchive, getSourceArchives, getUniqueName, getUniversalID, getUnusedConflictName, getUnusedConflictName, getVariableStorageManager, handleDataOrganizationChange, hasDataOrganizationChange, hasParent, isChanged, isCreatingDataType, isFavorite, isTransactionActive, isUpdatable, migrateOldFlexArrayComponentsIfRequired, notifyRestored, readDataOrganization, remove, removeDataTypeManagerListener, removeInvalidatedListener, removeParentChildRecord, removeSourceArchive, replaceDataType, replaceDataTypesUsed, replaceSourceArchive, resolve, resolveSourceArchive, saveDataOrganization, setFavorite, setProgramArchitecture, sourceArchiveAdded, sourceArchiveChanged, updateID, updateLastChangeTime, updateSourceArchiveName, updateSourceArchiveNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.program.model.data.DataTypeManager
addDataType, addDataTypeManagerListener, addDataTypes, addInvalidatedListener, allowsDefaultBuiltInSettings, allowsDefaultComponentSettings, associateDataTypeWithArchive, close, contains, containsCategory, createCategory, disassociate, endTransaction, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, flushEvents, getAddressMap, getAllComposites, getAllDataTypes, getAllDataTypes, getAllFunctionDefinitions, getAllStructures, getCallingConvention, getCategory, getCategory, getCategoryCount, getDataOrganization, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypesContaining, getDefaultCallingConvention, getDefinedCallingConventionNames, getFavorites, getID, getKnownCallingConventionNames, getLastChangeTimeForMyManager, getLocalSourceArchive, getName, getPointer, getPointer, getProgramArchitecture, getProgramArchitectureSummary, getResolvedID, getRootCategory, getSourceArchive, getSourceArchives, getType, getUniqueName, getUniversalID, isFavorite, isUpdatable, openTransaction, remove, removeDataTypeManagerListener, removeInvalidatedListener, removeSourceArchive, replaceDataType, resolve, resolveSourceArchive, setFavorite, setName, startTransaction, updateSourceArchiveName, updateSourceArchiveName, withTransaction, withTransactionMethods inherited from interface ghidra.program.model.data.DomainFileBasedDataTypeManager
getDomainFileMethods inherited from interface ghidra.program.model.data.FileBasedDataTypeManager
getPathMethods inherited from interface ghidra.program.model.data.ProgramBasedDataTypeManager
getProgram
-
Constructor Details
-
ProgramBasedDataTypeManagerDB
protected ProgramBasedDataTypeManagerDB(DBHandle handle, AddressMap addrMap, OpenMode openMode, String tablePrefix, ErrorHandler errHandler, Lock lock, TaskMonitor monitor) throws CancelledException, VersionException, IOException Constructor- Parameters:
handle- open database handleaddrMap- the address map (instance settings not supported if null)openMode- the program open modetablePrefix- DB table prefix to be applied to all associated table names. This need only be specified when using multiple instances with the same DB handle (null or empty string for no-prefix).errHandler- the database io error handlerlock- the program synchronization lockmonitor- the progress monitor- Throws:
CancelledException- if the user cancels an upgradeVersionException- if the database does not match the expected version.IOException- if a database IO error occurs.
-
-
Method Details
-
initializeOtherAdapters
protected void initializeOtherAdapters(OpenMode openMode, TaskMonitor monitor) throws CancelledException, IOException, VersionException Description copied from class:DataTypeManagerDBInitialize other DB adapters after base implementation adapters has been initialized.- Overrides:
initializeOtherAdaptersin classDataTypeManagerDB- Parameters:
openMode- the DB open modemonitor- the progress monitor- Throws:
CancelledException- if the user cancels an upgradeIOException- if a database IO error occurs.VersionException- if the database does not match the expected version.
-
invalidateCache
public void invalidateCache()Description copied from class:DataTypeManagerDBInvalidates the cache.- Overrides:
invalidateCachein classDataTypeManagerDB
-
dataSettingChanged
Provides notification when a data instance setting has changed at a specific address.- Parameters:
address- data address
-
isChangeAllowed
Description copied from interface:ProgramBasedDataTypeManagerDetermine if a settings change is permitted for the specified settingsDefinition.- Specified by:
isChangeAllowedin interfaceProgramBasedDataTypeManager- Parameters:
data- data code unitsettingsDefinition- settings definition- Returns:
- true if change permitted else false
-
setLongSettingsValue
Description copied from interface:ProgramBasedDataTypeManagerSet the long value for data instance settings.- Specified by:
setLongSettingsValuein interfaceProgramBasedDataTypeManager- Parameters:
data- data code unitname- settings namevalue- value of setting- Returns:
- true if the settings actually changed
-
setStringSettingsValue
Description copied from interface:ProgramBasedDataTypeManagerSet the string value for data instance settings.- Specified by:
setStringSettingsValuein interfaceProgramBasedDataTypeManager- Parameters:
data- data code unitname- settings namevalue- value of setting- Returns:
- true if the settings actually changed
-
setSettings
Description copied from interface:ProgramBasedDataTypeManagerSet the Object value for data instance settings.- Specified by:
setSettingsin interfaceProgramBasedDataTypeManager- Parameters:
data- data code unitname- the name of the settingsvalue- the value for the settings, must be either a String, byte[] or Long- Returns:
- true if the settings were updated
-
getLongSettingsValue
Description copied from interface:ProgramBasedDataTypeManagerGet the long value for data instance settings.- Specified by:
getLongSettingsValuein interfaceProgramBasedDataTypeManager- Parameters:
data- data code unitname- settings name- Returns:
- null if the named setting was not found
-
getStringSettingsValue
Description copied from interface:ProgramBasedDataTypeManagerGet the String value for data instance settings.- Specified by:
getStringSettingsValuein interfaceProgramBasedDataTypeManager- Parameters:
data- data code unitname- settings name- Returns:
- null if the named setting was not found
-
getSettings
Description copied from interface:ProgramBasedDataTypeManagerGets the value for data instance settings in Object form.- Specified by:
getSettingsin interfaceProgramBasedDataTypeManager- Parameters:
data- data code unitname- the name of settings.- Returns:
- the settings object
-
clearSetting
Description copied from interface:ProgramBasedDataTypeManagerClear the specified setting for the given data- Specified by:
clearSettingin interfaceProgramBasedDataTypeManager- Parameters:
data- data code unitname- settings name- Returns:
- true if the settings were cleared
-
clearAllSettings
Description copied from interface:ProgramBasedDataTypeManagerClear all settings for the given data.- Specified by:
clearAllSettingsin interfaceProgramBasedDataTypeManager- Parameters:
data- data code unit
-
moveAddressRange
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) throws CancelledException Description copied from interface:ProgramBasedDataTypeManagerMove the settings in the range to the new start address- Specified by:
moveAddressRangein interfaceProgramBasedDataTypeManager- Parameters:
fromAddr- start address from where to movetoAddr- new Address to move tolength- number of addresses to movemonitor- progress monitor- Throws:
CancelledException- if the operation was cancelled
-
getInstanceSettingsNames
Description copied from interface:ProgramBasedDataTypeManagerReturns all the instance Settings names used for the specified data- Specified by:
getInstanceSettingsNamesin interfaceProgramBasedDataTypeManager- Parameters:
data- data code unit- Returns:
- the names
-
isEmptySetting
Description copied from interface:ProgramBasedDataTypeManagerReturns true if no settings are set for the given data- Specified by:
isEmptySettingin interfaceProgramBasedDataTypeManager- Parameters:
data- data code unit- Returns:
- true if not settings
-
deleteAddressRange
public void deleteAddressRange(Address startAddr, Address endAddr, TaskMonitor monitor) throws CancelledException Description copied from interface:ProgramBasedDataTypeManagerRemoves all settings in the range- Specified by:
deleteAddressRangein interfaceProgramBasedDataTypeManager- Parameters:
startAddr- the first address in the range.endAddr- the last address in the range.monitor- the progress monitor- Throws:
CancelledException- if the user cancelled the operation.
-
getDataSettingsAddress
-