[Soot-list] Using soot within a javaagent

Prashant Deva prashant.deva at gmail.com
Wed Jan 4 15:49:30 EST 2012


It wont, only I need to ensure that its indeed only the java.lang classes
that are being loaded and none else.
Is there any place i can look at the code to verify this?

Prashant


On Wed, Jan 4, 2012 at 7:47 AM, Eric Bodden <eric.bodden at ec-spride.de>wrote:

> Thanks Prashant.
>
> I actually wonder whether providing at least the java.lang classes to
> Soot would actually not be reasonable for such a use case. After all,
> those classes are always available. Would this cause any trouble in
> your use case?
>
> Eric
>
> On 3 January 2012 23:11, Prashant Deva <prashant.deva at gmail.com> wrote:
> > Oops it seems like in my haste to keep the mail short and concise I didnt
> > check the stack trace well enough to notice it was the other portion of
> code
> > that was causing the issue.
> >
> > Here is the full main class:
> >
> > public static void main(String[] args)
> > {
> > Options.v().allow_phantom_refs();
> > SootClass sootClass = Scene.v().loadClass("com.chtest.Snippet",
> > SootClass.BODIES);
> > Body body = null;
> > for (SootMethod method : sootClass.getMethods())
> > {
> > if (method.getName().equals("foo"))
> > {
> > if (method.isConcrete())
> > {
> > body = method.retrieveActiveBody();
> > break;
> > }
> > }
> > }
> >
> > System.out.println("**** Body ****");
> > System.out.println(body);
> > System.out.println();
> >
> > System.out.println("**** Blocks ****");
> > BlockGraph blockGraph = new ExceptionalBlockGraph(body);
> > for (Block block : blockGraph.getBlocks())
> > {
> > System.out.println(block);
> > }
> > }
> >
> >
> > The crash happens at the line:
> > method.retrieveActiveBody();
> >
> > if I dont call Scene.v().loadNecessaryClasses();
> >
> >
> > Prashant
> >
> >
> >
> > On Mon, Jan 2, 2012 at 2:25 AM, Eric Bodden <eric.bodden at ec-spride.de>
> > wrote:
> >>
> >> Hello.
> >>
> >> > Why is it that even after allowing phantom refs soot throws an
> exception
> >> > for
> >> > a type not loaded?
> >>
> >> I think this has to do with the fact that phantom-refs support was
> >> patched into Soot at a very late stage. Some parts of Soot may still
> >> require (or think they require) information about certain types. I
> >> would have to look into this further to be sure.
> >>
> >> But essentially, are you saying that with using
> >> "Scene.v().loadNecessaryClasses();" you are now getting what you want?
> >>
> >> Cheers,
> >> Eric
> >
> >
>
>
>
> --
> Eric Bodden, Ph.D., http://bodden.de/
> Head of Secure Software Engineering Group at EC SPRIDE
> Principal Investigator in Secure Services at CASED
> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120104/e2d28dc0/attachment.html 


More information about the Soot-list mailing list