Class SequenceNumber

java.lang.Object
ghidra.program.model.pcode.SequenceNumber
All Implemented Interfaces:
Comparable<SequenceNumber>

public class SequenceNumber extends Object implements Comparable<SequenceNumber>
Basically a unique address for a PcodeOp It is unique, maintains original assembly instruction address, and is comparable within a basic block
  • Constructor Summary

    Constructors
    Constructor
    Description
    SequenceNumber(Address instrAddr, int sequenceNum)
    Construct a sequence number for an instruction at an address and sequence of pcode op within that instructions set of pcode.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    decode(Decoder decoder)
    Decode a new Sequence number from the stream
    void
    encode(Encoder encoder)
    Encode this sequence number to the stream
    boolean
     
    int
    Get relative position information of PcodeOps within a basic block, may change as basic block is edited.
     
    int
    Get unique Sub-address for distinguishing multiple PcodeOps at one instruction address.
    int
     
    void
    setOrder(int o)
    Set relative position information of PcodeOps within a basic block, may change as basic block is edited.
    void
    setTime(int t)
    Set unique Sub-address for distinguishing multiple PcodeOps at one instruction address.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SequenceNumber

      public SequenceNumber(Address instrAddr, int sequenceNum)
      Construct a sequence number for an instruction at an address and sequence of pcode op within that instructions set of pcode.
      Parameters:
      instrAddr - address of instruction
      sequenceNum - sequence of pcode op with an instructions pcode ops
  • Method Details

    • getTarget

      public Address getTarget()
      Returns:
      get address of instruction this sequence belongs to
    • getTime

      public int getTime()
      Get unique Sub-address for distinguishing multiple PcodeOps at one instruction address. Does not change over lifetime of PcodeOp
      Returns:
      unique id for a pcode op within a given instruction
    • setTime

      public void setTime(int t)
      Set unique Sub-address for distinguishing multiple PcodeOps at one instruction address. Does not change over lifetime of PcodeOp
      Parameters:
      t - unique id
    • getOrder

      public int getOrder()
      Get relative position information of PcodeOps within a basic block, may change as basic block is edited.
      Returns:
      relative position of pcode in a basic block
    • setOrder

      public void setOrder(int o)
      Set relative position information of PcodeOps within a basic block, may change as basic block is edited.
      Parameters:
      o - relative position of pcodeOp within a basic block
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(SequenceNumber sq)
      Specified by:
      compareTo in interface Comparable<SequenceNumber>
    • encode

      public void encode(Encoder encoder) throws IOException
      Encode this sequence number to the stream
      Parameters:
      encoder - is the stream encoder
      Throws:
      IOException - for errors in the underlying stream
    • decode

      public static SequenceNumber decode(Decoder decoder) throws DecoderException
      Decode a new Sequence number from the stream
      Parameters:
      decoder - is the stream decoder
      Returns:
      new sequence number
      Throws:
      DecoderException - for an invalid encoding
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object