Package ghidra.trace.util
Interface InstructionAdapterFromPrototype
- All Superinterfaces:
CodeUnit,Instruction,MemBuffer,ProcessorContext,ProcessorContextView,PropertySet,TraceCodeUnit,TraceInstruction
- All Known Implementing Classes:
DBTraceInstruction
-
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_PROPERTYFields inherited from interface ghidra.program.model.listing.Instruction
INVALID_DEPTH_CHANGE, MAX_LENGTH_OVERRIDE -
Method Summary
Modifier and TypeMethodDescriptiondefault AddressgetAddress(int opIndex) Get the Address for the given operand index if one exists.default intGet default fall-through offset in bytes from start of instruction to the fallthrough instruction.default StringgetDefaultOperandRepresentation(int opIndex) Get the operand representation for the given operand index without markup.getDefaultOperandRepresentationList(int opIndex) Get the operand representation for the given operand index.default intGet the number of delay slot instructions for this argument.default Stringdefault Object[]Get the Input objects used by this instruction.default StringReturns the mnemonic for this code unit, e.g., MOV, JMP.default intReturns the number of operands for this code unit..default RefTypegetOperandRefType(int opIndex) Get the operand reference type for the given operand index.default intgetOperandType(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 RegistergetRegister(int opIndex) If operand is a pure Register, return the register.default Object[]Get the Result objects produced/affected by this instruction These would probably only be Register or Addressdefault ScalargetScalar(int opIndex) Returns the scalar at the given operand index.default StringgetSeparator(int opIndex) Get the separator strings between an operand.default booleanMethods 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, setStackReferenceMethods inherited from interface ghidra.program.model.listing.Instruction
clearFallThroughOverride, getFallFrom, getFallThrough, getFlowOverride, getFlows, getFlowType, getInstructionContext, getParsedBytes, getParsedLength, getPrototype, hasFallthrough, isFallthrough, isFallThroughOverridden, isLengthOverridden, setFallThrough, setFlowOverride, setLengthOverrideMethods inherited from interface ghidra.program.model.mem.MemBuffer
getAddress, getBigInteger, getByte, getBytes, getInputStream, getInputStream, getInt, getLong, getMemory, getShort, getUnsignedByte, getUnsignedInt, getUnsignedShort, getVarLengthInt, getVarLengthUnsignedInt, isBigEndian, isInitializedMemoryMethods inherited from interface ghidra.program.model.lang.ProcessorContext
clearRegister, setRegisterValue, setValueMethods inherited from interface ghidra.program.model.lang.ProcessorContextView
getBaseContextRegister, getRegister, getRegisters, getRegisterValue, getValue, hasValueMethods inherited from interface ghidra.program.model.util.PropertySet
getIntProperty, getObjectProperty, getStringProperty, getVoidProperty, hasProperty, propertyNames, removeProperty, setProperty, setProperty, setProperty, setPropertyMethods 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, setTypedPropertyMethods inherited from interface ghidra.trace.model.listing.TraceInstruction
getDefaultFallThrough, getDefaultFlows, getGuestDefaultFallThrough, getGuestDefaultFlows, getNext, getPrevious
-
Method Details
-
getFullString
-
getMnemonicString
Description copied from interface:CodeUnitReturns the mnemonic for this code unit, e.g., MOV, JMP.- Specified by:
getMnemonicStringin interfaceCodeUnit- Returns:
- the mnemonic for this code unit, e.g., MOV, JMP
-
getNumOperands
default int getNumOperands()Description copied from interface:CodeUnitReturns the number of operands for this code unit..- Specified by:
getNumOperandsin interfaceCodeUnit- Returns:
- the number of operands for this code unit.
-
getAddress
Description copied from interface:CodeUnitGet the Address for the given operand index if one exists. Data objects have one operand (the value).- Specified by:
getAddressin interfaceCodeUnit- 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
Description copied from interface:CodeUnitReturns the scalar at the given operand index. Data objects have one operand (the value). -
getRegister
Description copied from interface:InstructionIf operand is a pure Register, return the register.- Specified by:
getRegisterin interfaceInstruction- Parameters:
opIndex- index of the operand.- Returns:
- A register if the operand represents a register.
-
getOpObjects
Description copied from interface:InstructionGet objects used by this operand (Address, Scalar, Register ...)- Specified by:
getOpObjectsin interfaceInstruction- Parameters:
opIndex- index of the operand.- Returns:
- objects used by this operand (Address, Scalar, Register ...)
-
getInputObjects
Description copied from interface:InstructionGet the Input objects used by this instruction. These could be Scalars, Registers, Addresses- Specified by:
getInputObjectsin interfaceInstruction- Returns:
- an array of objects that are used by this instruction
-
getResultObjects
Description copied from interface:InstructionGet the Result objects produced/affected by this instruction These would probably only be Register or Address- Specified by:
getResultObjectsin interfaceInstruction- Returns:
- an array of objects that are affected by this instruction
-
getDefaultOperandRepresentation
Description copied from interface:InstructionGet the operand representation for the given operand index without markup.- Specified by:
getDefaultOperandRepresentationin interfaceInstruction- Parameters:
opIndex- operand index- Returns:
- operand represented as a string.
-
getDefaultOperandRepresentationList
Description copied from interface:InstructionGet the operand representation for the given operand index. A list of Register, Address, Scalar, Character and String objects is returned - without markup!- Specified by:
getDefaultOperandRepresentationListin interfaceInstruction- Parameters:
opIndex- operand index- Returns:
- ArrayList of pieces of the operand representation. Unsupported languages may return null.
-
getSeparator
Description copied from interface:InstructionGet 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:
getSeparatorin interfaceInstruction- 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:InstructionGet the type of a specific operand.- Specified by:
getOperandTypein interfaceInstruction- Parameters:
opIndex- the index of the operand. (zero based)- Returns:
- the type of the operand.
- See Also:
-
getOperandRefType
Description copied from interface:InstructionGet the operand reference type for the given operand index.- Specified by:
getOperandRefTypein interfaceInstruction- Parameters:
opIndex- operand index- Returns:
- the operand reference type for the given operand index.
-
getDefaultFallThroughOffset
default int getDefaultFallThroughOffset()Description copied from interface:InstructionGet 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:
getDefaultFallThroughOffsetin interfaceInstruction- Returns:
- default fall-through offset or zero (0) if instruction has no fallthrough
-
getPcode
Description copied from interface:InstructionGet an array of PCode operations (micro code) that this instruction performs. Flow overrides are not factored into pcode.- Specified by:
getPcodein interfaceInstruction- Returns:
- an array of Pcode operations, a zero length array if the language does not support PCode
-
getPcode
Description copied from interface:InstructionGet 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:
getPcodein interfaceInstruction- 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
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:
getPcodein interfaceInstruction- 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:InstructionGet 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:
getDelaySlotDepthin interfaceInstruction- Returns:
- delay slot depth (number of instructions)
-
isInDelaySlot
default boolean isInDelaySlot()- Specified by:
isInDelaySlotin interfaceInstruction- Returns:
- true if this instruction was disassembled in a delay slot
-