[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Soot API: Instrumenting EJB



Hello,

I am using Soot 1.2.2 in an attempt to instrument a method on a Java EJB
at ClassLoadtime using a custom ClassLoader. However, A RunTimeException
is thrown by the soot.coffi.CFG.generateJimple(CFG.java:4517) method when
I try to i retrieve the active body of one of the EJB's method's before
instrumenting it:

JimpleBody jimpBody = (JimpleBody)method.retrieveActiveBody();

java.lang.RuntimeException: Unrecognized bytecode instruction: 168
        at soot.coffi.CFG.generateJimple(CFG.java:4517)
        at soot.coffi.CFG.jimplify(CFG.java:1257)
        at soot.coffi.CFG.jimplify(CFG.java:920)
        at
soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:98)
        at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:83)
        at soot.SootMethod.retrieveActiveBody(SootMethod.java:276)
        at
com.rtscinc.util.classloaders.XClassLoaderII.getXClassData(XClassLoad
erII.java:404)
        at
com.rtscinc.util.classloaders.XClassLoaderII.getClassData(XClassLoade
rII.java:326)
        at
com.rtscinc.util.classloaders.XClassLoaderII.findClass(XClassLoaderII
.java:282)
        at
com.rtscinc.util.classloaders.XClassLoaderII.loadClass(XClassLoaderII
.java:256)
        at test.TestClient.test15(TestClient.java:1010)
        at java.lang.reflect.Method.invoke(Native Method)
        at test.TestClient.main(TestClient.java:46)

I appears that the Soot 1.2.2 Framework is unable to handle byte code
instruction # 168 so I examined the CFG.java source code to make sure. In
fact there wasn't any code to handle this particular instruction so
that's why a RunTimeException was being thrown by
soot.coffi.CFG.generateJimple() method. 

Is anyone aware of a workaround for this problem? it looks like someone
was working on this because there are some commented out lines in
CFG.java and Jimple.java  that had code to handle this instruction but it
hasn't been fully implemented.

I'd appreciate any advice or help with this.

Nathan