On Feb 11, 2010, at 2:37 PM, georgebaah wrote:
Hi All,
I would like to automatically instrument my application
with the fflush(stdout) call. I am trying to use TFun to
construct it but I am having some difficulties. Any help
will be greatly appreciated. Thanks.
George
TFun is the type of a function, which is only a piece of what you
want. You might want something along the lines of
let fflush_varinfo = ...
and stdout_varinfo = ... in
mkStmtOneInstr (Call (None, Lval (fflush_varinfo, NoOffset), [Lval
(stdout_varinfo, NoOffset)], some_location))
You could get the varinfos for fflush and stdout (to fill in the
ellipses) by walking through the file's globals or by using a visitor.
Alternatively, I'm sure there's a way to do this using Formatcil, but
I haven't had much luck with that. I would hope it would just be
Formatcil.cStmt "fflush(stdout);" some_location []
but somehow I don't think it is quite that easy.
-Elnatan
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users