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.
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.
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.
Get latest updates about Open Source Projects, Conferences and News.