java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.simulator.CMethodState

public class CMethodState extends Object
State of a simulated method.
  • the concrete value associated to each ICIdentifier
  • the concrete return value, if the execution terminated
  • a CMethodState.ControlWord value to select the next instruction to execute
The state also provides an equivalence relationship areEquivalent(CMethodState, CMethodState, boolean, boolean), to test if another state might represent the same computation.
  • Constructor Details

  • Method Details

    • setValue

      public void setValue(ICElement element, Long value, CEnvironment environment)
      Sets a variable --either local or global-- value.
    • setLocalVarValue

      public void setLocalVarValue(ICIdentifier id, Long value)
    • getIdentifier

      public ICIdentifier getIdentifier(ICElement element)
    • getLocalVarValue

      public Long getLocalVarValue(ICElement element)
    • getStatements

      public List<ICStatement> getStatements()
    • areEquivalent

      public static boolean areEquivalent(CMethodState state1, CMethodState state2, boolean checkProducedValues, boolean checkControlWords)
      Checks if two states might represent the same computation, namely:
      • if the return values are the same
      • conditionally, if the same values got produced in both states
      • conditionally, if the final control words are the same
    • getControlWord

      public CMethodState.ControlWord getControlWord()
    • setControlWord

      public void setControlWord(CMethodState.ControlWord controlWord)
    • toString

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

      public Long getReturnValue()
    • setReturnValue

      public void setReturnValue(Long returnValue)
    • getLocalVarValues

      public Map<ICIdentifier,Long> getLocalVarValues()
    • getControlWordIndex

      public int getControlWordIndex()
    • setControlWordIndex

      public void setControlWordIndex(int controlWordIndex)
    • isMethodParametersSpoiled

      public boolean isMethodParametersSpoiled()
      If true, parameters of methods called are considered spoiled; the corresponding variables' values will be modified by the simulation. If false, they are left intact.
    • setMethodParametersSpoiled

      public void setMethodParametersSpoiled(boolean methodParametersSpoiled)