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_ID
Fields 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
ModifierConstructorDescriptionprotected
ProgramBasedDataTypeManagerDB
(DBHandle handle, AddressMap addrMap, OpenMode openMode, String tablePrefix, ErrorHandler errHandler, Lock lock, TaskMonitor monitor) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearAllSettings
(Data data) Clear all settings for the given data.boolean
clearSetting
(Data data, String name) Clear the specified setting for the given dataprotected abstract void
dataSettingChanged
(Address address) Provides notification when a data instance setting has changed at a specific address.void
deleteAddressRange
(Address startAddr, Address endAddr, TaskMonitor monitor) Removes all settings in the rangestatic Address
getDataSettingsAddress
(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 void
initializeOtherAdapters
(OpenMode openMode, TaskMonitor monitor) Initialize other DB adapters after base implementation adapters has been initialized.void
Invalidates the cache.boolean
isChangeAllowed
(Data data, SettingsDefinition settingsDefinition) Determine if a settings change is permitted for the specified settingsDefinition.boolean
isEmptySetting
(Data data) Returns true if no settings are set for the given datavoid
moveAddressRange
(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) Move the settings in the range to the new start addressboolean
setLongSettingsValue
(Data data, String name, long value) Set the long value for data instance settings.boolean
setSettings
(Data data, String name, Object value) Set the Object value for data instance settings.boolean
setStringSettingsValue
(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, updateSourceArchiveName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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, withTransaction
Methods inherited from interface ghidra.program.model.data.DomainFileBasedDataTypeManager
getDomainFile
Methods inherited from interface ghidra.program.model.data.FileBasedDataTypeManager
getPath
Methods 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:DataTypeManagerDB
Initialize other DB adapters after base implementation adapters has been initialized.- Overrides:
initializeOtherAdapters
in 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:DataTypeManagerDB
Invalidates the cache.- Overrides:
invalidateCache
in classDataTypeManagerDB
-
dataSettingChanged
Provides notification when a data instance setting has changed at a specific address.- Parameters:
address
- data address
-
isChangeAllowed
Description copied from interface:ProgramBasedDataTypeManager
Determine if a settings change is permitted for the specified settingsDefinition.- Specified by:
isChangeAllowed
in interfaceProgramBasedDataTypeManager
- Parameters:
data
- data code unitsettingsDefinition
- settings definition- Returns:
- true if change permitted else false
-
setLongSettingsValue
Description copied from interface:ProgramBasedDataTypeManager
Set the long value for data instance settings.- Specified by:
setLongSettingsValue
in interfaceProgramBasedDataTypeManager
- Parameters:
data
- data code unitname
- settings namevalue
- value of setting- Returns:
- true if the settings actually changed
-
setStringSettingsValue
Description copied from interface:ProgramBasedDataTypeManager
Set the string value for data instance settings.- Specified by:
setStringSettingsValue
in interfaceProgramBasedDataTypeManager
- Parameters:
data
- data code unitname
- settings namevalue
- value of setting- Returns:
- true if the settings actually changed
-
setSettings
Description copied from interface:ProgramBasedDataTypeManager
Set the Object value for data instance settings.- Specified by:
setSettings
in 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:ProgramBasedDataTypeManager
Get the long value for data instance settings.- Specified by:
getLongSettingsValue
in interfaceProgramBasedDataTypeManager
- Parameters:
data
- data code unitname
- settings name- Returns:
- null if the named setting was not found
-
getStringSettingsValue
Description copied from interface:ProgramBasedDataTypeManager
Get the String value for data instance settings.- Specified by:
getStringSettingsValue
in interfaceProgramBasedDataTypeManager
- Parameters:
data
- data code unitname
- settings name- Returns:
- null if the named setting was not found
-
getSettings
Description copied from interface:ProgramBasedDataTypeManager
Gets the value for data instance settings in Object form.- Specified by:
getSettings
in interfaceProgramBasedDataTypeManager
- Parameters:
data
- data code unitname
- the name of settings.- Returns:
- the settings object
-
clearSetting
Description copied from interface:ProgramBasedDataTypeManager
Clear the specified setting for the given data- Specified by:
clearSetting
in interfaceProgramBasedDataTypeManager
- Parameters:
data
- data code unitname
- settings name- Returns:
- true if the settings were cleared
-
clearAllSettings
Description copied from interface:ProgramBasedDataTypeManager
Clear all settings for the given data.- Specified by:
clearAllSettings
in interfaceProgramBasedDataTypeManager
- Parameters:
data
- data code unit
-
moveAddressRange
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) throws CancelledException Description copied from interface:ProgramBasedDataTypeManager
Move the settings in the range to the new start address- Specified by:
moveAddressRange
in 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:ProgramBasedDataTypeManager
Returns all the instance Settings names used for the specified data- Specified by:
getInstanceSettingsNames
in interfaceProgramBasedDataTypeManager
- Parameters:
data
- data code unit- Returns:
- the names
-
isEmptySetting
Description copied from interface:ProgramBasedDataTypeManager
Returns true if no settings are set for the given data- Specified by:
isEmptySetting
in 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:ProgramBasedDataTypeManager
Removes all settings in the range- Specified by:
deleteAddressRange
in 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
-