Package sootup.core.util
Class JimpleBodySerializer
java.lang.Object
sootup.core.util.JimpleBodySerializer
Serializes a
Body or ControlFlowGraph to Java source code that, when compiled and
executed, recreates the same in-memory representation using the SootUp API.
Usage: copy the returned snippet into a test method, supply the identifierFactory
variable and an appropriate MethodSignature, then call body.build().
Why: You want to test different scenarios and have existing similar bytecode? Transform it to Jimple and serialize the ControlFlowGraph to Java sourcecode that generates the Jimple Objects directly Use it as a base that you can modify easily/fast for writing test input.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JimpleBodySerializer
public JimpleBodySerializer()
-
-
Method Details
-
serialize
Serialize a full Body (includes theBody.builder(...).build()call). -
serialize
Serialize a CFG and its locals. The generated snippet ends with a fully configuredBody.builder(graph)call — supply aMethodSignaturewhere indicated.
-