Interface IDEmuFrame


public interface IDEmuFrame
An emulator frame, used by dexdec State objects. A frame of method execution holds the PC, variable values, the raised exception exception (if any). Frames are stacked: each sub-routine call creates another frame in the stack. A frame is part of an emulation context.
See Also:
  • Method Details

    • copy

      IDEmuFrame copy()
      Perform a deep copy of this frame.
      Returns:
    • getMethodSignature

      String getMethodSignature()
      Retrieve the method signature for this frame.
      Returns:
    • getIterationCount

      int getIterationCount()
      Retrieve the current iteration count in the frame.
      Returns:
    • setPC

      void setPC(int PC)
      Set the current PC.
      Parameters:
      PC -
    • getPC

      int getPC()
      Retrieve the current PC.
      Returns:
    • getNextPC

      Integer getNextPC()
      Retrieve the optional next PC, if one was set. The next PC is set when evaluating an instruction via IDInstruction#evaluate. The PC can be updated with the next PC with updatePC().
      Returns:
    • updatePC

      int updatePC()
      Update the current PC with the next PC and return it.
      Returns:
      the now current PC (was the next PC)
    • setVariable

      void setVariable(int id, IDImm val) throws DexDecEvaluationException
      Write a variable.
      Parameters:
      id - variable id
      val - non-null value
      Throws:
      DexDecEvaluationException
    • getVariable

      IDImm getVariable(int id, boolean readNullIfUnset) throws DexDecEvaluationException
      Read a variable.
      Parameters:
      id - variable id
      readNullIfUnset - fail-safe to avoid throwing if the variable is unset
      Returns:
      a value, null if the variable is unset and `readNullIfUnset` is true
      Throws:
      DexDecEvaluationException - if the variable is unset and `readNullIfUnset` is false
    • getVariable

      IDImm getVariable(int id) throws DexDecEvaluationException
      Read a variable. The variable must exist.
      Parameters:
      id - variable id
      Returns:
      non-null value
      Throws:
      DexDecEvaluationException - if the variable is unset
    • hasVariable

      boolean hasVariable(int id) throws DexDecEvaluationException
      Determine whether a variable is set (has a value).
      Parameters:
      id - variable id
      Returns:
      Throws:
      DexDecEvaluationException
    • deleteVariable

      boolean deleteVariable(int id) throws DexDecEvaluationException
      Remove (unset) a variable.
      Parameters:
      id - variable id
      Returns:
      true if the variable existed and was deleted
      Throws:
      DexDecEvaluationException
    • deleteVariables

      void deleteVariables()
      Remove (unset) all variables.
    • getVarMap

      Map<Integer,IDImm> getVarMap()
      Reserved for internal use.
      Returns:
      a full-access map of variables
    • setVarMap

      void setVarMap(Map<Integer,IDImm> varmap)
      Reserved for internal use.
      Parameters:
      varmap - a map of variables
    • setExecutionComplete

      void setExecutionComplete(boolean done)
      This method is used by the emulator to specify that the emulation of the method is complete. If an exception is raised, the emulation is not considered complete.
      Parameters:
      done - true if the method has "returned"
    • isExecutionComplete

      boolean isExecutionComplete()
      Determine whether the emulation of the method is complete. If an exception is raised, the emulation is not considered complete.
      Returns:
      true if the method has "returned"
    • setRaisedException

      void setRaisedException(IDImm ex)
      This method is used by the emulator to specify that the emulation of the method raised an exception.
      Parameters:
      ex - an emulated exception
    • getRaisedException

      IDImm getRaisedException()
      Retrieve the emulated exception raised by the emulation of this method.
      Returns: