Class DBTraceProgramView
- All Implemented Interfaces:
DataTypeManagerOwner,DomainObject,DataTypeManagerDomainObject,ProgramArchitecture,Program,TraceProgramView
- Direct Known Subclasses:
DBTraceVariableSnapProgramView
Program interface
NOTE: Calling CodeUnit.getProgram() from units contained in this view may not necessarily
return this same view. If the code unit comes from a less-recent snap than the snap associated
with this view, the view for that snap is returned instead.
TODO: Unit tests for all of this.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DBTraceProgramViewBookmarkManagerstatic final intprotected final DBTraceProgramViewChangeSetprotected final CompilerSpecprotected final DBTraceProgramViewEquateTableprotected final DomainObjectEventQueuesprotected DBTraceProgramView.EventTranslatorprotected final DBTraceProgramViewFunctionManagerprotected final Languageprotected final LanguageIDprotected final DBTraceProgramViewListingprotected final DBTraceProgramViewMemoryprotected InternalTracePlatformprotected final DBTraceProgramViewProgramContextprotected final DBTraceProgramViewPropertyMapManagerprotected final DBTraceProgramViewReferenceManagerprotected longprotected final DBTraceProgramViewSymbolTablestatic final intprotected final DBTraceprotected final DBTraceTimeViewportprotected final RunnableFields inherited from interface ghidra.framework.model.DomainObject
DO_DOMAIN_FILE_CHANGED, DO_OBJECT_CLOSED, DO_OBJECT_ERROR, DO_OBJECT_RENAMED, DO_OBJECT_RESTORED, DO_OBJECT_SAVED, DO_PROPERTY_CHANGED, undoLockFields inherited from interface ghidra.program.model.listing.Program
ANALYSIS_PROPERTIES, ANALYSIS_START_DATE, ANALYSIS_START_DATE_FORMAT, ANALYZED_OPTION_NAME, ASK_TO_ANALYZE_OPTION_NAME, CREATED_WITH_GHIDRA_VERSION, DATE_CREATED, DISASSEMBLER_PROPERTIES, JANUARY_1_1970, MAX_OPERANDS, PREFERRED_ROOT_NAMESPACE_CATEGORY_PROPERTY, PROGRAM_INFO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseListener(DomainObjectClosedListener listener) Adds a listener that will be notified when this DomainObject is closed.booleanaddConsumer(Object consumer) Adds the given object as a consumer.voidAdds a listener that will be notified when this DomainFile associated with this DomainObject changes, such as when a 'Save As' action occurs.voidAdds a listener for this object.voidaddSynchronizedDomainObject(DomainObject domainObj) Synchronize the specified domain object with this domain object using a shared transaction manager.voidaddTransactionListener(TransactionListener listener) Adds the given transaction listener to this domain objectprotected booleanbytesDifferForSet(byte[] b1, byte[] b2, AddressSetView set) booleancanLock()Returns true if a modification lock can be obtained on this domain object.booleancanRedo()Returns true if there is a later state to "redo" to..booleancanSave()Returns true if this object can be saved; a read-only file cannot be saved.booleancanUndo()Returns true if there is a previous state to "undo" to..protected voidvoidClear all undoable/redoable transactionsCreate a new AddressSetPropertyMap with the specified name.createIntRangeMap(String name) Create a new IntRangeMap with the specified name.createOverlaySpace(String overlaySpaceName, AddressSpace baseSpace) Create a new overlay space based upon the given base AddressSpacecreatePrivateEventQueue(DomainObjectListener listener, int maxDelay) Creates a private event queue that can be flushed independently from the main event queue.voidRemove the property map from the program.voiddeleteIntRangeMap(String name) Remove the property map from the program.booleanendTransaction(int transactionID, boolean commit) Terminate the specified transaction for this domain object.protected voidprotected voidFires object-restored event on this view and all associated register views.voidMakes sure all pending domainEvents have been sent.voidFlush events from the specified event queue.voidForce transaction lock and terminate current transaction.Returns the AddressFactory for this program.Get the internal program address mapGet the property map with the given name.protected AddressSetViewReturns a list of the names of all current redo transactionsReturns a list of the names of all current undo transactionsGet the bookmark manager.Get the program changes since the last save as a set of addresses.protected TraceTimeViewport.Occlusion<TraceCodeUnit> getCodeOcclusion(AddressSpace space) Gets the name of the compiler believed to have been used to create this program.Returns the CompilerSpec currently used by this program.Returns the list of consumers on this domainObjectReturns the creation date of this program.Returns the current transaction infoReturns the program's datatype manager.intGets the default pointer size in bytes as it may be stored within the program listing.Returns a word or short phrase that best describes or categorizes the object in terms that a user will understand.Get the domain file for this domain object.Get the equate table object.protected DomainObjectEventQueuesgetEventQueues(AddressSpace space) protected DBTraceProgramView.EventTranslatorReturns a value corresponding to the original file format.Returns a value corresponding to the original binary file MD5 hash.Gets the path to the program's executable file.Returns a value corresponding to the original binary file SHA256 hash.Returns the external manager.Returns the programs function manager.Returns the global namespace for this programReturns the current program image base addressgetIntRangeMap(String name) Get the property map with the given name.Returns the language used by this program.Return the name of the language used by this program.Get the listing object.Get the programs maximum address.Get the trace's latest snapGet the memory object.Returns a map containing all the stored metadata associated with this domain object.Get the program's minimum address.longReturns a long value that gets incremented every time a change, undo, or redo takes place.getName()Get the name of this domain object.getOptions(String propertyListName) Get the property list for the given name.Returns all properties lists contained by this domain object.Gets the preferred root data type category path which corresponds to the global namespace of a namespace-based storage area.Returns the program context.Returns the user-specific data manager for this program.Returns a description of the change that would be "redone".Get the reference manager.getRegister(Address addr) Returns the largest register located at the specified addressgetRegister(Address addr, int size) Returns a specific register based upon its address and sizegetRegister(Varnode varnode) Returns the register which corresponds to the specified varnodegetRegister(String name) Returns the register with the given name;Register[]getRegisters(Address addr) Returns all registers located at the specified addressGets the relocation table.longgetSnap()Get the current snapGet the symbol table object.Return array of all domain objects synchronized with a shared transaction manager.protected <T extends TraceCodeUnit>
TgetTopCode(Address address, BiFunction<TraceCodeSpace, Long, T> codeFunc) getTrace()Get the trace this view presentsReturns a description of the change that would be "undone".longReturns an ID that is unique for this program.Get the user propertyMangager stored with this program.Get the viewport this view is using for forked queriesbooleanReturns true if the user has exclusive access to the domain object.booleanReturns true if the last transaction was terminated from the action that started it.protected DomainObjectEventQueuesisBookmarkVisible(AddressSpace space, TraceBookmark bm) protected booleanisBookmarkVisible(TraceBookmark bm, Lifespan lifespan) protected DomainObjectEventQueuesisBytesVisible(AddressSpace space, TraceAddressSnapRange range) booleanReturns true if changes are permitted.booleanReturns whether the object has changed.booleanisClosed()Returns true if this domain object has been closed as a result of the last releaseprotected DomainObjectEventQueuesisCodeVisible(AddressSpace space, TraceCodeUnit cu) protected booleanisCodeVisible(AddressSpace space, TraceAddressSnapRange range) protected booleanisCodeVisible(TraceCodeUnit cu, Lifespan lifespan) booleanisLocked()Returns true if the domain object currently has a modification lock enabled.booleanReturns true if this object is sending out events as it is changed.protected DomainObjectEventQueuesisSymbolVisible(AddressSpace space, TraceSymbol symbol) protected booleanisSymbolWithLifespanVisible(TraceSymbolWithLifespan symbol, Lifespan lifespan) booleanReturns true if this object has been marked as Temporary.booleanReturns true if the given consumer is using (has open) this domain object.protected DomainObjectEventQueuesisVisible(AddressSpace space, TraceAddressSnapRange range) booleanAttempt to obtain a modification lock on the domain object.openTransaction(String description) Open new transaction.Address[]parseAddress(String addrStr) Return an array of Addresses that could represent the given string.Address[]parseAddress(String addrStr, boolean caseSensitive) Return an array of Addresses that could represent the given string.voidredo()Returns to a latter state that exists because of an undo.voidNotify the domain object that the specified consumer is no longer using it.voidRemove this domain object from a shared transaction manager.voidRemoves the given close listener.voidRemoves the given DomainObjectFileListener listener.voidRemove the listener for this object.booleanremoveOverlaySpace(String overlaySpaceName) Remove the specified overlay address space from this program.booleanRemoves the specified private event queuevoidremoveTransactionListener(TransactionListener listener) Removes the given transaction listener from this domain object.voidrenameOverlaySpace(String oldOverlaySpaceName, String newName) Rename an existing overlay address space.voidRestores the last committed image base.voidsave(String comment, TaskMonitor monitor) Saves changes to the DomainFile.voidsaveToPackedFile(File outputFile, TaskMonitor monitor) Saves (i.e., serializes) the current content to a packed file.voidsetCompiler(String compiler) Sets the name of the compiler which created this program.voidsetEventsEnabled(boolean enabled) If true, domain object change events are sent.voidsetExecutableFormat(String format) Sets the value corresponding to the original file format.voidsetExecutableMD5(String md5) Sets the value corresponding to the original binary file MD5 hash.voidsetExecutablePath(String path) Sets the path to the program's executable file.voidsetExecutableSHA256(String sha256) Sets the value corresponding to the original binary file SHA256 hash.voidsetImageBase(Address base, boolean commit) Sets the program's image base address.voidsetLanguage(Language language, CompilerSpecID compilerSpecID, boolean forceRedisassembly, TaskMonitor monitor) Sets the language for the program.voidSet the name for this domain object.voidsetPreferredRootNamespaceCategoryPath(String categoryPath) Sets the preferred data type category path which corresponds to the root of a namespace hierarchy storage area.voidsetTemporary(boolean state) Set the temporary state of this object.intstartTransaction(String description) Start a new transaction in order to make changes to this domain object.intstartTransaction(String description, AbortedTransactionListener listener) Start a new transaction in order to make changes to this domain object.toString()voidundo()Returns to the previous state.voidunlock()Release a modification lock previously granted with the lock method.voidupdateBytesChanged(AddressRange range) voidvoidvoidupdateMemoryChangeRegionBlockFlags(TraceMemoryRegion region, Lifespan lifespan) voidupdateMemoryChangeRegionBlockLifespan(TraceMemoryRegion region, Lifespan oldLifespan, Lifespan newLifespan) voidvoidupdateMemoryChangeRegionBlockRange(TraceMemoryRegion region, AddressRange oldRange, AddressRange newRange) voidvoidvoidprotected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.framework.model.DomainObject
withTransaction, withTransactionMethods inherited from interface ghidra.program.model.listing.Program
getSourceFileManagerMethods inherited from interface ghidra.program.model.lang.ProgramArchitecture
getLanguageCompilerSpecPair
-
Field Details
-
TIME_INTERVAL
public static final int TIME_INTERVAL- See Also:
-
BUF_SIZE
public static final int BUF_SIZE- See Also:
-
trace
-
languageID
-
language
-
compilerSpec
-
eventQueues
-
eventTranslator
-
bookmarkManager
-
equateTable
-
functionManager
-
listing
-
memory
-
programContext
-
propertyMapManager
-
referenceManager
-
symbolTable
-
changes
-
snap
protected long snap -
platform
-
viewport
-
viewportChangeListener
-
-
Constructor Details
-
DBTraceProgramView
-
-
Method Details
-
checkRefreshAllAddresses
protected void checkRefreshAllAddresses() -
getAllAddresses
-
viewportChanged
protected void viewportChanged() -
fireEventAllViews
-
fireObjectRestored
protected void fireObjectRestored()Fires object-restored event on this view and all associated register views. -
toString
-
getTrace
Description copied from interface:TraceProgramViewGet the trace this view presents- Specified by:
getTracein interfaceTraceProgramView- Returns:
- the trace
-
getSnap
public long getSnap()Description copied from interface:TraceProgramViewGet the current snap- Specified by:
getSnapin interfaceTraceProgramView- Returns:
- the snap
-
getViewport
Description copied from interface:TraceProgramViewGet the viewport this view is using for forked queries- Specified by:
getViewportin interfaceTraceProgramView- Returns:
- the viewport
-
getMaxSnap
Description copied from interface:TraceProgramViewGet the trace's latest snap- Specified by:
getMaxSnapin interfaceTraceProgramView- Returns:
- the maximum snap
-
getListing
Description copied from interface:ProgramGet the listing object.- Specified by:
getListingin interfaceProgram- Returns:
- the Listing interface to the listing object.
-
getAddressMap
Description copied from interface:ProgramGet the internal program address map- Specified by:
getAddressMapin interfaceProgram- Returns:
- internal address map
-
getDataTypeManager
Description copied from interface:ProgramReturns the program's datatype manager.- Specified by:
getDataTypeManagerin interfaceDataTypeManagerOwner- Specified by:
getDataTypeManagerin interfaceProgram- Returns:
- the data type manager.
-
getFunctionManager
Description copied from interface:ProgramReturns the programs function manager.- Specified by:
getFunctionManagerin interfaceProgram- Returns:
- the function manager
-
getProgramUserData
Description copied from interface:ProgramReturns the user-specific data manager for this program.- Specified by:
getProgramUserDatain interfaceProgram- Returns:
- the program-specific user data manager
-
getSymbolTable
Description copied from interface:ProgramGet the symbol table object.- Specified by:
getSymbolTablein interfaceProgram- Returns:
- the symbol table object.
-
getExternalManager
Description copied from interface:ProgramReturns the external manager.- Specified by:
getExternalManagerin interfaceProgram- Returns:
- the external manager
-
getEquateTable
Description copied from interface:ProgramGet the equate table object.- Specified by:
getEquateTablein interfaceProgram- Returns:
- the equate table.
-
getMemory
Description copied from interface:ProgramGet the memory object.- Specified by:
getMemoryin interfaceProgram- Specified by:
getMemoryin interfaceTraceProgramView- Returns:
- the memory object.
-
getReferenceManager
Description copied from interface:ProgramGet the reference manager.- Specified by:
getReferenceManagerin interfaceProgram- Returns:
- the reference manager
-
getBookmarkManager
Description copied from interface:ProgramGet the bookmark manager.- Specified by:
getBookmarkManagerin interfaceProgram- Returns:
- the bookmark manager
-
getDefaultPointerSize
public int getDefaultPointerSize()Description copied from interface:ProgramGets the default pointer size in bytes as it may be stored within the program listing.- Specified by:
getDefaultPointerSizein interfaceProgram- Returns:
- default pointer size.
- See Also:
-
getCompiler
Description copied from interface:ProgramGets the name of the compiler believed to have been used to create this program. If the compiler hasn't been determined then "unknown" is returned.- Specified by:
getCompilerin interfaceProgram- Returns:
- name of the compiler or "unknown".
-
setCompiler
Description copied from interface:ProgramSets the name of the compiler which created this program.- Specified by:
setCompilerin interfaceProgram- Parameters:
compiler- the name
-
getPreferredRootNamespaceCategoryPath
Description copied from interface:ProgramGets the preferred root data type category path which corresponds to the global namespace of a namespace-based storage area. Preference will be given to this category when searching for data types within a specific namespace. This setting corresponds to the Program Information option "Preferred Root Namespace Category. SeeDataTypeUtilitiesand its various find methods for its usage details.- Specified by:
getPreferredRootNamespaceCategoryPathin interfaceProgram- Returns:
- data type category path for root namespace or null if not set or is invalid.
-
setPreferredRootNamespaceCategoryPath
Description copied from interface:ProgramSets the preferred data type category path which corresponds to the root of a namespace hierarchy storage area. Preference will be given to this category when searching for data types within a specific namespace. This setting corresponds to the Program Information option "Preferred Root Namespace Category. SeeDataTypeUtilitiesand its various find methods for its usage details.- Specified by:
setPreferredRootNamespaceCategoryPathin interfaceProgram- Parameters:
categoryPath- data type category path for root namespace or null to clear option. The specified path must be absolute and start with "/" and must not end with one (e.g., /ClassDataTypes). An invalid path setting will be ignored.
-
getExecutablePath
Description copied from interface:ProgramGets the path to the program's executable file. For example,/home/user/foo.exe. This will allow plugins to execute the program.NOTE: The format of the path is not guaranteed to follow any standard naming conventions. If used for anything other than display purpose, callers of this method should take extra steps to ensure the path is in a form suitable for their needs.
- Specified by:
getExecutablePathin interfaceProgram- Returns:
- String path to program's exe file
-
setExecutablePath
Description copied from interface:ProgramSets the path to the program's executable file. For example,/home/user/foo.exe.- Specified by:
setExecutablePathin interfaceProgram- Parameters:
path- the path to the program's exe
-
getExecutableFormat
Description copied from interface:ProgramReturns a value corresponding to the original file format.- Specified by:
getExecutableFormatin interfaceProgram- Returns:
- original file format used to load program or null if unknown
-
setExecutableFormat
Description copied from interface:ProgramSets the value corresponding to the original file format.- Specified by:
setExecutableFormatin interfaceProgram- Parameters:
format- the binary file format string to set.
-
getExecutableMD5
Description copied from interface:ProgramReturns a value corresponding to the original binary file MD5 hash.- Specified by:
getExecutableMD5in interfaceProgram- Returns:
- original loaded file MD5 or null
-
setExecutableMD5
Description copied from interface:ProgramSets the value corresponding to the original binary file MD5 hash.- Specified by:
setExecutableMD5in interfaceProgram- Parameters:
md5- MD5 binary file hash
-
getExecutableSHA256
Description copied from interface:ProgramReturns a value corresponding to the original binary file SHA256 hash.- Specified by:
getExecutableSHA256in interfaceProgram- Returns:
- original loaded file SHA256 or null
-
setExecutableSHA256
Description copied from interface:ProgramSets the value corresponding to the original binary file SHA256 hash.- Specified by:
setExecutableSHA256in interfaceProgram- Parameters:
sha256- SHA256 binary file hash
-
getCreationDate
Description copied from interface:ProgramReturns the creation date of this program. If the program was created before this property existed, then Jan 1, 1970 is returned.- Specified by:
getCreationDatein interfaceProgram- Returns:
- the creation date of this program
-
getRelocationTable
Description copied from interface:ProgramGets the relocation table.- Specified by:
getRelocationTablein interfaceProgram- Returns:
- relocation table object
-
getLanguage
Description copied from interface:ProgramReturns the language used by this program.- Specified by:
getLanguagein interfaceProgram- Specified by:
getLanguagein interfaceProgramArchitecture- Returns:
- the language used by this program.
-
getCompilerSpec
Description copied from interface:ProgramReturns the CompilerSpec currently used by this program.- Specified by:
getCompilerSpecin interfaceProgram- Specified by:
getCompilerSpecin interfaceProgramArchitecture- Returns:
- the compilerSpec currently used by this program.
-
getLanguageID
Description copied from interface:ProgramReturn the name of the language used by this program.- Specified by:
getLanguageIDin interfaceProgram- Returns:
- the name of the language
-
getUsrPropertyManager
Description copied from interface:ProgramGet the user propertyMangager stored with this program. The user property manager is used to store arbitrary address indexed information associated with the program.- Specified by:
getUsrPropertyManagerin interfaceProgram- Returns:
- the user property manager.
-
getProgramContext
Description copied from interface:ProgramReturns the program context.- Specified by:
getProgramContextin interfaceProgram- Returns:
- the program context object
-
getMinAddress
Description copied from interface:ProgramGet the program's minimum address. NOTE: AnAddressRangeshould generally not be formed using this address andProgram.getMaxAddress()since it may span multipleAddressSpaces.- Specified by:
getMinAddressin interfaceProgram- Returns:
- the program's minimum address or null if no memory blocks have been defined in the program.
-
getMaxAddress
Description copied from interface:ProgramGet the programs maximum address. NOTE: AnAddressRangeshould generally not be formed using this address andProgram.getMinAddress()since it may span multipleAddressSpaces.- Specified by:
getMaxAddressin interfaceProgram- Returns:
- the program's maximum address or null if no memory blocks have been defined in the program.
-
getChanges
Description copied from interface:ProgramGet the program changes since the last save as a set of addresses.- Specified by:
getChangesin interfaceProgram- Returns:
- set of changed addresses within program.
-
createOverlaySpace
public ProgramOverlayAddressSpace createOverlaySpace(String overlaySpaceName, AddressSpace baseSpace) throws IllegalStateException, DuplicateNameException, InvalidNameException, LockException Description copied from interface:ProgramCreate a new overlay space based upon the given base AddressSpace- Specified by:
createOverlaySpacein interfaceProgram- Parameters:
overlaySpaceName- the name of the new overlay space.baseSpace- the base AddressSpace to overlay (i.e., overlayed-space)- Returns:
- the new overlay space
- Throws:
IllegalStateException- if image base override is activeDuplicateNameException- if an address space already exists with specified overlaySpaceName.InvalidNameException- if overlaySpaceName contains invalid charactersLockException- if the program is shared and not checked out exclusively.
-
renameOverlaySpace
public void renameOverlaySpace(String oldOverlaySpaceName, String newName) throws NotFoundException, InvalidNameException, DuplicateNameException, LockException Description copied from interface:ProgramRename an existing overlay address space. NOTE: This experimental method has known limitations with existingAddressandAddressSpaceobjects following an undo/redo which may continue to refer to the old overlay name which may lead to unxpected errors.- Specified by:
renameOverlaySpacein interfaceProgram- Parameters:
oldOverlaySpaceName- overlay address space namenewName- new name for overlay- Throws:
NotFoundException- if the specified overlay space was not foundInvalidNameException- if new name is invalidDuplicateNameException- if new name already used by another address spaceLockException- if program does not has exclusive access
-
removeOverlaySpace
Description copied from interface:ProgramRemove the specified overlay address space from this program.- Specified by:
removeOverlaySpacein interfaceProgram- Parameters:
overlaySpaceName- overlay address space name- Returns:
- true if successfully removed, else false if blocks still make use of overlay space.
- Throws:
LockException- if program does not has exclusive accessNotFoundException- if specified overlay space not found in program
-
getAddressFactory
Description copied from interface:ProgramReturns the AddressFactory for this program.- Specified by:
getAddressFactoryin interfaceProgram- Specified by:
getAddressFactoryin interfaceProgramArchitecture- Returns:
- the program address factory
-
parseAddress
Description copied from interface:ProgramReturn an array of Addresses that could represent the given string.- Specified by:
parseAddressin interfaceProgram- Parameters:
addrStr- the string to parse.- Returns:
- zero length array if addrStr is properly formatted but no matching addresses were found or if the address is improperly formatted.
-
parseAddress
Description copied from interface:ProgramReturn an array of Addresses that could represent the given string.- Specified by:
parseAddressin interfaceProgram- Parameters:
addrStr- the string to parse.caseSensitive- whether or not to process any addressSpace names as case sensitive.- Returns:
- zero length array if addrStr is properly formatted but no matching addresses were found or if the address is improperly formatted.
-
getRegister
Description copied from interface:ProgramReturns the register with the given name;- Specified by:
getRegisterin interfaceProgram- Parameters:
name- the name of the register to retrieve- Returns:
- register or null
-
getRegister
Description copied from interface:ProgramReturns the largest register located at the specified address- Specified by:
getRegisterin interfaceProgram- Parameters:
addr- register minimum address- Returns:
- largest register at addr or null
-
getRegisters
Description copied from interface:ProgramReturns all registers located at the specified address- Specified by:
getRegistersin interfaceProgram- Parameters:
addr- register minimum address- Returns:
- all registers at addr
-
getRegister
Description copied from interface:ProgramReturns a specific register based upon its address and size- Specified by:
getRegisterin interfaceProgram- Parameters:
addr- register addresssize- the size of the register (in bytes);- Returns:
- register or null
-
getRegister
Description copied from interface:ProgramReturns the register which corresponds to the specified varnode- Specified by:
getRegisterin interfaceProgram- Parameters:
varnode- the varnode- Returns:
- register or null
-
getImageBase
Description copied from interface:ProgramReturns the current program image base address- Specified by:
getImageBasein interfaceProgram- Returns:
- program image base address within default space
-
setImageBase
public void setImageBase(Address base, boolean commit) throws AddressOverflowException, LockException, IllegalStateException Description copied from interface:ProgramSets the program's image base address.- Specified by:
setImageBasein interfaceProgram- Parameters:
base- the new image base address;commit- if false, then the image base change is temporary and does not really change the program and will be lost once the program is closed. If true, the change is permanent and marks the program as "changed" (needs saving).- Throws:
AddressOverflowException- if the new image would cause a memory block to end past the the address space.LockException- if the program is shared and the user does not have an exclusive checkout. This will never be thrown if commit is false.IllegalStateException- if the program state is not suitable for setting the image base.
-
restoreImageBase
public void restoreImageBase()Description copied from interface:ProgramRestores the last committed image base.- Specified by:
restoreImageBasein interfaceProgram
-
setLanguage
public void setLanguage(Language language, CompilerSpecID compilerSpecID, boolean forceRedisassembly, TaskMonitor monitor) throws IllegalStateException, IncompatibleLanguageException, LockException Description copied from interface:ProgramSets the language for the program. If the new language is "compatible" with the old language, the addressMap is adjusted then the program is "re-disassembled".- Specified by:
setLanguagein interfaceProgram- Parameters:
language- the new language to use.compilerSpecID- the new compiler specification IDforceRedisassembly- if true a redisassembly will be forced. This should always be false.monitor- the task monitor- Throws:
IllegalStateException- thrown if any error occurs, including a cancelled monitor, which leaves this program object in an unusable state. The current transaction should be aborted and the program instance discarded.IncompatibleLanguageException- thrown if the new language is too different from the existing language.LockException- if the program is shared and not checked out exclusively.
-
getGlobalNamespace
Description copied from interface:ProgramReturns the global namespace for this program- Specified by:
getGlobalNamespacein interfaceProgram- Returns:
- the global namespace
-
createAddressSetPropertyMap
Description copied from interface:ProgramCreate a new AddressSetPropertyMap with the specified name.- Specified by:
createAddressSetPropertyMapin interfaceProgram- Parameters:
name- name of the property map.- Returns:
- the newly created property map.
- Throws:
DuplicateNameException- if a property map already exists with the given name.
-
createIntRangeMap
Description copied from interface:ProgramCreate a new IntRangeMap with the specified name.- Specified by:
createIntRangeMapin interfaceProgram- Parameters:
name- name of the property map.- Returns:
- the newly created property map.
- Throws:
DuplicateNameException- if a property map already exists with the given name.
-
getAddressSetPropertyMap
Description copied from interface:ProgramGet the property map with the given name.- Specified by:
getAddressSetPropertyMapin interfaceProgram- Parameters:
name- name of the property map- Returns:
- null if no property map exist with the given name
-
getIntRangeMap
Description copied from interface:ProgramGet the property map with the given name.- Specified by:
getIntRangeMapin interfaceProgram- Parameters:
name- name of the property map- Returns:
- null if no property map exist with the given name
-
deleteAddressSetPropertyMap
Description copied from interface:ProgramRemove the property map from the program.- Specified by:
deleteAddressSetPropertyMapin interfaceProgram- Parameters:
name- name of the property map to remove
-
deleteIntRangeMap
Description copied from interface:ProgramRemove the property map from the program.- Specified by:
deleteIntRangeMapin interfaceProgram- Parameters:
name- name of the property map to remove
-
getUniqueProgramID
public long getUniqueProgramID()Description copied from interface:ProgramReturns an ID that is unique for this program. This provides an easy way to store references to a program across client persistence.- Specified by:
getUniqueProgramIDin interfaceProgram- Returns:
- unique program ID
-
openTransaction
Description copied from interface:DomainObjectOpen new transaction. This should generally be done with a try-with-resources block:try (Transaction tx = dobj.openTransaction(description)) { // ... Do something }- Specified by:
openTransactionin interfaceDomainObject- Parameters:
description- a short description of the changes to be made.- Returns:
- transaction object
- Throws:
IllegalStateException- if thisDomainObjecthas already been closed.
-
startTransaction
Description copied from interface:DomainObjectStart a new transaction in order to make changes to this domain object. All changes must be made in the context of a transaction. If a transaction is already in progress, a sub-transaction of the current transaction will be returned.- Specified by:
startTransactionin interfaceDomainObject- Parameters:
description- brief description of transaction- Returns:
- transaction ID
-
startTransaction
Description copied from interface:DomainObjectStart a new transaction in order to make changes to this domain object. All changes must be made in the context of a transaction. If a transaction is already in progress, a sub-transaction of the current transaction will be returned.- Specified by:
startTransactionin interfaceDomainObject- Parameters:
description- brief description of transactionlistener- listener to be notified if the transaction is aborted.- Returns:
- transaction ID
-
endTransaction
public boolean endTransaction(int transactionID, boolean commit) Description copied from interface:DomainObjectTerminate the specified transaction for this domain object.NOTE: If multiple transactions are outstanding the full transaction will not be ended until all transactions have been ended. If any of the transactions indicate a false for
committhe transaction will ultimately be rolled-back when the final transaction is ended.NOTE: Use of rollback (
commit=falseshould be avoided unless absolutely neccessary since it will incur overhead to revert changes and may rollback multiple concurrent transactions if they exist.- Specified by:
endTransactionin interfaceDomainObject- Parameters:
transactionID- transaction ID obtained from startTransaction methodcommit- if true the changes made in this transaction will be marked for commit, if false this and any concurrent transaction will be rolled-back.- Returns:
- true if this invocation was the final transaction and all changes were comitted.
-
getCurrentTransactionInfo
Description copied from interface:DomainObjectReturns the current transaction info- Specified by:
getCurrentTransactionInfoin interfaceDomainObject- Returns:
- the current transaction info
-
hasTerminatedTransaction
public boolean hasTerminatedTransaction()Description copied from interface:DomainObjectReturns true if the last transaction was terminated from the action that started it.- Specified by:
hasTerminatedTransactionin interfaceDomainObject- Returns:
- true if the last transaction was terminated from the action that started it.
-
getSynchronizedDomainObjects
Description copied from interface:DomainObjectReturn array of all domain objects synchronized with a shared transaction manager.- Specified by:
getSynchronizedDomainObjectsin interfaceDomainObject- Returns:
- returns array of synchronized domain objects or null if this domain object is not synchronized with others.
-
addSynchronizedDomainObject
Description copied from interface:DomainObjectSynchronize the specified domain object with this domain object using a shared transaction manager. If either or both is already shared, a transition to a single shared transaction manager will be performed.- Specified by:
addSynchronizedDomainObjectin interfaceDomainObject- Parameters:
domainObj- the domain object- Throws:
LockException- if lock or open transaction is active on either this or the specified domain object
-
releaseSynchronizedDomainObject
Description copied from interface:DomainObjectRemove this domain object from a shared transaction manager. If this object has not been synchronized with others via a shared transaction manager, this method will have no affect.- Specified by:
releaseSynchronizedDomainObjectin interfaceDomainObject- Throws:
LockException- if lock or open transaction is active
-
isChanged
public boolean isChanged()Description copied from interface:DomainObjectReturns whether the object has changed.- Specified by:
isChangedin interfaceDomainObject- Returns:
- whether the object has changed.
-
setTemporary
public void setTemporary(boolean state) Description copied from interface:DomainObjectSet the temporary state of this object. If this object is temporary, the isChanged() method will always return false. The default temporary state is false.- Specified by:
setTemporaryin interfaceDomainObject- Parameters:
state- if true object is marked as temporary
-
isTemporary
public boolean isTemporary()Description copied from interface:DomainObjectReturns true if this object has been marked as Temporary.- Specified by:
isTemporaryin interfaceDomainObject- Returns:
- true if this object has been marked as Temporary.
-
isChangeable
public boolean isChangeable()Description copied from interface:DomainObjectReturns true if changes are permitted.- Specified by:
isChangeablein interfaceDomainObject- Returns:
- true if changes are permitted.
-
canSave
public boolean canSave()Description copied from interface:DomainObjectReturns true if this object can be saved; a read-only file cannot be saved.- Specified by:
canSavein interfaceDomainObject- Returns:
- true if this object can be saved
-
save
Description copied from interface:DomainObjectSaves changes to the DomainFile.- Specified by:
savein interfaceDomainObject- Parameters:
comment- comment used for new versionmonitor- monitor that shows the progress of the save- Throws:
IOException- thrown if there was an error accessing this domain objectCancelledException- thrown if the user canceled the save operation
-
saveToPackedFile
public void saveToPackedFile(File outputFile, TaskMonitor monitor) throws IOException, CancelledException Description copied from interface:DomainObjectSaves (i.e., serializes) the current content to a packed file.- Specified by:
saveToPackedFilein interfaceDomainObject- Parameters:
outputFile- packed output filemonitor- progress monitor- Throws:
IOException- if an exception occursCancelledException- if the user cancels
-
getEventTranslator
-
addListener
Description copied from interface:DomainObjectAdds a listener for this object.- Specified by:
addListenerin interfaceDomainObject- Parameters:
dol- listener notified when any change occurs to this domain object
-
removeListener
Description copied from interface:DomainObjectRemove the listener for this object.- Specified by:
removeListenerin interfaceDomainObject- Parameters:
dol- listener
-
addCloseListener
Description copied from interface:DomainObjectAdds a listener that will be notified when this DomainObject is closed. This is meant for clients to have a chance to cleanup, such as reference removal.- Specified by:
addCloseListenerin interfaceDomainObject- Parameters:
listener- the reference to add
-
removeCloseListener
Description copied from interface:DomainObjectRemoves the given close listener.- Specified by:
removeCloseListenerin interfaceDomainObject- Parameters:
listener- the listener to remove.
-
addDomainFileListener
Description copied from interface:DomainObjectAdds a listener that will be notified when this DomainFile associated with this DomainObject changes, such as when a 'Save As' action occurs. Unlike DomainObject events, these notifications are not buffered and happen immediately when the DomainFile is changed.- Specified by:
addDomainFileListenerin interfaceDomainObject- Parameters:
listener- the listener to be notified when the associated DomainFile changes
-
removeDomainFileListener
Description copied from interface:DomainObjectRemoves the given DomainObjectFileListener listener.- Specified by:
removeDomainFileListenerin interfaceDomainObject- Parameters:
listener- the listener to remove.
-
createPrivateEventQueue
Description copied from interface:DomainObjectCreates a private event queue that can be flushed independently from the main event queue.- Specified by:
createPrivateEventQueuein interfaceDomainObject- Parameters:
listener- the listener to be notified of domain object events.maxDelay- the time interval (in milliseconds) used to buffer events.- Returns:
- a unique identifier for this private queue.
-
removePrivateEventQueue
Description copied from interface:DomainObjectRemoves the specified private event queue- Specified by:
removePrivateEventQueuein interfaceDomainObject- Parameters:
id- the id of the queue to remove.- Returns:
- true if the id represents a valid queue that was removed.
-
getDescription
Description copied from interface:DomainObjectReturns a word or short phrase that best describes or categorizes the object in terms that a user will understand.- Specified by:
getDescriptionin interfaceDomainObject- Returns:
- the description
-
getName
Description copied from interface:DomainObjectGet the name of this domain object.- Specified by:
getNamein interfaceDomainObject- Returns:
- the name
-
setName
Description copied from interface:DomainObjectSet the name for this domain object.- Specified by:
setNamein interfaceDomainObject- Parameters:
name- object name
-
getDomainFile
Description copied from interface:DomainObjectGet the domain file for this domain object.- Specified by:
getDomainFilein interfaceDomainObject- Returns:
- the associated domain file
-
addConsumer
Description copied from interface:DomainObjectAdds the given object as a consumer. The release method must be invoked with this same consumer instance when this domain object is no longer in-use.- Specified by:
addConsumerin interfaceDomainObject- Parameters:
consumer- domain object consumer- Returns:
- false if this domain object has already been closed
-
getConsumerList
Description copied from interface:DomainObjectReturns the list of consumers on this domainObject- Specified by:
getConsumerListin interfaceDomainObject- Returns:
- the list of consumers.
-
isUsedBy
Description copied from interface:DomainObjectReturns true if the given consumer is using (has open) this domain object.- Specified by:
isUsedByin interfaceDomainObject- Parameters:
consumer- the object to test to see if it is a consumer of this domain object.- Returns:
- true if the given consumer is using (has open) this domain object;
-
release
Description copied from interface:DomainObjectNotify the domain object that the specified consumer is no longer using it. When the last consumer invokes this method, the domain object will be closed and will become invalid.- Specified by:
releasein interfaceDomainObject- Parameters:
consumer- the consumer (e.g., tool, plugin, etc) of the domain object previously established with the addConsumer method.
-
setEventsEnabled
public void setEventsEnabled(boolean enabled) Description copied from interface:DomainObjectIf true, domain object change events are sent. If false, no events are sent.NOTE: disabling events could cause plugins to be out of sync!
NOTE: when re-enabling events, an event will be sent to the system to signal that every listener should update.
- Specified by:
setEventsEnabledin interfaceDomainObject- Parameters:
enabled- true means to enable events
-
isSendingEvents
public boolean isSendingEvents()Description copied from interface:DomainObjectReturns true if this object is sending out events as it is changed. The default is true. You can change this value by callingDomainObject.setEventsEnabled(boolean).- Specified by:
isSendingEventsin interfaceDomainObject- Returns:
- true if sending events
- See Also:
-
flushEvents
public void flushEvents()Description copied from interface:DomainObjectMakes sure all pending domainEvents have been sent.- Specified by:
flushEventsin interfaceDomainObject
-
flushPrivateEventQueue
Description copied from interface:DomainObjectFlush events from the specified event queue.- Specified by:
flushPrivateEventQueuein interfaceDomainObject- Parameters:
id- the id specifying the event queue to be flushed.
-
canLock
public boolean canLock()Description copied from interface:DomainObjectReturns true if a modification lock can be obtained on this domain object. Care should be taken with using this method since this will not prevent another thread from modifying the domain object.- Specified by:
canLockin interfaceDomainObject- Returns:
- true if can lock
-
isLocked
public boolean isLocked()Description copied from interface:DomainObjectReturns true if the domain object currently has a modification lock enabled.- Specified by:
isLockedin interfaceDomainObject- Returns:
- true if locked
-
lock
Description copied from interface:DomainObjectAttempt to obtain a modification lock on the domain object. Multiple locks may be granted on this domain object, although all lock owners must release their lock in a timely fashion.- Specified by:
lockin interfaceDomainObject- Parameters:
reason- very short reason for requesting lock- Returns:
- true if lock obtained successfully, else false which indicates that a modification is in process.
-
forceLock
Description copied from interface:DomainObjectForce transaction lock and terminate current transaction.- Specified by:
forceLockin interfaceDomainObject- Parameters:
rollback- true if rollback of non-commited changes should occurs, false if commit should be done. NOTE: it can be potentially detrimental to commit an incomplete transaction which should be avoided.reason- very short reason for requesting lock
-
unlock
public void unlock()Description copied from interface:DomainObjectRelease a modification lock previously granted with the lock method.- Specified by:
unlockin interfaceDomainObject
-
getOptionsNames
Description copied from interface:DomainObjectReturns all properties lists contained by this domain object.- Specified by:
getOptionsNamesin interfaceDomainObject- Returns:
- all property lists contained by this domain object.
-
getOptions
Description copied from interface:DomainObjectGet the property list for the given name.- Specified by:
getOptionsin interfaceDomainObject- Parameters:
propertyListName- name of property list- Returns:
- the options
-
isClosed
public boolean isClosed()Description copied from interface:DomainObjectReturns true if this domain object has been closed as a result of the last release- Specified by:
isClosedin interfaceDomainObject- Returns:
- true if closed
-
hasExclusiveAccess
public boolean hasExclusiveAccess()Description copied from interface:DomainObjectReturns true if the user has exclusive access to the domain object. Exclusive access means either the object is not shared or the user has an exclusive checkout on the object.- Specified by:
hasExclusiveAccessin interfaceDomainObject- Returns:
- true if has exclusive access
-
getMetadata
Description copied from interface:DomainObjectReturns a map containing all the stored metadata associated with this domain object. The map contains key,value pairs and are ordered by their insertion order.- Specified by:
getMetadatain interfaceDomainObject- Returns:
- a map containing all the stored metadata associated with this domain object.
-
getModificationNumber
public long getModificationNumber()Description copied from interface:DomainObjectReturns a long value that gets incremented every time a change, undo, or redo takes place. Useful for implementing a lazy caching system.- Specified by:
getModificationNumberin interfaceDomainObject- Returns:
- a long value that is incremented for every change to the program.
-
canUndo
public boolean canUndo()Description copied from interface:DomainObjectReturns true if there is a previous state to "undo" to..- Specified by:
canUndoin interfaceDomainObject- Returns:
- true if there is a previous state to "undo" to.
-
canRedo
public boolean canRedo()Description copied from interface:DomainObjectReturns true if there is a later state to "redo" to..- Specified by:
canRedoin interfaceDomainObject- Returns:
- true if there is a later state to "redo" to.
-
clearUndo
public void clearUndo()Description copied from interface:DomainObjectClear all undoable/redoable transactions- Specified by:
clearUndoin interfaceDomainObject
-
undo
Description copied from interface:DomainObjectReturns to the previous state. Normally, this will cause the current state to appear on the "redo" stack. This method will do nothing if there are no previous states to "undo".- Specified by:
undoin interfaceDomainObject- Throws:
IOException- if an IO error occurs
-
redo
Description copied from interface:DomainObjectReturns to a latter state that exists because of an undo. Normally, this will cause the current state to appear on the "undo" stack. This method will do nothing if there are no latter states to "redo".- Specified by:
redoin interfaceDomainObject- Throws:
IOException- if an IO error occurs
-
getUndoName
Description copied from interface:DomainObjectReturns a description of the change that would be "undone".- Specified by:
getUndoNamein interfaceDomainObject- Returns:
- a description of the change that would be "undone".
-
getRedoName
Description copied from interface:DomainObjectReturns a description of the change that would be "redone".- Specified by:
getRedoNamein interfaceDomainObject- Returns:
- a description of the change that would be "redone".
-
getAllUndoNames
Description copied from interface:DomainObjectReturns a list of the names of all current undo transactions- Specified by:
getAllUndoNamesin interfaceDomainObject- Returns:
- a list of the names of all current undo transactions
-
getAllRedoNames
Description copied from interface:DomainObjectReturns a list of the names of all current redo transactions- Specified by:
getAllRedoNamesin interfaceDomainObject- Returns:
- a list of the names of all current redo transactions
-
addTransactionListener
Description copied from interface:DomainObjectAdds the given transaction listener to this domain object- Specified by:
addTransactionListenerin interfaceDomainObject- Parameters:
listener- the new transaction listener to add
-
removeTransactionListener
Description copied from interface:DomainObjectRemoves the given transaction listener from this domain object.- Specified by:
removeTransactionListenerin interfaceDomainObject- Parameters:
listener- the transaction listener to remove
-
updateMemoryAddRegionBlock
-
updateMemoryChangeRegionBlockName
-
updateMemoryChangeRegionBlockFlags
-
updateMemoryChangeRegionBlockRange
public void updateMemoryChangeRegionBlockRange(TraceMemoryRegion region, AddressRange oldRange, AddressRange newRange) -
updateMemoryChangeRegionBlockLifespan
public void updateMemoryChangeRegionBlockLifespan(TraceMemoryRegion region, Lifespan oldLifespan, Lifespan newLifespan) -
updateMemoryDeleteRegionBlock
-
updateMemoryAddSpaceBlock
-
updateMemoryDeleteSpaceBlock
-
updateMemoryRefreshBlocks
public void updateMemoryRefreshBlocks() -
updateBytesChanged
-
getEventQueues
-
isVisible
-
isBookmarkVisible
-
isBookmarkVisible
-
bytesDifferForSet
-
getCodeOcclusion
-
getTopCode
protected <T extends TraceCodeUnit> T getTopCode(Address address, BiFunction<TraceCodeSpace, Long, T> codeFunc) -
isCodeVisible
-
isCodeVisible
-
isCodeVisible
-
isSymbolWithLifespanVisible
-
isSymbolVisible
-
isBytesVisible
-