Thank you for the help Elnatan.

I managed to get around it by appending to the file #pragma 
cilnoremove("func") for every function in the program, and then running 
CIL with the option --sliceGlobal. This will remove all functions except 
func which is what I wanted. I guess epicenter as a feature is buggy at 
the moment.

Vijay


On 01/21/2011 03:17 AM, Elnatan Reisner wrote:
> Vijayaraghavan Murali<m.vijay<at>  nus.edu.sg>  writes:
>
>> I'm new to this list and I just obtained CIL. For our research which
>> uses compositional reasoning, we need a tool to extract out each
>> function individually from a C program (including global declarations
>> like variables, structs and typedefs) and analyze it.
>>
>> CIL's doepicenter feature seems precisely fit for that purpose. A
>> quick recap of its description:
>>
>> --doepicenter                Enable remove all functions except
>> those within some number
>>                              of hops (in the call graph) from a given 
>> function
>> --epicenter-name<name>       do an epicenter slice starting from
>> function<name>
>> --epicenter-hops<n>          specify max # of hops for epicenter slice
>>
>> Using these options, I can extract functions from a program one by
>> one by providing the function name and setting hops to 0.
>>
>> But I'm not able to get the option to work. Regardless of the name or
>> the #of hops that I provide, CIL just removes ALL functions/global
>> declarations in the output! I also tried giving --docallgraph to see
>> if it
>> affects it, but to no avail. Moreover, I was not able to find any
>> sort of
>> documentation on this feature.
>
> I poked around in this module briefly, and I managed to get it to work
> by simply deleting line 54 from epicenter.ml:
>     Cilutil.sliceGlobal := true;
>
> I don't know anything about the history of this module, or why
> sliceGlobal is set here, but it seems like a mistake.
>
> One other thing I noticed, though: from what I can tell, --doepicenter
> with 0 hops (which is the default number of hops) keeps all functions
> that are reachable from the specified function, not just the function
> itself. The hops seem to only be relevant for keeping *callers* of the
> epicenter---that is, these are hops *backward* in the call graph. (The
> code in epicenter.ml doesn't seem to know this, though. Along with the
> sliceGlobals bug, this makes me think rmtmps.ml was changed at some
> point but epicenter.ml was never brought up to date.)
>
> Elnatan

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to