Interface IBasicBlock<InsnType extends IInstruction>

Type Parameters:
InsnType -
All Superinterfaces:
Iterable<InsnType>
All Known Implementing Classes:
BasicBlock, BasicBlock

public interface IBasicBlock<InsnType extends IInstruction> extends Iterable<InsnType>
Generic interface for CFG's basic block objects.
See Also:
  • Method Details

    • getFirstAddress

      long getFirstAddress()
      Address of first instruction in the block.
      Returns:
    • getBase

      long getBase()
      Address of first instruction in the block.
      Returns:
    • getLastAddress

      long getLastAddress()
      Address of last instruction in the block.
      Returns:
    • getEndAddress

      long getEndAddress()
      Address following the last instruction of the block (ie, last exclusive address).
      Returns:
    • isEmpty

      boolean isEmpty()
      Determine if the block has 0 instruction.
      Returns:
    • size

      int size()
      Get the number of instructions in the block.
      Returns:
    • get

      InsnType get(int index)
      Get the instruction at the specified index.
      Parameters:
      index -
      Returns:
    • getLast

      InsnType getLast()
      Get the last instruction of the block.
      Returns:
    • getInstructions

      List<InsnType> getInstructions()
      Get a copy of the list of instructions that make up this basic block.
      Returns:
    • getSizeOfInstructions

      int getSizeOfInstructions()
    • getAddressOfInstruction

      long getAddressOfInstruction(int index)
    • getIndexOfInstruction

      int getIndexOfInstruction(long address)
      Parameters:
      address - instruction address
      Returns:
      -1 if there is no instruction starting at the provided address
    • getInstruction

      InsnType getInstruction(long address)
      Get the instruction located at the exact address.
      Parameters:
      address -
      Returns:
    • canThrow

      boolean canThrow()
    • getOutputBlocks

      List<? extends IBasicBlock<InsnType>> getOutputBlocks()
      Get the regular output blocks.
      Returns:
      a copy of the list of regular output blocks
    • getOutputBlock

      IBasicBlock<InsnType> getOutputBlock(int index)
      Get a regular output block.
      Parameters:
      index -
      Returns:
    • getIrregularOutputBlocks

      List<? extends IBasicBlock<InsnType>> getIrregularOutputBlocks()
      Get irregular output blocks.
      Returns:
      a copy of the list of irregular output blocks
    • getIrregularOutputBlock

      IBasicBlock<InsnType> getIrregularOutputBlock(int index)
      Get an irregular output block.
      Parameters:
      index -
      Returns:
    • getAllOutputBlocks

      List<? extends IBasicBlock<InsnType>> getAllOutputBlocks()
      Get regular and irregular output blocks.
      Returns:
      a copy of the list of all output blocks
    • getOutputs

      List<? extends IBasicBlock<InsnType>> getOutputs()
      Retrieve a read-only list of output blocks (regular).

      NOTE: This method is faster than getOutputBlocks() since it does not provide a copy of the list.

      Returns:
    • getIrregularOutputs

      List<? extends IBasicBlock<InsnType>> getIrregularOutputs()
      Retrieve a read-only list of irregular output blocks.

      NOTE: This method is faster than getIrregularOutputBlocks() since it does not provide a copy of the list.

      Returns:
    • getAllOutputs

      Iterable<? extends IBasicBlock<InsnType>> getAllOutputs()
      Retrieve a read-only iterable of regular and irregular output blocks.

      NOTE: This method is faster than getAllOutputBlocks() since it does not provide a copy of the list.

      Returns:
    • getInputBlocks

      List<? extends IBasicBlock<InsnType>> getInputBlocks()
      Get the regular input blocks.
      Returns:
      a copy of the list of regular input blocks
    • getInputBlock

      IBasicBlock<InsnType> getInputBlock(int index)
      Get a regular input block.
      Parameters:
      index - block index
      Returns:
      a block
    • getIrregularInputBlocks

      List<? extends IBasicBlock<InsnType>> getIrregularInputBlocks()
    • getIrregularInputBlock

      IBasicBlock<InsnType> getIrregularInputBlock(int index)
      Get an irregular input block.
      Parameters:
      index - block index
      Returns:
      a block
    • getAllInputBlocks

      List<? extends IBasicBlock<InsnType>> getAllInputBlocks()
    • getInputs

      List<? extends IBasicBlock<InsnType>> getInputs()
      Retrieve a read-only list of input blocks (regular).

      NOTE: This method is faster than getInputBlocks() since it does not provide a copy of the list.

      Returns:
    • getIrregularInputs

      List<? extends IBasicBlock<InsnType>> getIrregularInputs()
      Retrieve a read-only list of irregular input blocks.

      NOTE: This method is faster than getIrregularInputBlocks() since it does not provide a copy of the list.

      Returns:
    • getAllInputs

      Iterable<? extends IBasicBlock<InsnType>> getAllInputs()
      Retrieve a read-only iterable of regular and irregular input blocks.

      NOTE: This method is faster than getAllInputBlocks() since it does not provide a copy of the list.

      Returns:
    • outsize

      int outsize()
    • irroutsize

      int irroutsize()
    • alloutsize

      int alloutsize()
    • insize

      int insize()
      Get the number of regular input edges to this block.
      Returns:
    • irrinsize

      int irrinsize()
      Get the number of irregular input edges to this block.
      Returns:
    • allinsize

      int allinsize()
      Get the total number of input edges to this block.
      Returns: