Skip to content

Commit c006069

Browse files
author
Eric Bodden
committed
added code for edge serialization
1 parent 6cbfdb4 commit c006069

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package soot.jimple.toolkits.ide;
2+
3+
import soot.SootMethod;
4+
import soot.Unit;
5+
import heros.EdgeFunction;
6+
import heros.debugsupport.NewEdgeSerializer;
7+
import heros.debugsupport.SerializableEdgeData;
8+
9+
public class EdgeSerializer<D, V> implements NewEdgeSerializer<soot.SootMethod, D, soot.Unit, V> {
10+
11+
@Override
12+
public SerializableEdgeData newJumpFunction(SootMethod method, D sourceVal,Unit target, D targetVal, EdgeFunction<V> f) {
13+
return new SerializableEdgeData(method.getDeclaringClass().getName());
14+
}
15+
16+
}

src/soot/jimple/toolkits/ide/JimpleIDESolver.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package soot.jimple.toolkits.ide;
22

33
import heros.InterproceduralCFG;
4+
import heros.debugsupport.NewEdgeSerializer;
45
import heros.solver.IDESolver;
56

67
import java.io.FileNotFoundException;
@@ -16,7 +17,6 @@
1617

1718
import com.google.common.collect.Table.Cell;
1819

19-
2020
public class JimpleIDESolver<D, V> extends IDESolver<Unit, D, SootMethod, V, InterproceduralCFG<Unit,SootMethod>> {
2121

2222
private final boolean DUMP_RESULTS;
@@ -63,5 +63,10 @@ public void dumpResults() {
6363
e.printStackTrace();
6464
}
6565
}
66+
67+
@Override
68+
protected NewEdgeSerializer<SootMethod, D, Unit, V> createEdgeListener() {
69+
return new EdgeSerializer<D,V>();
70+
}
6671

6772
}

src/soot/jimple/toolkits/ide/JimpleIFDSSolver.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package soot.jimple.toolkits.ide;
22

33
import heros.InterproceduralCFG;
4+
import heros.debugsupport.NewEdgeSerializer;
45
import heros.solver.IFDSSolver;
56

67
import java.io.FileNotFoundException;
@@ -63,5 +64,9 @@ public void dumpResults() {
6364
e.printStackTrace();
6465
}
6566
}
66-
67+
68+
@Override
69+
protected NewEdgeSerializer<SootMethod, D, Unit, BinaryDomain> createEdgeListener() {
70+
return new EdgeSerializer<D,BinaryDomain>();
71+
}
6772
}

0 commit comments

Comments
 (0)