[Soot-list] Problem with access to .class

Eric Bodden eric.bodden at mail.mcgill.ca
Fri Aug 31 09:43:32 EDT 2007


I cannot reproduce this.

However this line here...

    Main.main(new String[]{Testclass2.class.getName()})

... already asks for classpath trouble: This only works if Testclass2
is both on your soot build path and on your soot-class-path, which
generally is to be avoided. So you rather want to use something like
"Testclass2" (in String form) there.

Eric


On 30/08/2007, Marco Bakera <marco.bakera at uni-dortmund.de> wrote:
> The problem occurs when invoking the code
>
>   G.reset();
>   Main.main(new String[]{Testclass2.class.getName()});
>
> on the following Testclass2
>
>   public class Testclass2 {
>
>       public Testclass2() {
>           Class c = Testclass2.class;
>           System.out.println("Testclass2.Testclass2() c="+c);
>       }
>   }
>
>
> On Thursday 30 August 2007 15:14, Chris Pickett wrote:
> > Hi Marco,
> >
> > Please attach a test case.
> >
> > Chris
> >
> > Marco Bakera wrote:
> > > Hey everybody!
> > >
> > > I am using Soot to transform Java source code into control flow graphs
> > > (namely Unit graphs in Soot). However there are some problems whenever
> > > there is access to the .class member in the source code. In such a case
> > > the following rather cryptic exception occurs.
> > >
> > > java.lang.RuntimeException: Attempting to push a non-constant cp entry
> > >     at soot.coffi.CFG.processCPEntry(CFG.java:2716)
> > >     at soot.coffi.CFG.processFlow(CFG.java:1717)
> > >     at soot.coffi.CFG.jimplify(CFG.java:1341)
> > >     at soot.coffi.CFG.jimplify(CFG.java:1125)
> > >     at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:98)
> > >     at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:80)
> > >     at soot.SootMethod.retrieveActiveBody(SootMethod.java:304)
> > >     at soot.PackManager.retrieveAllBodies(PackManager.java:711)
> > >     at soot.PackManager.runPacks(PackManager.java:302)
> > >     at soot.Main.run(Main.java:179)
> > >     at soot.Main.main(Main.java:153)
> > >
> > > If there is not access to .class everything is running fine.
> > >
> > > Any suggestions how to circumvent the problem?
> > >
> > > Thanks for any help in advance. :)
> > >
> > > Greetings,
> > > Marco Bakera.
> > >
> > > PS
> > > I am using sootall-2.2.4.jar.
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list