[Soot-list] Problem with line numbers and variable names

Steven Arzt Steven.Arzt at cased.de
Fri Apr 3 08:58:46 EDT 2015


Hi Pegah,

 

The Soot plugin for Eclipse isn’t using the newest version of Soot. This is something we should fix at some point, but the whole plugin hasn’t been worked on for some years now. What you can try, is to locate the Soot JAR file inside the plugin (should be inside your Eclipse plugins directory) and replace it with the newest nightly build. Hopefully, you will get the same results then from both the plugins and the “normal” Soot.

 

Best regards,

  Steven 

 

Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von Pegah Jandaghi
Gesendet: Freitag, 3. April 2015 13:39
An: Soot-list at cs.mcgill.ca
Betreff: [Soot-list] Problem with line numbers and variable names

 

Hello everyone

 

I've been using soot eclipse plugin for running a simple method. And now I'm trying to run the method without plugin but the result of method is different for the same class:

 

the method is:

 

public static void Analysis(CompleteUnitGraph graph) {

     Iterator unitIt = graph.iterator();

     for (Unit unit : graph) {

      G.v().out.println(unit.toString());

      if (unit.t.getTag("SourceLnPosTag") != null)

           G.v().out.println( ((SourceLnPosTag) unit.getTag("SourceLnPosTag")).startLn();

      }

}

 

and the simple class which I want to show the units is:

 

public class foo{

     public static void main(String[] args){

          int a = 1;

          System.out.println(a); 

     }

}

 

and  main method which invokes Analysis on foo is :

 

String sep = File.separator;

String pathSep = File.pathSeparator; 

String path =System.getProperty("java.home") + sep + "lib" + sep+ "rt.jar" + pathSep +  System.getProperty("java.home") + sep+"lib" + sep + "jce.jar" + path + fooPath;

 

Options.v().set_soot_classpath(path);

Options.v().set_keep_line_number(true);

Options.v().setPhaseOption("jb", "use-original-names:true");

SootClass sClass = Scene.v().loadClassAndSupport("foo");

sClass.setApplicationClass();

Scene.v().loadNecessaryClasses();    

Body body = sClass.getMethodByName("main").retrieveActiveBody();

Analysis(new CompleteUnitGraph(body));

                        

 

The first problem is that for all of the units "SourceLnPosTag" is null.

and the second problem is that the units have different variable names.

Is there any way to get the same units without using plugin?

 

Thanks 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150403/562b2433/attachment.html 


More information about the Soot-list mailing list