Interface Emulator

All Known Implementing Classes:
AdaptedEmulator, DefaultEmulator

@Deprecated(since="12.1", forRemoval=true) public interface Emulator
Deprecated, for removal: This API element is subject to removal in a future version.
This interface was extracted from what has now been renamed DefaultEmulator and is also deprecated. Please use PcodeEmulator instead.
The emulator interface
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add a filter on memory access
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Clean up resources used by the emulator
    void
    executeInstruction(boolean stopAtBreakpoint, TaskMonitor monitor)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute instruction at current address
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the breakpoint table
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the current context register value.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the low-level execution state
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get current execution address (or the address of the next instruction to be executed)
    ghidra.app.emulator.FilteredMemoryState
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the memory state, modified by all installed access filters
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Check if the emulator has been halted
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the address of the last instruction executed (or the instructed currently being executed)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the memory state
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the value of the program counter
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the name of the program counter register
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the context register value at the current execute address.
    void
    setExecuteAddress(long addressableWordOffset)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the value of the program counter
    void
    setHalt(boolean halt)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Halt or un-halt the emulator
  • Method Details

    • getPCRegisterName

      String getPCRegisterName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the name of the program counter register
      Returns:
      the name
    • setExecuteAddress

      void setExecuteAddress(long addressableWordOffset)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the value of the program counter
      Parameters:
      addressableWordOffset - the word offset of the instruction to execute next.
    • getExecuteAddress

      Address getExecuteAddress()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get current execution address (or the address of the next instruction to be executed)
      Returns:
      current execution address
    • getLastExecuteAddress

      Address getLastExecuteAddress()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the address of the last instruction executed (or the instructed currently being executed)
      Returns:
      the address
    • getPC

      long getPC()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the value of the program counter
      Returns:
      the value, i.e., offset in code space
    • executeInstruction

      void executeInstruction(boolean stopAtBreakpoint, TaskMonitor monitor) throws CancelledException, LowlevelError, InstructionDecodeException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute instruction at current address
      Parameters:
      stopAtBreakpoint - if true and breakpoint hits at current execution address execution will halt without executing instruction.
      Throws:
      CancelledException - if execution was cancelled
      LowlevelError
      InstructionDecodeException
    • isExecuting

      boolean isExecuting()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      true if emulator is busy executing an instruction
    • getEmulateExecutionState

      EmulateExecutionState getEmulateExecutionState()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the low-level execution state

      This can be useful within a memory fault handler to determine if a memory read was associated with instruction parsing (i.e., EmulateExecutionState.INSTRUCTION_DECODE) or an actual emulated read (i.e., EmulateExecutionState.EXECUTE).

      Returns:
      emulator execution state.
    • getMemState

      MemoryState getMemState()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the memory state
      Returns:
      the state
    • addMemoryAccessFilter

      void addMemoryAccessFilter(MemoryAccessFilter filter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a filter on memory access
      Parameters:
      filter - the filter
    • getFilteredMemState

      ghidra.app.emulator.FilteredMemoryState getFilteredMemState()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the memory state, modified by all installed access filters
      Returns:
      the state
    • setContextRegisterValue

      void setContextRegisterValue(RegisterValue regValue)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the context register value at the current execute address.

      The Emulator should not be running when this method is invoked. Only flowing context bits should be set, as non-flowing bits will be cleared prior to parsing on instruction. In addition, any future context state set by the pcode emitter will take precedence over context set using this method. This method is primarily intended to be used to establish the initial context state.

      Parameters:
      regValue - is the value to set context to
    • getContextRegisterValue

      RegisterValue getContextRegisterValue()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the current context register value.

      The context value returned reflects its state when the previously executed instruction was parsed/executed. The context value returned will feed into the next instruction to be parsed with its non-flowing bits cleared and any future context state merged in.

      Returns:
      context as a RegisterValue object
    • getBreakTable

      BreakTableCallBack getBreakTable()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the breakpoint table
      Returns:
      the breakpoint table
    • isAtBreakpoint

      boolean isAtBreakpoint()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      true if halted at a breakpoint
    • setHalt

      void setHalt(boolean halt)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Halt or un-halt the emulator
      Parameters:
      halt - true to halt
    • getHalt

      boolean getHalt()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Check if the emulator has been halted
      Returns:
      true if halted
    • dispose

      void dispose()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Clean up resources used by the emulator