[Soot-list] basic profiler fails for soot

Arzt, Steven steven.arzt at sit.fraunhofer.de
Sat May 13 10:20:08 EDT 2017


Hi Arnamoy,

Is your class "MyCounter" located in the current directory? If so, since you didn't specify any package name, make sure that your class was compiled into the default package as well.

Furthermore, your code seems to try to load classes into Soot in a static code block. This block is executed right when your class is loaded. At that point, Soot cannot possibly have evaluated your command line and be configured correcty. I therefore assume that there is simply no class path set at the time at which you are trying to resolve the "MyCounter" class. The easiest option to use Soot is to register your code as a transformer and then call Soot's main method. That should make sure that everything is initialized properly before your code is run.

Best regards,
  Steven

-----Original Message-----
From: Soot-list [mailto:soot-list-bounces at cs.mcgill.ca] On Behalf Of Arnamoy Bhattacharyya
Sent: Saturday, May 13, 2017 4:10 AM
To: soot-list at cs.mcgill.ca
Subject: [Soot-list] basic profiler fails for soot

Hello I am trying to run a basic soot profiler from the link https://www.sable.mcgill.ca/soot/tutorial/profiler2/index.html.  I follow the steps:

1.  Compile the instrumentation driver to create a class 2.  Compile the code to be tested to create a class

Run the following command from inside a directory where soot_nightly.jar, Driver.class, TestInvoke.class resides.

java -cp .:soot_nightly.jar Driver -cp
.:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-1.b14.el7_2.x86_64/jre/lib/rt.jar
TestInvoke

But I get the following error:

Caused by: soot.SootResolver$SootClassNotFoundException: couldn't find
class: MyCounter (is your soot-class-path set properly?)

Can anyone please tell me what is the correct command for this to succeed?

PS:  relevant code from the driver where it is loading the class

static {
          counterClass    = Scene.v().loadClassAndSupport("MyCounter");
          increaseCounter = counterClass.getMethod("void increase(int)");
          reportCounter   = counterClass.getMethod("void report()");
        }


Thanks a lot for your help





--
Arnamoy Bhattacharyya
PhD Student
Electrical and Computer Engineering Department University of Toronto _______________________________________________
Soot-list mailing list
Soot-list at CS.McGill.CA
https://mailman.CS.McGill.CA/mailman/listinfo/soot-list


More information about the Soot-list mailing list