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 Summary
Modifier and TypeMethodDescriptioncopy()
Perform a deep copy of this frame.boolean
deleteVariable
(int id) Remove (unset) a variable.void
Remove (unset) all variables.int
Retrieve the current iteration count in the frame.Retrieve the method signature for this frame.Retrieve the optional next PC, if one was set.int
getPC()
Retrieve the current PC.Retrieve the emulated exception raised by the emulation of this method.getVariable
(int id) Read a variable.getVariable
(int id, boolean readNullIfUnset) Read a variable.Reserved for internal use.boolean
hasVariable
(int id) Determine whether a variable is set (has a value).boolean
Determine whether the emulation of the method is complete.void
setExecutionComplete
(boolean done) This method is used by the emulator to specify that the emulation of the method is complete.void
setPC
(int PC) Set the current PC.void
This method is used by the emulator to specify that the emulation of the method raised an exception.void
setVariable
(int id, IDImm val) Write a variable.void
Reserved for internal use.int
updatePC()
Update the current PC with thenext PC
and return it.
-
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 viaIDInstruction#evaluate
. The PC can be updated with the next PC withupdatePC()
.- Returns:
-
updatePC
int updatePC()Update the current PC with thenext PC
and return it.- Returns:
- the now current PC (was the next PC)
-
setVariable
Write a variable.- Parameters:
id
- variable idval
- non-null value- Throws:
DexDecEvaluationException
-
getVariable
Read a variable.- Parameters:
id
- variable idreadNullIfUnset
- 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
Read a variable. The variable must exist.- Parameters:
id
- variable id- Returns:
- non-null value
- Throws:
DexDecEvaluationException
- if the variable is unset
-
hasVariable
Determine whether a variable is set (has a value).- Parameters:
id
- variable id- Returns:
- Throws:
DexDecEvaluationException
-
deleteVariable
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
Reserved for internal use.- Returns:
- a full-access map of variables
-
setVarMap
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 anexception 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 anexception is raised
, the emulation is not considered complete.- Returns:
- true if the method has "returned"
-
setRaisedException
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:
-