Package ghidra.trace.util

# Interface InstructionAdapterFromPrototype

All Superinterfaces:
  `CodeUnit`, `Instruction`, `MemBuffer`, `ProcessorContext`, `ProcessorContextView`, `PropertySet`, `TraceCodeUnit`, `TraceInstruction`

All Known Implementing Classes:
  `DBTraceInstruction`

public interface InstructionAdapterFromPrototype extends TraceInstruction

- ## Field Summary

  ### Fields inherited from interface ghidra.program.model.listing.CodeUnit

  `COMMENT_PROPERTY, DEFINED_DATA_PROPERTY, EOL_COMMENT, INSTRUCTION_PROPERTY, MNEMONIC, PLATE_COMMENT, POST_COMMENT, PRE_COMMENT, REPEATABLE_COMMENT, SPACE_PROPERTY`

  ### Fields inherited from interface ghidra.program.model.listing.Instruction

  `INVALID_DEPTH_CHANGE, MAX_LENGTH_OVERRIDE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default Address`
  `getAddress(int opIndex)`
  Get the Address for the given operand index if one exists.
  `default int`
  `getDefaultFallThroughOffset()`
  Get default fall-through offset in bytes from start of instruction to the fallthrough instruction.
  `default String`
  `getDefaultOperandRepresentation(int opIndex)`
  Get the operand representation for the given operand index without markup.
  `default List<Object>`
  `getDefaultOperandRepresentationList(int opIndex)`
  Get the operand representation for the given operand index.
  `default int`
  `getDelaySlotDepth()`
  Get the number of delay slot instructions for this argument.
  `default String`
  `getFullString()`
  `default Object[]`
  `getInputObjects()`
  Get the Input objects used by this instruction.
  `default String`
  `getMnemonicString()`
  Returns the mnemonic for this code unit, e.g., MOV, JMP.
  `default int`
  `getNumOperands()`
  Returns the number of operands for this code unit..
  `default RefType`
  `getOperandRefType(int opIndex)`
  Get the operand reference type for the given operand index.
  `default int`
  `getOperandType(int opIndex)`
  Get the type of a specific operand.
  `default Object[]`
  `getOpObjects(int opIndex)`
  Get objects used by this operand (Address, Scalar, Register ...)
  `default PcodeOp[]`
  `getPcode()`
  Get an array of PCode operations (micro code) that this instruction performs.
  `default PcodeOp[]`
  `getPcode(boolean includeOverrides)`
  Get an array of PCode operations (micro code) that this instruction performs.
  `default PcodeOp[]`
  `getPcode(int opIndex)`
  Get an array of PCode operations (micro code) that a particular operand performs to compute its value.
  `default Register`
  `getRegister(int opIndex)`
  If operand is a pure Register, return the register.
  `default Object[]`
  `getResultObjects()`
  Get the Result objects produced/affected by this instruction These would probably only be Register or Address
  `default Scalar`
  `getScalar(int opIndex)`
  Returns the scalar at the given operand index.
  `default String`
  `getSeparator(int opIndex)`
  Get the separator strings between an operand.
  `default boolean`
  `isInDelaySlot()`

  ### Methods inherited from interface ghidra.program.model.listing.CodeUnit

  `addMnemonicReference, addOperandReference, compareTo, contains, getAddressString, getBytes, getBytesInCodeUnit, getComment, getComment, getCommentAsArray, getCommentAsArray, getExternalReference, getLabel, getLength, getMaxAddress, getMinAddress, getPrimarySymbol, getReferenceIteratorTo, getSymbols, removeExternalReference, removeMnemonicReference, removeOperandReference, setComment, setComment, setCommentAsArray, setCommentAsArray, setPrimaryMemoryReference, setRegisterReference, setStackReference`

  ### Methods inherited from interface ghidra.program.model.listing.Instruction

  `clearFallThroughOverride, getFallFrom, getFallThrough, getFlowOverride, getFlows, getFlowType, getInstructionContext, getParsedBytes, getParsedLength, getPrototype, hasFallthrough, isFallthrough, isFallThroughOverridden, isLengthOverridden, setFallThrough, setFlowOverride, setLengthOverride`

  ### Methods inherited from interface ghidra.program.model.mem.MemBuffer

  `getAddress, getBigInteger, getByte, getBytes, getInputStream, getInputStream, getInt, getLong, getMemory, getShort, getUnsignedByte, getUnsignedInt, getUnsignedShort, getVarLengthInt, getVarLengthUnsignedInt, isBigEndian, isInitializedMemory`

  ### Methods inherited from interface ghidra.program.model.lang.ProcessorContext

  `clearRegister, setRegisterValue, setValue`

  ### Methods inherited from interface ghidra.program.model.lang.ProcessorContextView

  `getBaseContextRegister, getRegister, getRegisters, getRegisterValue, getValue, hasValue`

  ### Methods inherited from interface ghidra.program.model.util.PropertySet

  `getIntProperty, getObjectProperty, getStringProperty, getVoidProperty, hasProperty, propertyNames, removeProperty, setProperty, setProperty, setProperty, setProperty`

  ### Methods inherited from interface ghidra.trace.model.listing.TraceCodeUnit

  `delete, getBounds, getBytes, getEndSnap, getLanguage, getLifespan, getMnemonicReferences, getOperandReferences, getPlatform, getPrimaryReference, getProgram, getProperty, getRange, getReferencesFrom, getStartSnap, getThread, getTrace, setEndSnap, setProperty, setTypedProperty`

  ### Methods inherited from interface ghidra.trace.model.listing.TraceInstruction

  `getDefaultFallThrough, getDefaultFlows, getGuestDefaultFallThrough, getGuestDefaultFlows, getNext, getPrevious`

