Class SleighInstructionDecoder

java.lang.Object
ghidra.pcode.emu.SleighInstructionDecoder
All Implemented Interfaces:
InstructionDecoder

public class SleighInstructionDecoder extends Object implements InstructionDecoder
The default instruction decoder, based on Sleigh

This simply uses a Disassembler on the machine's memory state.

  • Field Details

  • Constructor Details

  • Method Details

    • getLanguage NEW

      public Language getLanguage()
      Description copied from interface: InstructionDecoder
      Get the language for this decoder
      Specified by:
      getLanguage in interface InstructionDecoder
      Returns:
      the language
    • useCachedInstruction NEW

      protected boolean useCachedInstruction(Address address, RegisterValue context)
    • parseNewBlock NEW

      protected void parseNewBlock(Address address, RegisterValue context)
    • decodeInstruction MODIFIED

      public PseudoInstruction decodeInstruction(Address address, RegisterValue context)
      return type: Instruction → PseudoInstruction
      -ghidra.program.model.listing.Instruction decodeInstruction(ghidra.program.model.address.Address address, ghidra.program.model.lang.RegisterValue context)
      +ghidra.app.util.PseudoInstruction decodeInstruction(ghidra.program.model.address.Address address, ghidra.program.model.lang.RegisterValue context)
      Description copied from interface: InstructionDecoder
      Decode the instruction starting at the given address using the given context

      This method cannot return null. If a decode error occurs, it must throw an exception.

      Specified by:
      decodeInstruction in interface InstructionDecoder
      Parameters:
      address - the address to start decoding
      context - the disassembler/decode context
      Returns:
      the instruction
    • branched

      public void branched(Address address)
      Description copied from interface: InstructionDecoder
      Inform the decoder that the emulator thread just branched
      Specified by:
      branched in interface InstructionDecoder
      Parameters:
      address -
    • computeLength

      protected int computeLength()
      Compute the "length" of an instruction, including any delay-slotted instructions that follow
      Returns:
      the length
    • getLastLengthWithDelays

      public int getLastLengthWithDelays()
      Description copied from interface: InstructionDecoder
      Get the length of the last decoded instruction, including delay slots
      Specified by:
      getLastLengthWithDelays in interface InstructionDecoder
      Returns:
      the length
    • getLastInstruction

      public Instruction getLastInstruction()
      Description copied from interface: InstructionDecoder
      Get the last instruction decoded
      Specified by:
      getLastInstruction in interface InstructionDecoder
      Returns:
      the instruction