Class JitDataFlowState.MiniDFState

java.lang.Object
ghidra.pcode.emu.jit.analysis.JitDataFlowState.MiniDFState
Enclosing class:
JitDataFlowState

public class JitDataFlowState.MiniDFState extends Object
A minimal data flow machine state that can be captured by a JitCallOtherOpIf.
  • Method Details

    • endOf

      protected static long endOf(Map.Entry<Long,JitVal> entry)
      Compute the upper (exclusive) offset of a given definition entry
      Parameters:
      entry - the entry
      Returns:
      the upper offset, exclusive
    • doClear

      protected void doClear(NavigableMap<Long,JitVal> map, Varnode varnode)
      Clear all definition entries in the given per-space map for the given varnode

      Any entries completely covered by the given varnode (including an exact match) are removed from the map. Those partially covered will be replaced by subpieces of their former selves such that no part within the cleared varnode remains defined.

      Parameters:
      map - the map to modify
      varnode - the varnode whose definitions to remove
    • doSet

      protected void doSet(NavigableMap<Long,JitVal> map, Varnode varnode, JitVal val)
      The implementation of set(Varnode, JitVal) for a given address space
      Parameters:
      map - the map to modify for the given space
      varnode - the varnode whose value to define
      val - the varnode's new definition
    • set

      public void set(Varnode varnode, JitVal val)
      Set one or more definition entries in the given map for the given varnode to the given value

      Ordinary, this just sets the one varnode to the given value; however, if the given value is the output of a catenation, then each input part is entered into the map separately, and the synthetic catenation dropped. The behavior avoids nested catenations.

      Parameters:
      varnode - the varnode
      val - the value
    • doGetDefinitions

      protected List<JitVal> doGetDefinitions(NavigableMap<Long,JitVal> map, AddressSpace space, long offset, int size)
      The implementation of getDefinitions(AddressSpace, long, int) for a given address space
      Parameters:
      map - the map of values for the given space
      space - the address space
      offset - the offset within the space
      size - the size of the varnode
      Returns:
      the list of values
    • getDefinitions

      public List<JitVal> getDefinitions(AddressSpace space, long offset, int size)
      Get an ordered list of all values involved in the latest definition of the given varnode.

      In the simplest case, the list consists of exactly one SSA variable whose varnode exactly matches that requested. In other cases, e.g., when only a subregister is defined, the list may have several entries, some of which may be missing.

      The list is ordered according to machine endianness. That is for little endian, the values are ordered from least to most significant parts of the varnode defined. This is congruent with how JitDataFlowArithmetic.catenate(Varnode, List) expects parts to be listed.

      Parameters:
      space - the address space of the varnode
      offset - the offset of the varnode
      size - the size in bytes of the varnode
      Returns:
      the list of values
    • getDefinitions

      public List<JitVal> getDefinitions(Varnode varnode)
      Get an ordered list of all values involved in the latest definition of the given varnode.
      Parameters:
      varnode - the varnode whose definitions to retrieve
      Returns:
      the list of values
      See Also:
    • getDefinitions

      public List<JitVal> getDefinitions(Register register)
      Get an ordered list of all values involved in the latest definition of the given varnode.
      Parameters:
      register - the register whose definitions to retrieve
      Returns:
      the list of values
      See Also:
    • generatePhis

      protected List<JitVal> generatePhis(List<JitVal> defs, Collection<JitPhiOp> phiQueue)
      Replace missing variables with phi nodes, mutating the given list in place
      Parameters:
      defs - the definitions
      Returns:
      the same list, modified
    • getVar

      public JitVal getVar(Varnode varnode)
      Get the value of the given varnode

      This is the implementation of JitDataFlowState.getVar(AddressSpace, JitVal, int, boolean, Reason), but only for uniques and registers.

      Parameters:
      varnode - the varnode
      Returns:
      the value
    • copy

      Copy this mini state
      Returns:
      the copy