- ## Method Details

  - ### getFullString

    default String getFullString()

  - ### getMnemonicString

    default String getMnemonicString()
    Description copied from interface: `CodeUnit`
    Returns the mnemonic for this code unit, e.g., MOV, JMP.
    Specified by:
      `getMnemonicString` in interface `CodeUnit`
    Returns:
      the mnemonic for this code unit, e.g., MOV, JMP

  - ### getNumOperands

    default int getNumOperands()
    Description copied from interface: `CodeUnit`
    Returns the number of operands for this code unit..
    Specified by:
      `getNumOperands` in interface `CodeUnit`
    Returns:
      the number of operands for this code unit.

  - ### getAddress

    default Address getAddress(int opIndex)
    Description copied from interface: `CodeUnit`
    Get the Address for the given operand index if one exists. Data objects have one operand (the value).
    Specified by:
      `getAddress` in interface `CodeUnit`
    Parameters:
      `opIndex` - index of the operand.
    Returns:
      An address if the operand represents a fully qualified address (given the context), or if the operand is a Scalar treated as an address. Null is returned if no address or scalar exists on that operand.

  - ### getScalar

    default Scalar getScalar(int opIndex)
    Description copied from interface: `CodeUnit`
    Returns the scalar at the given operand index. Data objects have one operand (the value).
    Specified by:
      `getScalar` in interface `CodeUnit`
    Parameters:
      `opIndex` - index of the operand.
    Returns:
      the scalar at the given operand index or null if no scalar exists at that index.

  - ### getRegister

    default Register getRegister(int opIndex)
    Description copied from interface: `Instruction`
    If operand is a pure Register, return the register.
    Specified by:
      `getRegister` in interface `Instruction`
    Parameters:
      `opIndex` - index of the operand.
    Returns:
      A register if the operand represents a register.

  - ### getOpObjects

    default Object[] getOpObjects(int opIndex)
    Description copied from interface: `Instruction`
    Get objects used by this operand (Address, Scalar, Register ...)
    Specified by:
      `getOpObjects` in interface `Instruction`
    Parameters:
      `opIndex` - index of the operand.
    Returns:
      objects used by this operand (Address, Scalar, Register ...)

  - ### getInputObjects

    default Object[] getInputObjects()
    Description copied from interface: `Instruction`
    Get the Input objects used by this instruction. These could be Scalars, Registers, Addresses
    Specified by:
      `getInputObjects` in interface `Instruction`
    Returns:
      an array of objects that are used by this instruction

  - ### getResultObjects

    default Object[] getResultObjects()
    Description copied from interface: `Instruction`
    Get the Result objects produced/affected by this instruction These would probably only be Register or Address
    Specified by:
      `getResultObjects` in interface `Instruction`
    Returns:
      an array of objects that are affected by this instruction

  - ### getDefaultOperandRepresentation

    default String getDefaultOperandRepresentation(int opIndex)
    Description copied from interface: `Instruction`
    Get the operand representation for the given operand index without markup.
    Specified by:
      `getDefaultOperandRepresentation` in interface `Instruction`
    Parameters:
      `opIndex` - operand index
    Returns:
      operand represented as a string.

  - ### getDefaultOperandRepresentationList

    default List<Object> getDefaultOperandRepresentationList(int opIndex)
    Description copied from interface: `Instruction`
    Get the operand representation for the given operand index. A list of Register, Address, Scalar, Character and String objects is returned - without markup!
    Specified by:
      `getDefaultOperandRepresentationList` in interface `Instruction`
    Parameters:
      `opIndex` - operand index
    Returns:
      ArrayList of pieces of the operand representation. Unsupported languages may return null.

  - ### getSeparator

    default String getSeparator(int opIndex)
    Description copied from interface: `Instruction`
    Get the separator strings between an operand. The separator string for 0 are the characters before the first operand. The separator string for numOperands+1 are the characters after the last operand.
    Specified by:
      `getSeparator` in interface `Instruction`
    Parameters:
      `opIndex` - valid values are 0 thru numOperands+1
    Returns:
      separator string, or null if there is no string

  - ### getOperandType

    default int getOperandType(int opIndex)
    Description copied from interface: `Instruction`
    Get the type of a specific operand.
    Specified by:
      `getOperandType` in interface `Instruction`
    Parameters:
      `opIndex` - the index of the operand. (zero based)
    Returns:
      the type of the operand.
    See Also:
      - `OperandType`

  - ### getOperandRefType

    default RefType getOperandRefType(int opIndex)
    Description copied from interface: `Instruction`
    Get the operand reference type for the given operand index.
    Specified by:
      `getOperandRefType` in interface `Instruction`
    Parameters:
      `opIndex` - operand index
    Returns:
      the operand reference type for the given operand index.

  - ### getDefaultFallThroughOffset

    default int getDefaultFallThroughOffset()
    Description copied from interface: `Instruction`
    Get default fall-through offset in bytes from start of instruction to the fallthrough instruction. This accounts for any instructions contained with delay slots.
    Specified by:
      `getDefaultFallThroughOffset` in interface `Instruction`
    Returns:
      default fall-through offset or zero (0) if instruction has no fallthrough

  - ### getPcode

    default PcodeOp[] getPcode()
    Description copied from interface: `Instruction`
    Get an array of PCode operations (micro code) that this instruction performs. Flow overrides are not factored into pcode.
    Specified by:
      `getPcode` in interface `Instruction`
    Returns:
      an array of Pcode operations, a zero length array if the language does not support PCode

  - ### getPcode

    default PcodeOp[] getPcode(boolean includeOverrides)
    Description copied from interface: `Instruction`
    Get an array of PCode operations (micro code) that this instruction performs. NOTE: If includeOverrides is true, unique temporary varnodes may be produced which vary in size to those produced for other instructions.
    Specified by:
      `getPcode` in interface `Instruction`
    Parameters:
      `includeOverrides` - if true any flow overrides will be factored into generated pcode.
    Returns:
      an array of Pcode operations, a zero length array if the language does not support PCode

  - ### getPcode

    default PcodeOp[] getPcode(int opIndex)
    Get an array of PCode operations (micro code) that a particular operand performs to compute its value. NOTE: This assumes operand pcode is not affected by flow override
    Specified by:
      `getPcode` in interface `Instruction`
    Parameters:
      `opIndex` - index of the operand to retrieve PCode
    Returns:
      an array of PCode operations, a zero length array if the language does not support PCode

  - ### getDelaySlotDepth

    default int getDelaySlotDepth()
    Description copied from interface: `Instruction`
    Get the number of delay slot instructions for this argument. This should be 0 for instructions which don't have a delay slot. This is used to support the delay slots found on some RISC processors such as SPARC and the PA-RISC. This returns an integer instead of a boolean in case some other processor executes more than one instruction from a delay slot.
    Specified by:
      `getDelaySlotDepth` in interface `Instruction`
    Returns:
      delay slot depth (number of instructions)

  - ### isInDelaySlot

    default boolean isInDelaySlot()
    Specified by:
      `isInDelaySlot` in interface `Instruction`
    Returns:
      true if this instruction was disassembled in a delay slot