Package ghidra.program.database.symbol
Class VariableStorageManagerDB
java.lang.Object
ghidra.program.database.symbol.VariableStorageManagerDB
- All Implemented Interfaces:
VariableStorageManager
-
Constructor Summary
ConstructorDescriptionVariableStorageManagerDB
(DBHandle handle, AddressMap addrMap, OpenMode openMode, ErrorHandler errorHandler, Lock lock, TaskMonitor monitor) Construct a new variable manager. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Delete the DB table which correspnds to this variable storage implementationstatic boolean
Determine if the variable storage manager table already existsgetVariableStorageAddress
(VariableStorage storage, boolean create) Get a variable address for the given storage specification.void
setLanguage
(LanguageTranslator translator, TaskMonitor monitor) Perform language translation.void
Set program architecture.
-
Constructor Details
-
VariableStorageManagerDB
public VariableStorageManagerDB(DBHandle handle, AddressMap addrMap, OpenMode openMode, ErrorHandler errorHandler, Lock lock, TaskMonitor monitor) throws VersionException, IOException, CancelledException Construct a new variable manager.- Parameters:
handle
- the database handle.addrMap
- the address map (required for legacy adpter use only)openMode
- the open modeerrorHandler
- database error handlerlock
- the program synchronization lockmonitor
- the task monitor.- Throws:
IOException
- if a database error occurs.VersionException
- if the table version is different from this adapter.IOException
- if an IO error occursCancelledException
- if the user cancels the upgrade.
-
-
Method Details
-
setProgramArchitecture
Set program architecture.- Parameters:
arch
- program architecture
-
delete
Delete the DB table which correspnds to this variable storage implementation- Parameters:
dbHandle
- database handle- Throws:
IOException
- if an IO error occurs
-
exists
Determine if the variable storage manager table already exists- Parameters:
dbHandle
- database handle- Returns:
- true if storage table exists
-
getVariableStorageAddress
public Address getVariableStorageAddress(VariableStorage storage, boolean create) throws IOException Get a variable address for the given storage specification. NOTE: The program architecture and error handler must be set appropriately prior to invocation of this method (seesetProgramArchitecture(ProgramArchitecture)
.- Specified by:
getVariableStorageAddress
in interfaceVariableStorageManager
- Parameters:
storage
- variable storage specificationcreate
- if true a new variable address will be allocated if needed- Returns:
- variable address which corresponds to the storage specification or null if not found and create is false.
- Throws:
IOException
- if an IO error occurs
-
setLanguage
public void setLanguage(LanguageTranslator translator, TaskMonitor monitor) throws CancelledException Perform language translation. Following the invocation of this method it is important to ensure that the program architecure is adjusted if neccessary. Update variable storage specifications to reflect address space and register mappings- Parameters:
translator
- language translator to be used for mapping storage varnodes to new architecture.monitor
- task monitor- Throws:
CancelledException
- if task is cancelled
-