[Soot-list] Private methods are not being

Eric Bodden eric.bodden at ec-spride.de
Sun Mar 18 10:58:50 EDT 2012


Hi Clarissa.

What does your class Addition2 look like? Can you attach it?

Eric



On 18 March 2012 13:40, Clarissa Grixti <clarissa_14_4 at hotmail.com> wrote:
> Hi all,
>
> I'm using SOOT to be able to generate a call graph and then get the target
> nodes according to the methods that I need. The problem is that when I input
> a method name which is private, the target nodes are not being returned.
>
> What's weird is that I am using the exclude and "-no-bodies-for-excluded" so
> that methods in the java. package will not be included in the Call graph.
> And in this case when I try to get the  nodes for a private method, nothing
> is returned. However when I remove the exclude and
> the "-no-bodies-for-excluded", then the target nodes are being returned.
> However I still want to be able to use the the exclude as it is taking a lot
> of time to give me a result and I don't need any information regarding these
> methods.
>
> I have the following code:
>
> public static void main(String[] args) {
>   List<String> argsList = new ArrayList<String>();
>   argsList.addAll(Arrays.asList(new String[]{
>   "-w",
>   "-main-class",
>   "Addition2",//main-class
>   "Addition2",//argument classes
>                            "edu.Calculator",
>   "-exclude",
>   "java.",
>   "-no-bodies-for-excluded"
>   //
>   }));
>
>   PackManager.v().getPack("wjtp").add(new Transform("wjtp.myTrans", new
> SceneTransformer() {
>
> @Override
> protected void internalTransform(String phaseName, Map options) {
>       CHATransformer.v().transform();
>                        getTargets();
> }
>
>   }));
>
>            args = argsList.toArray(new String[0]);
>
>            soot.Main.main(args);
> }
> public static void getTargets() {
> SootMethod src =
> Scene.v().getMainClass().getMethodByName("jButton1ActionPerformed"); // this
> is a private method in the main Class: Addition2
>                 CallGraph cg = Scene.v().getCallGraph();
>
>                 Iterator<MethodOrMethodContext> targets = new
> Targets(cg.edgesOutOf(src));
>                 while (targets.hasNext()) {
>
>                     SootMethod tgt = (SootMethod)targets.next();
>                     CG.method.add(tgt);
>                     System.out.println("Target: " + tgt.getName());
>
>                 }
> }
> This is when no targets for private methods are being outputted. I have
> tried it with other private methods in other classes and no targets were
> outputted. Does someone maybe know why this is happening please?
>
> Thanks for your help and regards
>
> _______________________________________________
> 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


More information about the Soot-list mailing list