Class DefaultEmulator
- All Implemented Interfaces:
Emulator
Emulator.
This class used to be named Emulator, until it was replaced by an interface extracted
from this class. There is now a second implementation named AdaptedEmulator, which wraps
the newer PcodeEmulator system. If you are developing a new use case based on p-code
emulation, please consider using PcodeEmulator directly. There are several example
scripts in the SystemEmulation module. If you are maintaining an existing use case
currently based on Emulator, you will at least need to change new Emulator(...)
to new DefaultEmulator(...). It is highly recommended to port to the newer
PcodeEmulator. You may find the AdaptedEmulator useful during the transition, but
that class is only transitional.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated, for removal: This API element is subject to removal in a future version.Add a filter on memory accessvoidaddProvider(MemoryLoadImage provider, AddressSetView view) Deprecated, for removal: This API element is subject to removal in a future version.Add memory load image providerDeprecated, for removal: This API element is subject to removal in a future version.disassemble(Integer count) Deprecated, for removal: This API element is subject to removal in a future version.Disassemble from the current execute addressvoiddispose()Deprecated, for removal: This API element is subject to removal in a future version.Clean up resources used by the emulatorvoidexecuteInstruction(boolean stopAtBreakpoint, TaskMonitor monitor) Deprecated, for removal: This API element is subject to removal in a future version.Execute instruction at current addressgenAddress(String addr) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Get the breakpoint tableDeprecated, 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.Deprecated, for removal: This API element is subject to removal in a future version.Get the low-level execution stateDeprecated, 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.FilteredMemoryStateDeprecated, for removal: This API element is subject to removal in a future version.Get the memory state, modified by all installed access filtersbooleangetHalt()Deprecated, for removal: This API element is subject to removal in a future version.Check if the emulator has been haltedDeprecated, for removal: This API element is subject to removal in a future version.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)getMemoryBank(AddressSpace space, int ps) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Get the memory statelonggetPC()Deprecated, for removal: This API element is subject to removal in a future version.Get the value of the program counterDeprecated, for removal: This API element is subject to removal in a future version.Get the name of the program counter registerintDeprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.voidsetContextRegisterValue(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.voidsetExecuteAddress(long addressableWordOffset) Deprecated, for removal: This API element is subject to removal in a future version.Set the value of the program countervoidsetHalt(boolean halt) Deprecated, for removal: This API element is subject to removal in a future version.Halt or un-halt the emulator
-
Constructor Details
-
DefaultEmulator
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
cloneMemory
Deprecated, for removal: This API element is subject to removal in a future version. -
getMemoryBank
Deprecated, for removal: This API element is subject to removal in a future version. -
dispose
public void dispose()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorClean up resources used by the emulator -
genAddress
Deprecated, for removal: This API element is subject to removal in a future version. -
getPC
public long getPC()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorGet the value of the program counter -
getPCRegisterName
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorGet the name of the program counter register- Specified by:
getPCRegisterNamein interfaceEmulator- Returns:
- the name
-
getMemState
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorGet the memory state- Specified by:
getMemStatein interfaceEmulator- Returns:
- the state
-
getFilteredMemState
public ghidra.app.emulator.FilteredMemoryState getFilteredMemState()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorGet the memory state, modified by all installed access filters- Specified by:
getFilteredMemStatein interfaceEmulator- Returns:
- the state
-
addMemoryAccessFilter
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorAdd a filter on memory access- Specified by:
addMemoryAccessFilterin interfaceEmulator- Parameters:
filter- the filter
-
getBreakTable
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorGet the breakpoint table- Specified by:
getBreakTablein interfaceEmulator- Returns:
- the breakpoint table
-
setExecuteAddress
public void setExecuteAddress(long addressableWordOffset) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorSet the value of the program counter- Specified by:
setExecuteAddressin interfaceEmulator- Parameters:
addressableWordOffset- the word offset of the instruction to execute next.
-
getExecuteAddress
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorGet current execution address (or the address of the next instruction to be executed)- Specified by:
getExecuteAddressin interfaceEmulator- Returns:
- current execution address
-
getLastExecuteAddress
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorGet the address of the last instruction executed (or the instructed currently being executed)- Specified by:
getLastExecuteAddressin interfaceEmulator- Returns:
- the address
-
getDefaultContext
Deprecated, for removal: This API element is subject to removal in a future version. -
setHalt
public void setHalt(boolean halt) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorHalt or un-halt the emulator -
getHalt
public boolean getHalt()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorCheck if the emulator has been halted -
executeInstruction
public void executeInstruction(boolean stopAtBreakpoint, TaskMonitor monitor) throws CancelledException, LowlevelError, InstructionDecodeException Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorExecute instruction at current address- Specified by:
executeInstructionin interfaceEmulator- Parameters:
stopAtBreakpoint- if true and breakpoint hits at current execution address execution will halt without executing instruction.- Throws:
CancelledException- if execution was cancelledLowlevelErrorInstructionDecodeException
-
isAtBreakpoint
public boolean isAtBreakpoint()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
isAtBreakpointin interfaceEmulator- Returns:
- true if halted at a breakpoint
-
getEmulateExecutionState
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorGet the low-level execution stateThis 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).- Specified by:
getEmulateExecutionStatein interfaceEmulator- Returns:
- emulator execution state. This can be useful within a memory fault handler to determine if a memory read was associated with instruction parsing (i.e., PCODE_EMIT) or normal an actual emulated read (i.e., EXECUTE).
-
isExecuting
public boolean isExecuting()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
isExecutingin interfaceEmulator- Returns:
- true if emulator is busy executing an instruction
-
getLanguage
Deprecated, for removal: This API element is subject to removal in a future version. -
disassemble
Deprecated, for removal: This API element is subject to removal in a future version.Disassemble from the current execute address- Parameters:
count- number of contiguous instructions to disassemble- Returns:
- list of instructions
-
getTickCount
public int getTickCount()Deprecated, for removal: This API element is subject to removal in a future version. -
getContextRegisterValue
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorReturns 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.
- Specified by:
getContextRegisterValuein interfaceEmulator- Returns:
- context as a RegisterValue object
-
setContextRegisterValue
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EmulatorSets 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.
- Specified by:
setContextRegisterValuein interfaceEmulator- Parameters:
regValue- is the value to set context to
-
addProvider
Deprecated, for removal: This API element is subject to removal in a future version.Add memory load image provider- Parameters:
provider- memory load image providerview- memory region which corresponds to provider
-
PcodeEmulatorinstead.