Re: [CIL users] Instrumenting a program with a call to function in external file

2013-03-31 Thread Gabriel Kerneis
On Sun, Mar 31, 2013 at 01:37:33PM +0530, son...@iitk.ac.in wrote: > If i have wrapped varinfos in record type as below: > > type type = { > mutable one : varinfo; > mutable two : varinfo; > } > > how can i use this varinfo values? > Also how can i make use of varinfo returned from find

Re: [CIL users] Instrumenting a program with a call to function in external file

2013-03-31 Thread sonamt
If i have wrapped varinfos in record type as below: type type = { mutable one : varinfo; mutable two : varinfo; } how can i use this varinfo values? Also how can i make use of varinfo returned from findOrCreateFunc? Thanks n Regards Sonam > On Sat, Mar 02, 2013 at 08:40:39PM +0530,

Re: [CIL users] Instrumenting a program with a call to function in external file

2013-03-07 Thread Gabriel Kerneis
On Thu, Mar 07, 2013 at 11:16:01PM +0530, son...@iitk.ac.in wrote: > Thanks for the example. > > let convert v = Lval (Var v.svar, NoOffset) in > mkStmtOneInstr (Call(None, convert foo, [f; 1], loc)); > > In the above code i am getting following error: > > > Error: This expression has

Re: [CIL users] Instrumenting a program with a call to function in external file

2013-03-07 Thread sonamt
Thanks for the example. let convert v = Lval (Var v.svar, NoOffset) in mkStmtOneInstr (Call(None, convert foo, [f; 1], loc)); In the above code i am getting following error: Error: This expression has type Cil.varinfo but an expression was expected of type Cil.fundec where "foo

Re: [CIL users] Instrumenting a program with a call to function in external file

2013-03-04 Thread Gabriel Kerneis
On Sat, Mar 02, 2013 at 08:40:39PM +0530, son...@iitk.ac.in wrote: > But i am not able to create a call statement along with parameters (arguments) > any simple example would be helpful. Example to create: int tmp = foo(1, 2); inside a function bar (assuming [foo] and [bar] are of type fundec, y

Re: [CIL users] Instrumenting a program with a call to function in external file

2013-03-02 Thread sonamt
Thanks for quick response I am quiet a beginner in CIL. Although i am comfortable with using visitors, finding statements and making changes. But i am not able to create a call statement along with parameters (arguments) any simple example would be helpful. > Hi, > > On SatteFunc, Mar 02, 20

Re: [CIL users] Instrumenting a program with a call to function in external file

2013-03-02 Thread Gabriel Kerneis
Hi, On SatteFunc, Mar 02, 2013 at 11:52:50AM +0530, son...@iitk.ac.in wrote: > I would like to get a basic idea on how to insert call to a function > defined in some other C file to the input file before a particular kind > of statement lets say before all "loop" statements in the input file. Fi

[CIL users] Instrumenting a program with a call to function in external file

2013-03-01 Thread sonamt
Hello, I would like to get a basic idea on how to insert call to a function defined in some other C file to the input file before a particular kind of statement lets say before all "loop" statements in the input file. Also, one simple question how can i convert varinfo to an expression type