[Soot-list] couldn't find class: SableJBDD.bdd.JBddVariable
Tezcan Dilshener
tezcan at dilshener.de
Tue Jan 3 11:50:27 EST 2012
Hi Eric,
I modified my code a little bit (see attchement) but I still fail to load all the classes from a directory and process them accordingly to generate a sim,ple call graph.
Hope you can help.
Thanks
Tezcan
----- original message --------
Subject: Re: [Soot-list] couldn't find class: SableJBDD.bdd.JBddVariable
Sent: Tue, 03 Jan 2012
From: Eric Bodden<eric.bodden at ec-spride.de>
> Hi Tezcan.
>
> I am not sure what causes the error you are seeing but using
> process-dir in combination with call-graph construction sounds wrong.
> What are you trying to accomplish? Maybe there is a better set of
> command-line options...
>
> Best wishes,
> Eric
>
> On 3 January 2012 14:41, Tezcan Dilshener <tezcan at dilshener.de> wrote:
> > Hi all,
> > I am experiencing some beginners luck.
> > I have a small class to generate call-graph.
> > It works fine when I run it to process a class that has a main method.
> However, when I modify to process class from a directory using the
> -process-dir option, it fails with couldn't find class:
> SableJBDD.bdd.JBddVariable error.
> > I see that one can set the classpath with -cp option but where is jar file
> with this class?
> >
> > thanks for any help
> > _______________________________________________
> > Soot-list mailing list
> > Soot-list at sable.mcgill.ca
> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
>
> --
> Eric Bodden, Ph.D., http://bodden.de/
> Head of Secure Software Engineering Group at EC SPRIDE
> Principal Investigator in Secure Services at CASED
> Tel: +49 6151 16-75422 Fax: +49 6151 16-72051
> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
>
--- original message end ----
-------------- next part --------------
package dk.brics.soot.callgraphs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import soot.MethodOrMethodContext;
import soot.PackManager;
import soot.Scene;
import soot.SceneTransformer;
import soot.SootClass;
import soot.SootMethod;
import soot.Transform;
import soot.jimple.toolkits.callgraph.CHATransformer;
import soot.jimple.toolkits.callgraph.CallGraph;
import soot.jimple.toolkits.callgraph.Targets;
public class AllCallGraphExample
{
public static void main(String[] args) {
List<String> argsList = new ArrayList<String>(Arrays.asList(args));
argsList.addAll(Arrays.asList(new String[]{
"-w",
"-main-class",
"my.six.pack.age.HelperCovariance",//main-class
"my.six.pack.age.HelperCovariance",//argument classes
"my.six.pack.age.ReaderCorrelation", //
// "-process-dir", "C:/apps/phd/Examples/bin/my/six/pack/age/",
// "-allow-phantom-refs"
}));
PackManager.v().getPack("wjtp").add(new Transform("wjtp.myTrans", new SceneTransformer() {
@Override @SuppressWarnings("rawtypes")
protected void internalTransform(String phaseName, Map options) {
CHATransformer.v().transform();
Iterator<SootClass> cIt = Scene.v().getApplicationClasses().iterator();
while (cIt.hasNext()) {
SootClass src = (SootClass) cIt.next();
Iterator<SootMethod> mIt = src.getMethods().listIterator();
while (mIt.hasNext()) {
SootMethod srm = (SootMethod) mIt.next();
CallGraph cg = Scene.v().getCallGraph();
Iterator<MethodOrMethodContext> targets = new Targets(cg.edgesOutOf(srm));
while (targets.hasNext()) {
SootMethod tgt = (SootMethod)targets.next();
System.out.println(src + " may call " + tgt);
if (tgt.getDeclaringClass().isApplicationClass())
System.out.println(
tgt.getDeclaringClass().getShortName()+"."+tgt.getName()+"();-;"+
src.getShortName()+"."+srm.getName()+"();-;");
}
}
}
}
}));
args = argsList.toArray(new String[0]);
soot.Main.main(args);
}
}
More information about the Soot-list
mailing list