Class DBTraceProgramView

java.lang.Object
ghidra.trace.database.program.DBTraceProgramView
All Implemented Interfaces:
DataTypeManagerOwner, DomainObject, DataTypeManagerDomainObject, ProgramArchitecture, Program, TraceProgramView
Direct Known Subclasses:
DBTraceVariableSnapProgramView

public class DBTraceProgramView extends Object implements TraceProgramView
A wrapper on a trace, which given a snap, implements the 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.

  • Field Details

  • Constructor Details

    • DBTraceProgramView

      public DBTraceProgramView(DBTrace trace, long snap, CompilerSpec compilerSpec)
  • Method Details

    • checkRefreshAllAddresses

      protected void checkRefreshAllAddresses()
    • getAllAddresses

      protected AddressSetView getAllAddresses()
    • viewportChanged

      protected void viewportChanged()
    • fireEventAllViews

      protected void fireEventAllViews(DomainObjectChangeRecord ev)
    • fireObjectRestored

      protected void fireObjectRestored()
      Fires object-restored event on this view and all associated register views.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTrace

      public DBTrace getTrace()
      Description copied from interface: TraceProgramView
      Get the trace this view presents
      Specified by:
      getTrace in interface TraceProgramView
      Returns:
      the trace
    • getSnap

      public long getSnap()
      Description copied from interface: TraceProgramView
      Get the current snap
      Specified by:
      getSnap in interface TraceProgramView
      Returns:
      the snap
    • getViewport

      public TraceTimeViewport getViewport()
      Description copied from interface: TraceProgramView
      Get the viewport this view is using for forked queries
      Specified by:
      getViewport in interface TraceProgramView
      Returns:
      the viewport
    • getMaxSnap

      public Long getMaxSnap()
      Description copied from interface: TraceProgramView
      Get the trace's latest snap
      Specified by:
      getMaxSnap in interface TraceProgramView
      Returns:
      the maximum snap
    • getListing

      public DBTraceProgramViewListing getListing()
      Description copied from interface: Program
      Get the listing object.
      Specified by:
      getListing in interface Program
      Returns:
      the Listing interface to the listing object.
    • getAddressMap

      public AddressMap getAddressMap()
      Description copied from interface: Program
      Get the internal program address map
      Specified by:
      getAddressMap in interface Program
      Returns:
      internal address map
    • getDataTypeManager

      public TraceBasedDataTypeManager getDataTypeManager()
      Description copied from interface: Program
      Returns the program's datatype manager.
      Specified by:
      getDataTypeManager in interface DataTypeManagerOwner
      Specified by:
      getDataTypeManager in interface Program
      Returns:
      the data type manager.
    • getFunctionManager

      public FunctionManager getFunctionManager()
      Description copied from interface: Program
      Returns the programs function manager.
      Specified by:
      getFunctionManager in interface Program
      Returns:
      the function manager
    • getProgramUserData

      public ProgramUserData getProgramUserData()
      Description copied from interface: Program
      Returns the user-specific data manager for this program.
      Specified by:
      getProgramUserData in interface Program
      Returns:
      the program-specific user data manager
    • getSymbolTable

      public SymbolTable getSymbolTable()
      Description copied from interface: Program
      Get the symbol table object.
      Specified by:
      getSymbolTable in interface Program
      Returns:
      the symbol table object.
    • getExternalManager

      public ExternalManager getExternalManager()
      Description copied from interface: Program
      Returns the external manager.
      Specified by:
      getExternalManager in interface Program
      Returns:
      the external manager
    • getEquateTable

      public EquateTable getEquateTable()
      Description copied from interface: Program
      Get the equate table object.
      Specified by:
      getEquateTable in interface Program
      Returns:
      the equate table.
    • getMemory

      public DBTraceProgramViewMemory getMemory()
      Description copied from interface: Program
      Get the memory object.
      Specified by:
      getMemory in interface Program
      Specified by:
      getMemory in interface TraceProgramView
      Returns:
      the memory object.
    • getReferenceManager

      public ReferenceManager getReferenceManager()
      Description copied from interface: Program
      Get the reference manager.
      Specified by:
      getReferenceManager in interface Program
      Returns:
      the reference manager
    • getBookmarkManager

      public BookmarkManager getBookmarkManager()
      Description copied from interface: Program
      Get the bookmark manager.
      Specified by:
      getBookmarkManager in interface Program
      Returns:
      the bookmark manager
    • getDefaultPointerSize

      public int getDefaultPointerSize()
      Description copied from interface: Program
      Gets the default pointer size in bytes as it may be stored within the program listing.
      Specified by:
      getDefaultPointerSize in interface Program
      Returns:
      default pointer size.
      See Also:
    • getCompiler

      public String getCompiler()
      Description copied from interface: Program
      Gets 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:
      getCompiler in interface Program
      Returns:
      name of the compiler or "unknown".
    • setCompiler

      public void setCompiler(String compiler)
      Description copied from interface: Program
      Sets the name of the compiler which created this program.
      Specified by:
      setCompiler in interface Program
      Parameters:
      compiler - the name
    • getPreferredRootNamespaceCategoryPath

      public CategoryPath getPreferredRootNamespaceCategoryPath()
      Description copied from interface: Program
      Gets 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. See DataTypeUtilities and its various find methods for its usage details.
      Specified by:
      getPreferredRootNamespaceCategoryPath in interface Program
      Returns:
      data type category path for root namespace or null if not set or is invalid.
    • setPreferredRootNamespaceCategoryPath

      public void setPreferredRootNamespaceCategoryPath(String categoryPath)
      Description copied from interface: Program
      Sets 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. See DataTypeUtilities and its various find methods for its usage details.
      Specified by:
      setPreferredRootNamespaceCategoryPath in interface Program
      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

      public String getExecutablePath()
      Description copied from interface: Program
      Gets 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:
      getExecutablePath in interface Program
      Returns:
      String path to program's exe file
    • setExecutablePath

      public void setExecutablePath(String path)
      Description copied from interface: Program
      Sets the path to the program's executable file. For example, /home/user/foo.exe.
      Specified by:
      setExecutablePath in interface Program
      Parameters:
      path - the path to the program's exe
    • getExecutableFormat

      public String getExecutableFormat()
      Description copied from interface: Program
      Returns a value corresponding to the original file format.
      Specified by:
      getExecutableFormat in interface Program
      Returns:
      original file format used to load program or null if unknown
    • setExecutableFormat

      public void setExecutableFormat(String format)
      Description copied from interface: Program
      Sets the value corresponding to the original file format.
      Specified by:
      setExecutableFormat in interface Program
      Parameters:
      format - the binary file format string to set.
    • getExecutableMD5

      public String getExecutableMD5()
      Description copied from interface: Program
      Returns a value corresponding to the original binary file MD5 hash.
      Specified by:
      getExecutableMD5 in interface Program
      Returns:
      original loaded file MD5 or null
    • setExecutableMD5

      public void setExecutableMD5(String md5)
      Description copied from interface: Program
      Sets the value corresponding to the original binary file MD5 hash.
      Specified by:
      setExecutableMD5 in interface Program
      Parameters:
      md5 - MD5 binary file hash
    • getExecutableSHA256

      public String getExecutableSHA256()
      Description copied from interface: Program
      Returns a value corresponding to the original binary file SHA256 hash.
      Specified by:
      getExecutableSHA256 in interface Program
      Returns:
      original loaded file SHA256 or null
    • setExecutableSHA256

      public void setExecutableSHA256(String sha256)
      Description copied from interface: Program
      Sets the value corresponding to the original binary file SHA256 hash.
      Specified by:
      setExecutableSHA256 in interface Program
      Parameters:
      sha256 - SHA256 binary file hash
    • getCreationDate

      public Date getCreationDate()
      Description copied from interface: Program
      Returns the creation date of this program. If the program was created before this property existed, then Jan 1, 1970 is returned.
      Specified by:
      getCreationDate in interface Program
      Returns:
      the creation date of this program
    • getRelocationTable

      public RelocationTable getRelocationTable()
      Description copied from interface: Program
      Gets the relocation table.
      Specified by:
      getRelocationTable in interface Program
      Returns:
      relocation table object
    • getLanguage

      public Language getLanguage()
      Description copied from interface: Program
      Returns the language used by this program.
      Specified by:
      getLanguage in interface Program
      Specified by:
      getLanguage in interface ProgramArchitecture
      Returns:
      the language used by this program.
    • getCompilerSpec

      public CompilerSpec getCompilerSpec()
      Description copied from interface: Program
      Returns the CompilerSpec currently used by this program.
      Specified by:
      getCompilerSpec in interface Program
      Specified by:
      getCompilerSpec in interface ProgramArchitecture
      Returns:
      the compilerSpec currently used by this program.
    • getLanguageID

      public LanguageID getLanguageID()
      Description copied from interface: Program
      Return the name of the language used by this program.
      Specified by:
      getLanguageID in interface Program
      Returns:
      the name of the language
    • getUsrPropertyManager

      public PropertyMapManager getUsrPropertyManager()
      Description copied from interface: Program
      Get 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:
      getUsrPropertyManager in interface Program
      Returns:
      the user property manager.
    • getProgramContext

      public ProgramContext getProgramContext()
      Description copied from interface: Program
      Returns the program context.
      Specified by:
      getProgramContext in interface Program
      Returns:
      the program context object
    • getMinAddress

      public Address getMinAddress()
      Description copied from interface: Program
      Get the program's minimum address. NOTE: An AddressRange should generally not be formed using this address and Program.getMaxAddress() since it may span multiple AddressSpaces.
      Specified by:
      getMinAddress in interface Program
      Returns:
      the program's minimum address or null if no memory blocks have been defined in the program.
    • getMaxAddress

      public Address getMaxAddress()
      Description copied from interface: Program
      Get the programs maximum address. NOTE: An AddressRange should generally not be formed using this address and Program.getMinAddress() since it may span multiple AddressSpaces.
      Specified by:
      getMaxAddress in interface Program
      Returns:
      the program's maximum address or null if no memory blocks have been defined in the program.
    • getChanges

      public ProgramChangeSet getChanges()
      Description copied from interface: Program
      Get the program changes since the last save as a set of addresses.
      Specified by:
      getChanges in interface Program
      Returns:
      set of changed addresses within program.
    • createOverlaySpace

      Description copied from interface: Program
      Create a new overlay space based upon the given base AddressSpace
      Specified by:
      createOverlaySpace in interface Program
      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 active
      DuplicateNameException - if an address space already exists with specified overlaySpaceName.
      InvalidNameException - if overlaySpaceName contains invalid characters
      LockException - 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: Program
      Rename an existing overlay address space. NOTE: This experimental method has known limitations with existing Address and AddressSpace objects following an undo/redo which may continue to refer to the old overlay name which may lead to unxpected errors.
      Specified by:
      renameOverlaySpace in interface Program
      Parameters:
      oldOverlaySpaceName - overlay address space name
      newName - new name for overlay
      Throws:
      NotFoundException - if the specified overlay space was not found
      InvalidNameException - if new name is invalid
      DuplicateNameException - if new name already used by another address space
      LockException - if program does not has exclusive access
    • removeOverlaySpace

      public boolean removeOverlaySpace(String overlaySpaceName) throws LockException, NotFoundException
      Description copied from interface: Program
      Remove the specified overlay address space from this program.
      Specified by:
      removeOverlaySpace in interface Program
      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 access
      NotFoundException - if specified overlay space not found in program
    • getAddressFactory

      public AddressFactory getAddressFactory()
      Description copied from interface: Program
      Returns the AddressFactory for this program.
      Specified by:
      getAddressFactory in interface Program
      Specified by:
      getAddressFactory in interface ProgramArchitecture
      Returns:
      the program address factory
    • parseAddress

      public Address[] parseAddress(String addrStr)
      Description copied from interface: Program
      Return an array of Addresses that could represent the given string.
      Specified by:
      parseAddress in interface Program
      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

      public Address[] parseAddress(String addrStr, boolean caseSensitive)
      Description copied from interface: Program
      Return an array of Addresses that could represent the given string.
      Specified by:
      parseAddress in interface Program
      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

      public Register getRegister(String name)
      Description copied from interface: Program
      Returns the register with the given name;
      Specified by:
      getRegister in interface Program
      Parameters:
      name - the name of the register to retrieve
      Returns:
      register or null
    • getRegister

      public Register getRegister(Address addr)
      Description copied from interface: Program
      Returns the largest register located at the specified address
      Specified by:
      getRegister in interface Program
      Parameters:
      addr - register minimum address
      Returns:
      largest register at addr or null
    • getRegisters

      public Register[] getRegisters(Address addr)
      Description copied from interface: Program
      Returns all registers located at the specified address
      Specified by:
      getRegisters in interface Program
      Parameters:
      addr - register minimum address
      Returns:
      all registers at addr
    • getRegister

      public Register getRegister(Address addr, int size)
      Description copied from interface: Program
      Returns a specific register based upon its address and size
      Specified by:
      getRegister in interface Program
      Parameters:
      addr - register address
      size - the size of the register (in bytes);
      Returns:
      register or null
    • getRegister

      public Register getRegister(Varnode varnode)
      Description copied from interface: Program
      Returns the register which corresponds to the specified varnode
      Specified by:
      getRegister in interface Program
      Parameters:
      varnode - the varnode
      Returns:
      register or null
    • getImageBase

      public Address getImageBase()
      Description copied from interface: Program
      Returns the current program image base address
      Specified by:
      getImageBase in interface Program
      Returns:
      program image base address within default space
    • setImageBase

      public void setImageBase(Address base, boolean commit) throws AddressOverflowException, LockException, IllegalStateException
      Description copied from interface: Program
      Sets the program's image base address.
      Specified by:
      setImageBase in interface Program
      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: Program
      Restores the last committed image base.
      Specified by:
      restoreImageBase in interface Program
    • setLanguage

      public void setLanguage(Language language, CompilerSpecID compilerSpecID, boolean forceRedisassembly, TaskMonitor monitor) throws IllegalStateException, IncompatibleLanguageException, LockException
      Description copied from interface: Program
      Sets 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:
      setLanguage in interface Program
      Parameters:
      language - the new language to use.
      compilerSpecID - the new compiler specification ID
      forceRedisassembly - 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

      public Namespace getGlobalNamespace()
      Description copied from interface: Program
      Returns the global namespace for this program
      Specified by:
      getGlobalNamespace in interface Program
      Returns:
      the global namespace
    • createAddressSetPropertyMap

      public AddressSetPropertyMap createAddressSetPropertyMap(String name) throws DuplicateNameException
      Description copied from interface: Program
      Create a new AddressSetPropertyMap with the specified name.
      Specified by:
      createAddressSetPropertyMap in interface Program
      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

      public IntRangeMap createIntRangeMap(String name) throws DuplicateNameException
      Description copied from interface: Program
      Create a new IntRangeMap with the specified name.
      Specified by:
      createIntRangeMap in interface Program
      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

      public AddressSetPropertyMap getAddressSetPropertyMap(String name)
      Description copied from interface: Program
      Get the property map with the given name.
      Specified by:
      getAddressSetPropertyMap in interface Program
      Parameters:
      name - name of the property map
      Returns:
      null if no property map exist with the given name
    • getIntRangeMap

      public IntRangeMap getIntRangeMap(String name)
      Description copied from interface: Program
      Get the property map with the given name.
      Specified by:
      getIntRangeMap in interface Program
      Parameters:
      name - name of the property map
      Returns:
      null if no property map exist with the given name
    • deleteAddressSetPropertyMap

      public void deleteAddressSetPropertyMap(String name)
      Description copied from interface: Program
      Remove the property map from the program.
      Specified by:
      deleteAddressSetPropertyMap in interface Program
      Parameters:
      name - name of the property map to remove
    • deleteIntRangeMap

      public void deleteIntRangeMap(String name)
      Description copied from interface: Program
      Remove the property map from the program.
      Specified by:
      deleteIntRangeMap in interface Program
      Parameters:
      name - name of the property map to remove
    • getUniqueProgramID

      public long getUniqueProgramID()
      Description copied from interface: Program
      Returns an ID that is unique for this program. This provides an easy way to store references to a program across client persistence.
      Specified by:
      getUniqueProgramID in interface Program
      Returns:
      unique program ID
    • openTransaction

      public Transaction openTransaction(String description) throws IllegalStateException
      Description copied from interface: DomainObject
      Open new transaction. This should generally be done with a try-with-resources block:
       try (Transaction tx = dobj.openTransaction(description)) {
              // ... Do something
       }
       
      Specified by:
      openTransaction in interface DomainObject
      Parameters:
      description - a short description of the changes to be made.
      Returns:
      transaction object
      Throws:
      IllegalStateException - if this DomainObject has already been closed.
    • startTransaction

      public int startTransaction(String description)
      Description copied from interface: DomainObject
      Start 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:
      startTransaction in interface DomainObject
      Parameters:
      description - brief description of transaction
      Returns:
      transaction ID
    • startTransaction

      public int startTransaction(String description, AbortedTransactionListener listener)
      Description copied from interface: DomainObject
      Start 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:
      startTransaction in interface DomainObject
      Parameters:
      description - brief description of transaction
      listener - listener to be notified if the transaction is aborted.
      Returns:
      transaction ID
    • endTransaction

      public boolean endTransaction(int transactionID, boolean commit)
      Description copied from interface: DomainObject
      Terminate 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 commit the transaction will ultimately be rolled-back when the final transaction is ended.

      NOTE: Use of rollback (commit=false should be avoided unless absolutely neccessary since it will incur overhead to revert changes and may rollback multiple concurrent transactions if they exist.

      Specified by:
      endTransaction in interface DomainObject
      Parameters:
      transactionID - transaction ID obtained from startTransaction method
      commit - 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

      public TransactionInfo getCurrentTransactionInfo()
      Description copied from interface: DomainObject
      Returns the current transaction info
      Specified by:
      getCurrentTransactionInfo in interface DomainObject
      Returns:
      the current transaction info
    • hasTerminatedTransaction

      public boolean hasTerminatedTransaction()
      Description copied from interface: DomainObject
      Returns true if the last transaction was terminated from the action that started it.
      Specified by:
      hasTerminatedTransaction in interface DomainObject
      Returns:
      true if the last transaction was terminated from the action that started it.
    • getSynchronizedDomainObjects

      public DomainObject[] getSynchronizedDomainObjects()
      Description copied from interface: DomainObject
      Return array of all domain objects synchronized with a shared transaction manager.
      Specified by:
      getSynchronizedDomainObjects in interface DomainObject
      Returns:
      returns array of synchronized domain objects or null if this domain object is not synchronized with others.
    • addSynchronizedDomainObject

      public void addSynchronizedDomainObject(DomainObject domainObj) throws LockException
      Description copied from interface: DomainObject
      Synchronize 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:
      addSynchronizedDomainObject in interface DomainObject
      Parameters:
      domainObj - the domain object
      Throws:
      LockException - if lock or open transaction is active on either this or the specified domain object
    • releaseSynchronizedDomainObject

      public void releaseSynchronizedDomainObject() throws LockException
      Description copied from interface: DomainObject
      Remove 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:
      releaseSynchronizedDomainObject in interface DomainObject
      Throws:
      LockException - if lock or open transaction is active
    • isChanged

      public boolean isChanged()
      Description copied from interface: DomainObject
      Returns whether the object has changed.
      Specified by:
      isChanged in interface DomainObject
      Returns:
      whether the object has changed.
    • setTemporary

      public void setTemporary(boolean state)
      Description copied from interface: DomainObject
      Set 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:
      setTemporary in interface DomainObject
      Parameters:
      state - if true object is marked as temporary
    • isTemporary

      public boolean isTemporary()
      Description copied from interface: DomainObject
      Returns true if this object has been marked as Temporary.
      Specified by:
      isTemporary in interface DomainObject
      Returns:
      true if this object has been marked as Temporary.
    • isChangeable

      public boolean isChangeable()
      Description copied from interface: DomainObject
      Returns true if changes are permitted.
      Specified by:
      isChangeable in interface DomainObject
      Returns:
      true if changes are permitted.
    • canSave

      public boolean canSave()
      Description copied from interface: DomainObject
      Returns true if this object can be saved; a read-only file cannot be saved.
      Specified by:
      canSave in interface DomainObject
      Returns:
      true if this object can be saved
    • save

      public void save(String comment, TaskMonitor monitor) throws IOException, CancelledException
      Description copied from interface: DomainObject
      Saves changes to the DomainFile.
      Specified by:
      save in interface DomainObject
      Parameters:
      comment - comment used for new version
      monitor - monitor that shows the progress of the save
      Throws:
      IOException - thrown if there was an error accessing this domain object
      CancelledException - thrown if the user canceled the save operation
    • saveToPackedFile

      public void saveToPackedFile(File outputFile, TaskMonitor monitor) throws IOException, CancelledException
      Description copied from interface: DomainObject
      Saves (i.e., serializes) the current content to a packed file.
      Specified by:
      saveToPackedFile in interface DomainObject
      Parameters:
      outputFile - packed output file
      monitor - progress monitor
      Throws:
      IOException - if an exception occurs
      CancelledException - if the user cancels
    • getEventTranslator

      protected DBTraceProgramView.EventTranslator getEventTranslator()
    • addListener

      public void addListener(DomainObjectListener dol)
      Description copied from interface: DomainObject
      Adds a listener for this object.
      Specified by:
      addListener in interface DomainObject
      Parameters:
      dol - listener notified when any change occurs to this domain object
    • removeListener

      public void removeListener(DomainObjectListener dol)
      Description copied from interface: DomainObject
      Remove the listener for this object.
      Specified by:
      removeListener in interface DomainObject
      Parameters:
      dol - listener
    • addCloseListener

      public void addCloseListener(DomainObjectClosedListener listener)
      Description copied from interface: DomainObject
      Adds 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:
      addCloseListener in interface DomainObject
      Parameters:
      listener - the reference to add
    • removeCloseListener

      public void removeCloseListener(DomainObjectClosedListener listener)
      Description copied from interface: DomainObject
      Removes the given close listener.
      Specified by:
      removeCloseListener in interface DomainObject
      Parameters:
      listener - the listener to remove.
    • addDomainFileListener

      public void addDomainFileListener(DomainObjectFileListener listener)
      Description copied from interface: DomainObject
      Adds 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:
      addDomainFileListener in interface DomainObject
      Parameters:
      listener - the listener to be notified when the associated DomainFile changes
    • removeDomainFileListener

      public void removeDomainFileListener(DomainObjectFileListener listener)
      Description copied from interface: DomainObject
      Removes the given DomainObjectFileListener listener.
      Specified by:
      removeDomainFileListener in interface DomainObject
      Parameters:
      listener - the listener to remove.
    • createPrivateEventQueue

      public EventQueueID createPrivateEventQueue(DomainObjectListener listener, int maxDelay)
      Description copied from interface: DomainObject
      Creates a private event queue that can be flushed independently from the main event queue.
      Specified by:
      createPrivateEventQueue in interface DomainObject
      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

      public boolean removePrivateEventQueue(EventQueueID id)
      Description copied from interface: DomainObject
      Removes the specified private event queue
      Specified by:
      removePrivateEventQueue in interface DomainObject
      Parameters:
      id - the id of the queue to remove.
      Returns:
      true if the id represents a valid queue that was removed.
    • getDescription

      public String getDescription()
      Description copied from interface: DomainObject
      Returns a word or short phrase that best describes or categorizes the object in terms that a user will understand.
      Specified by:
      getDescription in interface DomainObject
      Returns:
      the description
    • getName

      public String getName()
      Description copied from interface: DomainObject
      Get the name of this domain object.
      Specified by:
      getName in interface DomainObject
      Returns:
      the name
    • setName

      public void setName(String name)
      Description copied from interface: DomainObject
      Set the name for this domain object.
      Specified by:
      setName in interface DomainObject
      Parameters:
      name - object name
    • getDomainFile

      public DomainFile getDomainFile()
      Description copied from interface: DomainObject
      Get the domain file for this domain object.
      Specified by:
      getDomainFile in interface DomainObject
      Returns:
      the associated domain file
    • addConsumer

      public boolean addConsumer(Object consumer)
      Description copied from interface: DomainObject
      Adds 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:
      addConsumer in interface DomainObject
      Parameters:
      consumer - domain object consumer
      Returns:
      false if this domain object has already been closed
    • getConsumerList

      public ArrayList<Object> getConsumerList()
      Description copied from interface: DomainObject
      Returns the list of consumers on this domainObject
      Specified by:
      getConsumerList in interface DomainObject
      Returns:
      the list of consumers.
    • isUsedBy

      public boolean isUsedBy(Object consumer)
      Description copied from interface: DomainObject
      Returns true if the given consumer is using (has open) this domain object.
      Specified by:
      isUsedBy in interface DomainObject
      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

      public void release(Object consumer)
      Description copied from interface: DomainObject
      Notify 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:
      release in interface DomainObject
      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: DomainObject
      If 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:
      setEventsEnabled in interface DomainObject
      Parameters:
      enabled - true means to enable events
    • isSendingEvents

      public boolean isSendingEvents()
      Description copied from interface: DomainObject
      Returns true if this object is sending out events as it is changed. The default is true. You can change this value by calling DomainObject.setEventsEnabled(boolean).
      Specified by:
      isSendingEvents in interface DomainObject
      Returns:
      true if sending events
      See Also:
    • flushEvents

      public void flushEvents()
      Description copied from interface: DomainObject
      Makes sure all pending domainEvents have been sent.
      Specified by:
      flushEvents in interface DomainObject
    • flushPrivateEventQueue

      public void flushPrivateEventQueue(EventQueueID id)
      Description copied from interface: DomainObject
      Flush events from the specified event queue.
      Specified by:
      flushPrivateEventQueue in interface DomainObject
      Parameters:
      id - the id specifying the event queue to be flushed.
    • canLock

      public boolean canLock()
      Description copied from interface: DomainObject
      Returns 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:
      canLock in interface DomainObject
      Returns:
      true if can lock
    • isLocked

      public boolean isLocked()
      Description copied from interface: DomainObject
      Returns true if the domain object currently has a modification lock enabled.
      Specified by:
      isLocked in interface DomainObject
      Returns:
      true if locked
    • lock

      public boolean lock(String reason)
      Description copied from interface: DomainObject
      Attempt 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:
      lock in interface DomainObject
      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

      public void forceLock(boolean rollback, String reason)
      Description copied from interface: DomainObject
      Force transaction lock and terminate current transaction.
      Specified by:
      forceLock in interface DomainObject
      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: DomainObject
      Release a modification lock previously granted with the lock method.
      Specified by:
      unlock in interface DomainObject
    • getOptionsNames

      public List<String> getOptionsNames()
      Description copied from interface: DomainObject
      Returns all properties lists contained by this domain object.
      Specified by:
      getOptionsNames in interface DomainObject
      Returns:
      all property lists contained by this domain object.
    • getOptions

      public Options getOptions(String propertyListName)
      Description copied from interface: DomainObject
      Get the property list for the given name.
      Specified by:
      getOptions in interface DomainObject
      Parameters:
      propertyListName - name of property list
      Returns:
      the options
    • isClosed

      public boolean isClosed()
      Description copied from interface: DomainObject
      Returns true if this domain object has been closed as a result of the last release
      Specified by:
      isClosed in interface DomainObject
      Returns:
      true if closed
    • hasExclusiveAccess

      public boolean hasExclusiveAccess()
      Description copied from interface: DomainObject
      Returns 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:
      hasExclusiveAccess in interface DomainObject
      Returns:
      true if has exclusive access
    • getMetadata

      public Map<String,String> getMetadata()
      Description copied from interface: DomainObject
      Returns 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:
      getMetadata in interface DomainObject
      Returns:
      a map containing all the stored metadata associated with this domain object.
    • getModificationNumber

      public long getModificationNumber()
      Description copied from interface: DomainObject
      Returns a long value that gets incremented every time a change, undo, or redo takes place. Useful for implementing a lazy caching system.
      Specified by:
      getModificationNumber in interface DomainObject
      Returns:
      a long value that is incremented for every change to the program.
    • canUndo

      public boolean canUndo()
      Description copied from interface: DomainObject
      Returns true if there is a previous state to "undo" to..
      Specified by:
      canUndo in interface DomainObject
      Returns:
      true if there is a previous state to "undo" to.
    • canRedo

      public boolean canRedo()
      Description copied from interface: DomainObject
      Returns true if there is a later state to "redo" to..
      Specified by:
      canRedo in interface DomainObject
      Returns:
      true if there is a later state to "redo" to.
    • clearUndo

      public void clearUndo()
      Description copied from interface: DomainObject
      Clear all undoable/redoable transactions
      Specified by:
      clearUndo in interface DomainObject
    • undo

      public void undo() throws IOException
      Description copied from interface: DomainObject
      Returns 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:
      undo in interface DomainObject
      Throws:
      IOException - if an IO error occurs
    • redo

      public void redo() throws IOException
      Description copied from interface: DomainObject
      Returns 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:
      redo in interface DomainObject
      Throws:
      IOException - if an IO error occurs
    • getUndoName

      public String getUndoName()
      Description copied from interface: DomainObject
      Returns a description of the change that would be "undone".
      Specified by:
      getUndoName in interface DomainObject
      Returns:
      a description of the change that would be "undone".
    • getRedoName

      public String getRedoName()
      Description copied from interface: DomainObject
      Returns a description of the change that would be "redone".
      Specified by:
      getRedoName in interface DomainObject
      Returns:
      a description of the change that would be "redone".
    • getAllUndoNames

      public List<String> getAllUndoNames()
      Description copied from interface: DomainObject
      Returns a list of the names of all current undo transactions
      Specified by:
      getAllUndoNames in interface DomainObject
      Returns:
      a list of the names of all current undo transactions
    • getAllRedoNames

      public List<String> getAllRedoNames()
      Description copied from interface: DomainObject
      Returns a list of the names of all current redo transactions
      Specified by:
      getAllRedoNames in interface DomainObject
      Returns:
      a list of the names of all current redo transactions
    • addTransactionListener

      public void addTransactionListener(TransactionListener listener)
      Description copied from interface: DomainObject
      Adds the given transaction listener to this domain object
      Specified by:
      addTransactionListener in interface DomainObject
      Parameters:
      listener - the new transaction listener to add
    • removeTransactionListener

      public void removeTransactionListener(TransactionListener listener)
      Description copied from interface: DomainObject
      Removes the given transaction listener from this domain object.
      Specified by:
      removeTransactionListener in interface DomainObject
      Parameters:
      listener - the transaction listener to remove
    • updateMemoryAddRegionBlock

      public void updateMemoryAddRegionBlock(TraceMemoryRegion region)
    • updateMemoryChangeRegionBlockName

      public void updateMemoryChangeRegionBlockName(TraceMemoryRegion region)
    • updateMemoryChangeRegionBlockFlags

      public void updateMemoryChangeRegionBlockFlags(TraceMemoryRegion region, Lifespan lifespan)
    • updateMemoryChangeRegionBlockRange

      public void updateMemoryChangeRegionBlockRange(TraceMemoryRegion region, AddressRange oldRange, AddressRange newRange)
    • updateMemoryChangeRegionBlockLifespan

      public void updateMemoryChangeRegionBlockLifespan(TraceMemoryRegion region, Lifespan oldLifespan, Lifespan newLifespan)
    • updateMemoryDeleteRegionBlock

      public void updateMemoryDeleteRegionBlock(TraceMemoryRegion region)
    • updateMemoryAddSpaceBlock

      public void updateMemoryAddSpaceBlock(AddressSpace space)
    • updateMemoryDeleteSpaceBlock

      public void updateMemoryDeleteSpaceBlock(AddressSpace space)
    • updateMemoryRefreshBlocks

      public void updateMemoryRefreshBlocks()
    • updateBytesChanged

      public void updateBytesChanged(AddressRange range)
    • getEventQueues

      protected DomainObjectEventQueues getEventQueues(AddressSpace space)
    • isVisible

      protected DomainObjectEventQueues isVisible(AddressSpace space, TraceAddressSnapRange range)
    • isBookmarkVisible

      protected boolean isBookmarkVisible(TraceBookmark bm, Lifespan lifespan)
    • isBookmarkVisible

      protected DomainObjectEventQueues isBookmarkVisible(AddressSpace space, TraceBookmark bm)
    • bytesDifferForSet

      protected boolean bytesDifferForSet(byte[] b1, byte[] b2, AddressSetView set)
    • getCodeOcclusion

      protected TraceTimeViewport.Occlusion<TraceCodeUnit> getCodeOcclusion(AddressSpace space)
    • getTopCode

      protected <T extends TraceCodeUnit> T getTopCode(Address address, BiFunction<TraceCodeSpace,Long,T> codeFunc)
    • isCodeVisible

      protected boolean isCodeVisible(TraceCodeUnit cu, Lifespan lifespan)
    • isCodeVisible

      protected boolean isCodeVisible(AddressSpace space, TraceAddressSnapRange range)
    • isCodeVisible

      protected DomainObjectEventQueues isCodeVisible(AddressSpace space, TraceCodeUnit cu)
    • isSymbolWithLifespanVisible

      protected boolean isSymbolWithLifespanVisible(TraceSymbolWithLifespan symbol, Lifespan lifespan)
    • isSymbolVisible

      protected DomainObjectEventQueues isSymbolVisible(AddressSpace space, TraceSymbol symbol)
    • isBytesVisible

      protected DomainObjectEventQueues isBytesVisible(AddressSpace space, TraceAddressSnapRange range)