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

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to