Package ghidra.program.database.code
Class CodeManager
java.lang.Object
ghidra.program.database.code.CodeManager
- All Implemented Interfaces:
ErrorHandler
,ManagerDB
Class to manage database tables for data and instructions.
-
Constructor Summary
ConstructorDescriptionCodeManager
(DBHandle handle, AddressMap addrMap, OpenMode openMode, Lock lock, TaskMonitor monitor) Constructs a new CodeManager for a program. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInstructions
(InstructionSet instructionSet, boolean overwrite) Creates a complete set of instructions.void
checkContextWrite
(Address start, Address end) Check if any instruction intersects the specified address range.void
clearAll
(boolean clearContext, TaskMonitor monitor) Clear all code units in the program.void
clearCodeUnits
(Address start, Address end, boolean clearContext, TaskMonitor monitor) Remove code units, symbols, equates, and references to code units in the given range (inclusive).void
clearComments
(Address start, Address end) Clears all comments in the given range (inclusive).void
clearData
(Set<Long> dataTypeIDs, TaskMonitor monitor) Removes any data objects that have dataTypes matching the given dataType ids.void
clearProperties
(Address start, Address end, TaskMonitor monitor) Clears the properties in the given range (inclusive).createCodeUnit
(Address addr, DataType dataType, int length) Creates a data at the specified address.createCodeUnit
(Address address, InstructionPrototype prototype, MemBuffer memBuf, ProcessorContextView context, int length) Creates an instruction at the specified address.void
Notification that an IO exception occurred.void
deleteAddressRange
(Address start, Address end, TaskMonitor monitor) Removes the block of defined bytes from the listing.void
fallThroughChanged
(Address fromAddr, Reference newFallThroughRef) Callback from ReferenceManager when a new fall-through reference is set.getCodeUnitAfter
(Address addr) Returns the next code unit whose min address is greater than the specified address.getCodeUnitAt
(Address address) Returns the code unit whose min address equals the specified address.getCodeUnitBefore
(Address address) Returns the next code unit whose min address is closest to and less than the specified address.getCodeUnitContaining
(Address address) Returns the code unit whose min address is less than or equal to the specified address and whose max address is greater than or equal to the specified address.getCodeUnitIterator
(String property, Address address, boolean forward) Get an iterator that contains the code units which have the specified property type defined.getCodeUnitIterator
(String property, AddressSetView addrSetView, boolean forward) Get an iterator that contains the code units which have the specified property type defined.getCodeUnits
(Address start, boolean forward) Returns an iterator over all codeUnits in the program from the given start address to either the end address or the start address, depending if the iterator is forward or not.getCodeUnits
(AddressSetView set, boolean forward) Returns an iterator over all codeUnits in the given addressSet.getComment
(int commentType, Address address) Get the comment for the given type at the specified address.getCommentAddressIterator
(int commentType, AddressSetView set, boolean forward) Get a forward iterator over addresses that have comments of the given type.getCommentAddressIterator
(AddressSetView addrSet, boolean forward) Get an iterator over addresses that have comments of any type.getCommentCodeUnitIterator
(int commentType, AddressSetView set) Get a forward iterator over code units that have comments of the given type.getCommentHistory
(Address addr, int commentType) Get the comment history for the comment type at the given addressgetCompositeData
(Address start, boolean forward) Returns a composite data iterator beginning at the specified start address.getCompositeData
(AddressSetView addrSet, boolean forward) Returns a composite data iterator limited to the addresses in the specified address set.Returns an iterator over all data in the program from the given start address to either the end address or the start address, depending if the iterator is forward or not.getData
(AddressSetView set, boolean forward) Returns an iterator over all data in the given addressSet.getDataAfter
(Address addr) Returns the next data whose min address is greater than the specified address.Returns the data whose min address equals the specified address.getDataBefore
(Address addr) Returns the next data whose min address is closest to and less than the specified address.getDataContaining
(Address addr) Returns the data whose min address is less than or equal to the specified address and whose max address is greater than or equal to the specified address.getDefinedData
(Address address, boolean forward) Returns an iterator over all defined data in the program from the given start address to either the end address or the start address, depending if the iterator is forward or not.getDefinedData
(AddressSetView set, boolean forward) Returns an iterator over all defined data in the given addressSet.getDefinedDataAfter
(Address addr) Returns the next defined data whose min address is greater than the specified address.getDefinedDataAt
(Address address) Returns the defined data whose min address equals the specified address.getDefinedDataBefore
(Address addr) Returns the next defined data whose min address is closest to and less than the specified address.Returns the defined data whose min address is less than or equal to the specified address and whose max address is greater than or equal to the specified address.getFirstUndefinedData
(AddressSetView set, TaskMonitor monitor) Returns the next undefined data whose min address falls within the address set searching in the forward direction(e.g., 0 -> 0xfff).
getFirstUndefinedDataAfter
(Address addr, TaskMonitor monitor) Returns the next undefined data whose min address is greater than the specified address.getFirstUndefinedDataBefore
(Address addr, TaskMonitor monitor) Returns the next undefined data whose min address is closest to and less than the specified address.getInstructionAfter
(Address addr) Returns the next instruction whose min address is greater than the specified address.getInstructionAt
(Address address) Returns the instruction whose min address equals the specified address or null if the address is not the beginning address of some code unit.getInstructionBefore
(Address addr) Returns the next instruction whose min address is closest to and less than the specified address.getInstructionContaining
(Address address, boolean usePrototypeLength) Returns an instruction whose min address is less than or equal to the specified address and whose max address is greater than or equal to the specified address.protected DBRecord
getInstructionRecord
(long addr) getInstructions
(Address address, boolean forward) Returns an iterator over all instructions in the program from the given start address to either the end address or the start address, depending if the iterator is forward or not.getInstructions
(AddressSetView set, boolean forward) Returns an iterator over all instructions in the given addressSet.int
Returns the number of defined data in the program.int
Returns the number of instructions in the program.getPropertyMap
(String propertyName) Returns the property map object that is associated with the specified property name.Returns the reference manager being used by this code manager.getUndefinedAt
(Address address) Returns the undefined data whose min address equals the specified address.getUndefinedRanges
(AddressSetView set, boolean initializedMemoryOnly, TaskMonitor monitor) Returns an iterator over all user-defined properties.void
invalidateCache
(boolean all) Clears all data caches.void
Invalidates the cache for the code units.protected boolean
isUndefined
(Address address, long addr) boolean
isUndefined
(Address start, Address end) Checks if all the addresses from start to end have undefined data.void
memoryChanged
(Address addr, Address end) Notification that memory has changed, so clear the cache for the affected code units.void
moveAddressRange
(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) Move a block of code from one address to a new address.void
programReady
(OpenMode openMode, int currentRevision, TaskMonitor monitor) Callback from program made to each manager after the program has completed initialization.void
reDisassembleAllInstructions
(TaskMonitor monitor) Complete language transformation of all instructions.void
removeUserDefinedProperty
(String propertyName) Removes the user-defined property with the specified property name.void
replaceDataTypes
(Map<Long, Long> dataTypeReplacementMap) void
setComment
(Address address, int commentType, String comment) Set the comment for the given comment type at the specified address.void
setProgram
(ProgramDB program) Set the program after all the managers have been created.void
updateDataReferences
(Data data) Update the data references on this data item.
-
Constructor Details
-
CodeManager
public CodeManager(DBHandle handle, AddressMap addrMap, OpenMode openMode, Lock lock, TaskMonitor monitor) throws VersionException, CancelledException, IOException Constructs a new CodeManager for a program.- Parameters:
handle
- handle to databaseaddrMap
- addressMap to convert between addresses and long values.openMode
- either READ_ONLY, UPDATE, or UPGRADElock
- the program synchronization lockmonitor
- the task monitor use while upgrading.- Throws:
VersionException
- if the database is incompatible with the current schemaIOException
- if a database io error occursCancelledException
- if the user cancels the upgrade operation
-
-
Method Details
-
setProgram
Set the program after all the managers have been created.- Specified by:
setProgram
in interfaceManagerDB
- Parameters:
program
- The program object that this manager belongs to.
-
programReady
public void programReady(OpenMode openMode, int currentRevision, TaskMonitor monitor) throws IOException, CancelledException Description copied from interface:ManagerDB
Callback from program made to each manager after the program has completed initialization. This method may be used by managers to perform additional upgrading which may have been deferred.- Specified by:
programReady
in interfaceManagerDB
- Parameters:
openMode
- the mode that the program is being opened.currentRevision
- current program revision. If openMode is UPGRADE, this value reflects the pre-upgrade value.monitor
- the task monitor to use in any upgrade operations.- Throws:
IOException
- if a database io error occurs.CancelledException
- if the user cancelled the operation via the task monitor.
-
activateContextLocking
public void activateContextLocking() -
dbError
Description copied from interface:ErrorHandler
Notification that an IO exception occurred.- Specified by:
dbError
in interfaceErrorHandler
- Parameters:
e
-IOException
which was cause of error
-
addInstructions
Creates a complete set of instructions. A preliminary pass will be made checking for code unit conflicts which will be marked within the instructionSet causing dependent blocks to get pruned.- Parameters:
instructionSet
- the set of instructions to be added. All code unit conflicts will be marked within the instructionSet and associated blocks.overwrite
- if true, overwrites existing code units.- Returns:
- the set of addresses over which instructions were actually added to the program. This may differ from the InstructionSet address set if conflict errors occurred. Such conflict errors will be recorded within the InstructionSet and its InstructionBlocks.
-
createCodeUnit
public Instruction createCodeUnit(Address address, InstructionPrototype prototype, MemBuffer memBuf, ProcessorContextView context, int length) throws CodeUnitInsertionException Creates an instruction at the specified address.- Parameters:
address
- start address of instructionprototype
- instruction definition objectmemBuf
- the MemBuffer to use to get the bytes from memorycontext
- object that has the state of all the registers.length
- instruction byte-length (must be in the range 0..prototype.getLength()). If smaller than the prototype length it must have a value no greater than 7, otherwise an error will be thrown. A value of 0 or greater-than-or-equal the prototype length will be ignored and not impose and override length. The length value must be a multiple of theinstruction alignment
.- Returns:
- the newly created instruction.
- Throws:
CodeUnitInsertionException
- thrown if the new Instruction would overlap and existingCodeUnit
or the specifiedlength
is unsupported.IllegalArgumentException
- if a negativelength
is specified.
-
deleteAddressRange
public void deleteAddressRange(Address start, Address end, TaskMonitor monitor) throws CancelledException Removes the block of defined bytes from the listing. All necessary checks will be made by listing before this method is called, so just do the work.- Specified by:
deleteAddressRange
in interfaceManagerDB
- Parameters:
start
- the first address in the range.end
- the last address in the range.monitor
- the TaskMonitor that tracks progress and is used to tell if the user cancels the operation.- Throws:
CancelledException
- if the user cancels the operation.
-
moveAddressRange
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) throws CancelledException Move a block of code from one address to a new address.Updates all property managers, symbols, and references.
- Specified by:
moveAddressRange
in interfaceManagerDB
- Parameters:
fromAddr
- the first address in the range to be moved.toAddr
- the address to move to.length
- the number of addresses to move.monitor
- the TaskMonitor that tracks progress and is used to tell if the user cancels the operation.- Throws:
CancelledException
- if the user cancels the operation.
-
getCodeUnitAt
Returns the code unit whose min address equals the specified address.- Parameters:
address
- the min address of the code unit to return- Returns:
- CodeUnit the code unit at the specified address, or null if a code unit does not exist
-
getCodeUnitAfter
Returns the next code unit whose min address is greater than the specified address.- Parameters:
addr
- the address to look after- Returns:
- CodeUnit the code unit after the specified address, or null if a code unit does not exist
-
getUserDefinedProperties
Returns an iterator over all user-defined properties.- Returns:
- Iterator an iterator over all user-defined properties
-
removeUserDefinedProperty
Removes the user-defined property with the specified property name.- Parameters:
propertyName
- the name of the user-defined property to remove
-
getPropertyMap
Returns the property map object that is associated with the specified property name.- Parameters:
propertyName
- the name of the property- Returns:
- the property map object associated to the property name
-
getCodeUnitBefore
Returns the next code unit whose min address is closest to and less than the specified address.- Parameters:
address
- the address to look before- Returns:
- CodeUnit the code unit before the specified address, or null if a code unit does not exist
-
getCodeUnitContaining
Returns the code unit whose min address is less than or equal to the specified address and whose max address is greater than or equal to the specified address.codeunit.minAddress() <= addr <= codeunit.maxAddress()
- Parameters:
address
- the address for which to find the code containing it.- Returns:
- CodeUnit the code unit containing the specified address, or null if a code unit does not exist.
-
getCodeUnitIterator
Get an iterator that contains the code units which have the specified property type defined. Only code units at an address greater than or equal to the specified start address will be returned by the iterator. If the start address is null then check the entire program.Standard property types are defined in the CodeUnit class. The property types are:
- COMMENT_PROPERTY
- INSTRUCTION_PROPERTY
- DEFINED_DATA_PROPERTY
- Parameters:
property
- the name of the user defined property type or special standard name from above.address
- the address to start the iterator, or null to iterator the entire programforward
- true means get iterator in the forward direction- Returns:
- a CodeUnitIterator that returns all code units from the indicated start address that have the specified property type defined.
-
getCodeUnitIterator
public CodeUnitIterator getCodeUnitIterator(String property, AddressSetView addrSetView, boolean forward) Get an iterator that contains the code units which have the specified property type defined. Only code units starting within the address set specified will be returned by the iterator. If the address set is null then check the entire program.
Standard property types are defined in the CodeUnit class. The property types are:- REFERENCE_PROPERTY
- INSTRUCTION_PROPERTY
- DEFINED_DATA_PROPERTY
- Parameters:
property
- the name of the property type, or this can be user defined.addrSetView
- the address set to iterate, or null to iterate over the entire programforward
- true means the iterator is in the forward direction- Returns:
- a CodeUnitIterator that returns all code units from the indicated address set that have the specified property type defined.
-
getCommentCodeUnitIterator
Get a forward iterator over code units that have comments of the given type.- Parameters:
commentType
- comment type defined in CodeUnitset
- address set (null for all defined memory)- Returns:
- code unit iterator
-
getCommentAddressIterator
public AddressIterator getCommentAddressIterator(int commentType, AddressSetView set, boolean forward) Get a forward iterator over addresses that have comments of the given type.- Parameters:
commentType
- comment type defined in CodeUnitset
- address set (null for all defined memory)forward
- true to iterate in the direction of increasing addresses.- Returns:
- address iterator
-
getCommentAddressIterator
Get an iterator over addresses that have comments of any type.- Parameters:
addrSet
- address set containing the comment addresses to iterate over.forward
- true to iterate in the direction of increasing addresses.- Returns:
- the iterator
-
getInstructionAt
Returns the instruction whose min address equals the specified address or null if the address is not the beginning address of some code unit.- Parameters:
address
- the min address of the instruction to return- Returns:
- the instruction at the specified address, or null if a instruction does not exist starting at the given address.
-
getDefinedDataAt
Returns the defined data whose min address equals the specified address.- Parameters:
address
- the min address of the data defined to return- Returns:
- the defined data at the specified address, or null if a defined data does not exist
-
getInstructionBefore
Returns the next instruction whose min address is closest to and less than the specified address.- Parameters:
addr
- the address to look before- Returns:
- the instruction before the specified address, or null if a instruction does not exist
-
getInstructionAfter
Returns the next instruction whose min address is greater than the specified address.- Parameters:
addr
- the address to look after- Returns:
- the instruction after the specified address, or null if a instruction does not exist
-
getInstructionContaining
Returns an instruction whose min address is less than or equal to the specified address and whose max address is greater than or equal to the specified address. IfusePrototypeLength==true
instruction.getMinAddress() <= addr <= instruction.getMinAddress().add(instruction.getPrototype().getLength() - 1)
IfusePrototypeLength==false
instruction.getMinAddress() <= addr <= instruction.getMaxAddress()
The use of the prototype length is required when guarding against memory modifications. If a length-override is present only one of the entangled instructions will be returned and is intended to simply indicate the presence of a conflict.- Parameters:
address
- the address to be containedusePrototypeLength
- if actual prototype length should be considered when identifying a conflict (required when checking for memory modification conflicts), otherwise code unit length is used. These lengths can vary when alength-override
is in affect for an instruction.- Returns:
- the instruction containing the specified address, or null if a instruction does not exist
-
getDataAt
Returns the data whose min address equals the specified address.- Parameters:
address
- the min address of the data to return- Returns:
- the data at the specified address, or null if data does not exist
-
getDataBefore
Returns the next data whose min address is closest to and less than the specified address.- Parameters:
addr
- the address to look before- Returns:
- the data before the specified address, or null if a data does not exist
-
getDataAfter
Returns the next data whose min address is greater than the specified address.- Parameters:
addr
- the address to look after- Returns:
- the data after the specified address, or null if a data does not exist
-
getDataContaining
Returns the data whose min address is less than or equal to the specified address and whose max address is greater than or equal to the specified address.data.minAddress() <= addr <= data.maxAddress()
- Parameters:
addr
- the address to be contained- Returns:
- the data containing the specified address, or null if a data does not exist that starts at that address.
-
getDefinedDataAfter
Returns the next defined data whose min address is greater than the specified address.- Parameters:
addr
- the address to look after- Returns:
- the defined data after the specified address, null if a defined data does not exist
-
getDefinedDataBefore
Returns the next defined data whose min address is closest to and less than the specified address.- Parameters:
addr
- the address to look before- Returns:
- the defined data before the specified address, null if a defined data does not exist
-
getDefinedDataContaining
Returns the defined data whose min address is less than or equal to the specified address and whose max address is greater than or equal to the specified address.data.minAddress() <= addr <= data.maxAddress()
- Parameters:
addr
- the address to be contained- Returns:
- the defined data containing the address, null if a defined data does not exist
-
getUndefinedRanges
public AddressSetView getUndefinedRanges(AddressSetView set, boolean initializedMemoryOnly, TaskMonitor monitor) throws CancelledException - Throws:
CancelledException
-
getUndefinedAt
Returns the undefined data whose min address equals the specified address.- Parameters:
address
- the min address of the undefined data to return- Returns:
- Data the undefined data at the address, null if undefined data does not exist
-
getFirstUndefinedDataAfter
Returns the next undefined data whose min address is greater than the specified address.- Parameters:
addr
- the address to look aftermonitor
- the task monitor- Returns:
- Data the undefined data after the address, null if a undefined data does not exist
-
getFirstUndefinedData
Returns the next undefined data whose min address falls within the address set searching in the forward direction(e.g., 0 -> 0xfff).
- Parameters:
set
- the address set to look within (required).monitor
- the current monitor.- Returns:
- the first undefined data within the address set, or null if there is none.
-
getFirstUndefinedDataBefore
Returns the next undefined data whose min address is closest to and less than the specified address.- Parameters:
addr
- the address to look beforemonitor
- the task monitor- Returns:
- the undefined data before the address, null if a undefined data does not exist
-
createCodeUnit
public Data createCodeUnit(Address addr, DataType dataType, int length) throws CodeUnitInsertionException Creates a data at the specified address.- Parameters:
addr
- Starting address of code unitdataType
- data prototype for the code unitlength
- the data length- Returns:
- the data
- Throws:
CodeUnitInsertionException
- if the code unit overlaps with an existing code unit
-
updateDataReferences
Update the data references on this data item. Get rid of any references first, then add in any new ones.- Parameters:
data
- the data object to be updated
-
clearComments
Clears all comments in the given range (inclusive). The specified start and end addresses must form a valid range within a singleAddressSpace
.- Parameters:
start
- the start address of the range to clearend
- the end address of the range to clear
-
clearProperties
public void clearProperties(Address start, Address end, TaskMonitor monitor) throws CancelledException Clears the properties in the given range (inclusive). The specified start and end addresses must form a valid range within a singleAddressSpace
.- Parameters:
start
- the start address of the range to clearend
- the end address of the range to clearmonitor
- the task monitor- Throws:
CancelledException
- if cancelled
-
clearCodeUnits
public void clearCodeUnits(Address start, Address end, boolean clearContext, TaskMonitor monitor) throws CancelledException Remove code units, symbols, equates, and references to code units in the given range (inclusive). Comments and comment history will be retained. The specified start and end addresses must form a valid range within a singleAddressSpace
.- Parameters:
start
- the start address of the range to clearend
- the end address of the range to clearclearContext
- if true all context-register values will be cleared over rangemonitor
- the task monitor- Throws:
CancelledException
- if cancelled
-
clearAll
Clear all code units in the program.- Parameters:
clearContext
- true to clear the contextmonitor
- the task monitor
-
getNumInstructions
public int getNumInstructions()Returns the number of instructions in the program.- Returns:
- the number of instructions in the program.
-
getNumDefinedData
public int getNumDefinedData()Returns the number of defined data in the program.- Returns:
- the number of defined data in the program.
-
getCompositeData
Returns a composite data iterator beginning at the specified start address.- Parameters:
start
- the address to begin iteratorforward
- true means get iterator in forward direction- Returns:
- the composite data iterator
-
getCompositeData
Returns a composite data iterator limited to the addresses in the specified address set.- Parameters:
addrSet
- the address set to limit the iteratorforward
- determines if the iterator will go from the lowest address to the highest or the other way around.- Returns:
- DataIterator the composite data iterator
-
getCodeUnits
Returns an iterator over all codeUnits in the program from the given start address to either the end address or the start address, depending if the iterator is forward or not.- Parameters:
start
- the starting address for the iterator.forward
- if true the iterator returns all codeUnits from the given start address to the end of the program, otherwise it returns all codeUnits from the given start address to the start of the program.- Returns:
- code unit iterator
-
getCodeUnits
Returns an iterator over all codeUnits in the given addressSet. The iterator will go from the lowest address to the largest or from the largest to the lowest depending on the forward parameter.- Parameters:
set
- the memory address set over which code units should be iterated (required)forward
- determines if the iterator goes from lowest address to highest or the other way around.- Returns:
- code unit iterator
-
getInstructions
Returns an iterator over all instructions in the program from the given start address to either the end address or the start address, depending if the iterator is forward or not.- Parameters:
address
- the starting address for the iterator.forward
- if true the iterator returns all instructions from the given start address to the end of the program, otherwise it returns all instructions from the given start address to the start of the program.- Returns:
- the iterator
-
getDefinedData
Returns an iterator over all defined data in the program from the given start address to either the end address or the start address, depending if the iterator is forward or not.- Parameters:
address
- the starting address for the iterator.forward
- if true the iterator returns all defined data from the given start address to the end of the program, otherwise it returns all defined data from the given start address to the start of the program.- Returns:
- the iterator
-
getInstructions
Returns an iterator over all instructions in the given addressSet. The iterator will go from the lowest address to the largest or from the largest to the lowest depending on the forward parameter.- Parameters:
set
- restrict the returned instructions to these addressesforward
- determines if the iterator goes from lowest address to highest or the other way around.- Returns:
- the iterator
-
getData
Returns an iterator over all data in the program from the given start address to either the end address or the start address, depending if the iterator is forward or not.- Parameters:
start
- the starting address for the iterator.forward
- if true the iterator returns all data from the given start address to the end of the program, otherwise it returns all data from the given start address to the start of the program.- Returns:
- the iterator
-
getData
Returns an iterator over all data in the given addressSet. The iterator will go from the lowest address to the largest or from the largest to the lowest depending on the forward parameter.- Parameters:
set
- restrict the returned instructions to these addressesforward
- determines if the iterator goes from lowest address to highest or the other way around.- Returns:
- the iterator
-
getDefinedData
Returns an iterator over all defined data in the given addressSet. The iterator will go from the lowest address to the largest or from the largest to the lowest depending on the forward parameter.- Parameters:
set
- restrict the returned instructions to these addressesforward
- determines if the iterator goes from lowest address to highest or the other way around.- Returns:
- the iterator
-
checkContextWrite
Check if any instruction intersects the specified address range. The specified start and end addresses must form a valid range within a singleAddressSpace
.- Parameters:
start
- start of rangeend
- end of range- Throws:
ContextChangeException
- if there is a context register change conflict
-
isUndefined
Checks if all the addresses from start to end have undefined data.- Parameters:
start
- the first address in the range to check.end
- the last address in the range to check.- Returns:
- true if all the addresses in the range have undefined data.
-
isUndefined
-
clearData
Removes any data objects that have dataTypes matching the given dataType ids.- Parameters:
dataTypeIDs
- the set ofDataType
IDs that have been deleted.monitor
- the task monitor.- Throws:
CancelledException
- if cancelled
-
getReferenceMgr
Returns the reference manager being used by this code manager.- Returns:
- ReferenceManager the reference manager being used by this code manager
-
getInstructionRecord
-
invalidateCache
public void invalidateCache(boolean all) Description copied from interface:ManagerDB
Clears all data caches.- Specified by:
invalidateCache
in interfaceManagerDB
- Parameters:
all
- if false, some managers may not need to update their cache if they can tell that its not necessary. If this flag is true, then all managers should clear their cache no matter what.
-
invalidateCodeUnitCache
public void invalidateCodeUnitCache()Invalidates the cache for the code units. -
memoryChanged
Notification that memory has changed, so clear the cache for the affected code units.- Parameters:
addr
- start of changeend
- end address of change
-
fallThroughChanged
Callback from ReferenceManager when a new fall-through reference is set.- Parameters:
fromAddr
- fall-through from locationnewFallThroughRef
- new fallthrough reference or null if removed
-
getComment
Get the comment for the given type at the specified address.- Parameters:
commentType
- either EOL_COMMENT, PRE_COMMENT, POST_COMMENT, PLATE_COMMENT, or REPEATABLE_COMMENTaddress
- the address of the comment.- Returns:
- the comment string of the appropriate type or null if no comment of that type exists for this code unit
- Throws:
IllegalArgumentException
- if type is not one of the types of comments supported
-
setComment
Set the comment for the given comment type at the specified address.- Parameters:
address
- the address of the comment.commentType
- either EOL_COMMENT, PRE_COMMENT, POST_COMMENT, PLATE_COMMENT, or REPEATABLE_COMMENTcomment
- comment to set at the address- Throws:
IllegalArgumentException
- if type is not one of the types of comments supported
-
getCommentHistory
Get the comment history for the comment type at the given address- Parameters:
addr
- address for the comment historycommentType
- comment type- Returns:
- zero length array if no history exists
-
replaceDataTypes
-
reDisassembleAllInstructions
public void reDisassembleAllInstructions(TaskMonitor monitor) throws IOException, CancelledException Complete language transformation of all instructions. All existing prototypes will be discarded and all instructions re-disassembled following flow and adjusting context as needed. Instructions which fail to re-disassemble will be marked - since only one byte will be skipped, such bad instruction disassembly may cause subsequent errors due to possible instruction shift.This method is only intended for use by the ProgramDB setLanguage method which must ensure that the context has been properly initialized.
- Parameters:
monitor
- task monitor- Throws:
IOException
- if IO error occursCancelledException
- if the operation is canceled.
-