[Soot-list] Class Hierarchy with no entry point - catch 22?

Marc-Andre Laverdiere-Papineau marc-andre.laverdiere-papineau at polymtl.ca
Tue Jun 12 19:48:45 EDT 2012


Hello,

I just tried the exact same code with the nightly build and there were 
no changes.

I do understand that, conceptually, a call graph needs a starting point, 
and so does an interprocedural flow. But I just want a class hierarchy 
here :)

Maybe it would be a good idea to refactor cg.cha into a separate pack?

On 06/12/2012 07:40 PM, Eric Bodden wrote:
> Marc-Andre,
>
> recently there was another person with a similar problem, after which
> I patched Soot to circumvent this problem (IIRC). Are you using the
> nightly build? If not, please try that. Also, please browse the list's
> archive a bit.
>
> Eric
>
> On 13 June 2012 02:46, Marc-Andre Laverdiere-Papineau
> <marc-andre.laverdiere-papineau at polymtl.ca> wrote:
>> Hello,
>>
>> I am trying to find all the servlets in my program, so that I can set
>> those as entry points.
>>
>> Now, a good way to doo that, I think, is to use the class hierarchy.
>>
>> Sadly, I get an exception, "java.lang.RuntimeException: There is no main
>> class set!".
>> Is there a way to  deal with this without having a dummy main class?
>>
>>
>> P.S. My code:
>>
>> //Work in whole-program mode
>> Options.v().set_whole_program(true);
>> Options.v().set_exclude(Arrays.asList("java", "javax", "org.hibernate",
>> "sun"));
>> // General Options
>> Options.v().set_allow_phantom_refs(true);
>> Options.v().set_no_bodies_for_excluded(true);
>> Options.v().set_time(true);
>> Options.v().set_verbose(false);
>>
>> //First, do a simple class hierarchy analysis
>> Options.v().setPhaseOption("cg", "enabled:true");
>> Options.v().setPhaseOption("cg.cha", "enabled:true");
>> Options.v().setPhaseOption("cg.spark", "enabled:false");
>> Options.v().setPhaseOption("cg", "implicit-entry:true");
>> Options.v().setPhaseOption("cg", "all-reachable:true");
>>
>> Scene.v().loadNecessaryClasses();
>> PackManager.v().runPacks();
>>
>> final String servletClassName = "javax.servlet.http.HttpServlet";
>> for (SootClass sc :
>> Scene.v().getActiveHierarchy().getSubclassesOf(Scene.v().loadClassAndSupport(servletClassName))){
>> System.err.println("Servlet class: " + sc.getShortJavaStyleName());
>> }
>>
>>
>> --
>> Marc-André Laverdière-Papineau
>> Étudiant au doctorat - PhD Student
>>
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
>


-- 
Marc-André Laverdière-Papineau
Étudiant au doctorat - PhD Student




More information about the Soot-list mailing list