[Soot-list] Loading a class using soot
Maxime Van de Reyd
mvandere at student.fsa.ucl.ac.be
Tue Feb 8 12:12:19 EST 2005
Hi, everybody
I try to Load a java class and to explore the structure created by soot.
But when I try to get the method body using getActiveBody() I get an
error when the method contains exception code (it seems to be so, but
I'm not sure that's the problem)
To illustrate my problem I attached the class I use to make my tests.
This class can load and explore itself without problem but when i
uncomment the code (lines 45->53) i get an Exception [1]
I use the precompiled jars from soot version 2.2.1 found on [2] and java
version "1.4.2_01"
I'd also like to be able to load jimple files. Can it be done from a
Scene ? I tried with soot.jimple.Parser without success.
Your help will be greatly appreciated,
Maxime Van de Reyd
[1] Exception in thread "main" java.lang.NullPointerException
at soot.AnySubType.v(AnySubType.java:44)
at
soot.toolkits.exceptions.ThrowableSet$Manager.<init>(ThrowableSet.java:263)
at
soot.Singletons.soot_toolkits_exceptions_ThrowableSet_Manager(Singletons.java:1005)
at
soot.toolkits.exceptions.ThrowableSet$Manager.v(ThrowableSet.java:274)
at
soot.toolkits.exceptions.PedanticThrowAnalysis.mightThrow(PedanticThrowAnalysis.java:68)
at
soot.toolkits.graph.ExceptionalUnitGraph.buildExceptionDests(ExceptionalUnitGraph.java:342)
at
soot.toolkits.graph.ExceptionalUnitGraph.initialize(ExceptionalUnitGraph.java:262)
at
soot.toolkits.graph.ExceptionalUnitGraph.<init>(ExceptionalUnitGraph.java:148)
at
soot.toolkits.graph.ExceptionalUnitGraph.<init>(ExceptionalUnitGraph.java:180)
at
soot.toolkits.scalar.LocalSplitter.internalTransform(LocalSplitter.java:78)
at soot.BodyTransformer.transform(BodyTransformer.java:51)
at soot.Transform.apply(Transform.java:104)
at soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:61)
at soot.JimpleBodyPack.internalApply(JimpleBodyPack.java:93)
at soot.Pack.apply(Pack.java:120)
at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:115)
at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:80)
at soot.SootMethod.retrieveActiveBody(SootMethod.java:304)
at LoadClassFile.showCode(LoadClassFile.java:31)
at LoadClassFile.main(LoadClassFile.java:26)
[2] http://www.sable.mcgill.ca/soot/soot_download.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LoadClassFile.java
Type: text/x-java
Size: 1159 bytes
Desc: not available
Url : http://www.sable.mcgill.ca/pipermail/soot-list/attachments/20050208/fae5d820/LoadClassFile.bin
More information about the Soot-list
mailing list