[Soot-list] use soot in new eclipse plugin

Jian Xu fightmyway at gmail.com
Sat Dec 6 03:48:30 EST 2008


Hi:
I've review the code in the SootLaunch and I find many other information
about ClassLoader ContextClassLoader etc. I find if I call some Soot class
before using reflection to call Soot.Main the Soot Plugin will fail. I guess
Soot Plugin is dependent on Soot Lib Plugin, so if I initialize Scene class
before using reflection, the classloader loade Scene class is the OSGI
baseclassloader not the SootThread contextclassloader. I wonder how it can
work.

I create a new class extends Thread. Then set the Thread contextclassloader
with correct URLs. Then load my main class but it still throw exception and
say "couldn't find class: xxx (is your soot-class-path set properly?)"

On Mon, Dec 1, 2008 at 10:07 PM, Eric Bodden <eric.bodden at mail.mcgill.ca>wrote:

> Hi Jian.
>
>
> It's hard to say. I guess you may not be using the API correctly. Are
> you setting Soot's classpath in any way?
>
> You should also have a look at the Soot eclipse plugin to see how this
> could work: http://www.sable.mcgill.ca/soot/eclipse/updates/
>
> The class you want to be looking at there is the following:
>
>
> /soot/eclipse/ca.mcgill.sable.soot/src/ca/mcgill/sable/soot/launching/SootThread.java
>
> The plugin does some special magic to set the classpath from whatever
> is set in the plugin's options for Soot. In particular, it uses an
> URLClassLoader to load and run the correct copy of Soot.
>
> Hope that helps,
> Eric
>
> 2008/12/1 Jian Xu <fightmyway at gmail.com>:
> > Hi:
> > I do my project using soot analyse java bytecode. Thanks to the powerful
> > tool --soot, I almost complete the analysing process. My project is about
> a
> > small tool as eclipse plugin, so I use soot.jar in my plugin and call the
> > soot's API. But I find there are some problems. If I use the soot API in
> > common project include soot.jar in build path, it will be no problem.
>  But
> > If I use soot API in my plugin, it throws "couldn't find class:
> Hello.class
> > (is your soot-class-path set properly?)" error. I know the classpath will
> > change when we do RCP&Plugin developing on eclipse, and I research
> solutions
> > on Search Engine and I also try to find how soot plugin to solve the
> > problem. I think the source code is complex I can't find the code which
> > solving the problem. Somebody can tell me a easy way to use the API we
> add
> > soot.jar in common project as we used in plugin?
> >
> > Regards
> > Jan
> >
> > _______________________________________________
> > 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
> Got an interesting job offer? http://www.bodden.de/hire-me/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20081206/393e7eda/attachment-0001.htm


More information about the Soot-list mailing list