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

Re: What is signature class?





On Sun, 19 Sep 1999, Liang Guo wrote:

> I got an RuntimeException: cannot set active body for context or signature
> class! when I construct my IPDG. 
> 
> it seems it got this exception when it try to call setActiveBody for
> an abstract method. I remember the beta 3 constructed an empty body for
> the abstract method, so it can work on. 
> 
> 
> Exception in thread "main" java.lang.RuntimeException: cannot set active
> body for context or signature class!
>         at soot.SootMethod.setActiveBody(SootMethod.java, Compiled Code)
>         at edu.udel.cis.compiler.graph.IPDG.<init>(IPDG.java, Compiled Code)
>         at testIPDG.main(testIPDG.java, Compiled Code)

I don't think that the problem is that it's trying to set the active body
for an abstract method; in that case, the error reported would've been
'cannot set body for non-concrete method!'.

What is the method in question?  What class does it belong to?  I think
that the class is either (1) not loadable (because it's not in the soot
class path) or (2) a context class, because the --analyze-context flag
is not set.  

You can try to fix (1) in the obvious manner, and (2) by emulating the
following code in soot.Main:

            if (isAnalyzingLibraries)
            {
                Iterator contextClassesIt = 
                     Scene.v().getContextClasses().iterator();
                while (contextClassesIt.hasNext())
			((SootClass)contextClassesIt.next()).setLibraryClass();
            }

By the way, the latest internal version has a really nice way of using
external code.  You get to use soot.Main, and specify additional classes
to load.  (Or that's the idea.  I don't quite remember how it works out in
practice -- ask Raja.)  This might be good to look into.

pat