Class JitPassage.DecodedPcodeOp

java.lang.Object
ghidra.program.model.pcode.PcodeOp
ghidra.pcode.emu.jit.JitPassage.DecodedPcodeOp
Direct Known Subclasses:
JitPassage.DecodeErrorPcodeOp, JitPassage.NopPcodeOp
Enclosing class:
JitPassage

public static class JitPassage.DecodedPcodeOp extends PcodeOp
An extension of PcodeOp that carries along with it the address and decode context where it occurred.

There is a difference between at's address vs. seqnum's target. The former is determined by the JitPassageDecoder and applied to all p-code ops generated at that address (and context value), including those from injected Sleigh. The latter is determined by the Instruction (or injected PcodeProgram), which have less information about their origins. There are also JitPassage.DecodeErrorPcodeOp and JitPassage.NopPcodeOp, which are synthesized by the JitPassageDecoder without an instruction or inject. This information is required for bookkeeping, esp., when updating the emulator's program counter and decode context when a p-code op produces an unexpected run-time error.

  • Constructor Details

    • DecodedPcodeOp

      public DecodedPcodeOp(JitPassage.AddrCtx at, PcodeOp original)
      Re-write a p-code op including its address and context value

      Aside from at, everything is copied from the given original p-code op.

      Parameters:
      at - the address and context value where the op was produced
      original - the original p-code op
  • Method Details

    • getAt

      public JitPassage.AddrCtx getAt()
      Get the address and context value where this op was produced
      Returns:
      the address-context pair
    • getCounter

      public Address getCounter()
      Get the address where this op was produced
      Returns:
      the address
    • getContext

      public RegisterValue getContext()
      Get the decode context where this op was produced
      Returns:
      the decode context
    • isInstructionStart

      public boolean isInstructionStart()
      Check if this op represents the start of an instruction

      If this p-code op was produced by an inject, this will return false! It only returns true for an op that is genuinely the first op in the result of Instruction.getPcode(). WARNING: This should not be used for branching purposes, because branches to a given address are meant to target any injections there, too. Currently, this is used only to count the number of instructions actually executed.

      Returns:
      true if this op is the first of an instruction
      See Also: