Package soot.dotnet.members.method
Class DotnetBodyVariableManager
- java.lang.Object
-
- soot.dotnet.members.method.DotnetBodyVariableManager
-
public class DotnetBodyVariableManager extends Object
Part of the DotnetBody Manager for variables in a .NET Body (Store, initialization, etc.)
-
-
Field Summary
Fields Modifier and Type Field Description LocalGeneratorlocalGenerator
-
Constructor Summary
Constructors Constructor Description DotnetBodyVariableManager(DotnetBody dotnetBody, Body mainJb)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInitLocalVariables(List<ProtoIlInstructions.IlVariableMsg> variableMsgList)Add and Initialize all known variables/locals at the beginningvoidaddLocalsToCast(String local)Sometimes we need to cast locals to fulfill the validation.voidaddLocalVariable(Local local)LocaladdOrGetVariable(ProtoIlInstructions.IlVariableMsg v, Body jbTmp)Add or get variable/local of this method bodyLocaladdOrGetVariable(ProtoIlInstructions.IlVariableMsg v, Type type, Body jbTmp)Type of local is got by the protoVariableMsg but in some cases we need to define the type of the localvoidaddReferenceLocal(Local element, Local referenceHolder)voidfillMethodParameter(List<Unit> unwrapCalls, Map<Local,Local> unwrappedToWrapped)Add parameters of the .NET method to the Jimple BodyvoidfillMethodParameter(Body jb, List<ProtoAssemblyAllTypes.ParameterDefinition> parameters, List<Unit> unwrapCalls, Map<Local,Local> unwrappedToWrapped)Add parameters of the .NET method to the Jimple BodyLocalgetReferenceLocal(Local element)static ValueinlineLocals(Value v, Body jb)Recursively get value of a locals chainbooleanlocalsToCastContains(String local)
-
-
-
Field Detail
-
localGenerator
public final LocalGenerator localGenerator
-
-
Constructor Detail
-
DotnetBodyVariableManager
public DotnetBodyVariableManager(DotnetBody dotnetBody, Body mainJb)
-
-
Method Detail
-
fillMethodParameter
public void fillMethodParameter(List<Unit> unwrapCalls, Map<Local,Local> unwrappedToWrapped)
Add parameters of the .NET method to the Jimple Body
-
fillMethodParameter
public void fillMethodParameter(Body jb, List<ProtoAssemblyAllTypes.ParameterDefinition> parameters, List<Unit> unwrapCalls, Map<Local,Local> unwrappedToWrapped)
Add parameters of the .NET method to the Jimple Body- Parameters:
jb-parameters-
-
addInitLocalVariables
public void addInitLocalVariables(List<ProtoIlInstructions.IlVariableMsg> variableMsgList)
Add and Initialize all known variables/locals at the beginning- Parameters:
variableMsgList-
-
addOrGetVariable
public Local addOrGetVariable(ProtoIlInstructions.IlVariableMsg v, Body jbTmp)
Add or get variable/local of this method body- Parameters:
v-jbTmp-- Returns:
-
addOrGetVariable
public Local addOrGetVariable(ProtoIlInstructions.IlVariableMsg v, Type type, Body jbTmp)
Type of local is got by the protoVariableMsg but in some cases we need to define the type of the local- Parameters:
v-type-jbTmp-- Returns:
-
addLocalVariable
public void addLocalVariable(Local local)
-
inlineLocals
public static Value inlineLocals(Value v, Body jb)
Recursively get value of a locals chain- Parameters:
v-jb-- Returns:
-
addLocalsToCast
public void addLocalsToCast(String local)
Sometimes we need to cast locals to fulfill the validation. In this case we add them to this set and cast them later on- Parameters:
local-
-
localsToCastContains
public boolean localsToCastContains(String local)
-
-