Hi, cil world

i intend to write a module to insert an self-defined interface before each 
statement in a function. I use the ‘queueInstr', but an error occurs with the 
following message:

Bug: Visitor's instruction queue is not empty.
  You should only use queueInstr inside a function body!
Fatal error: exception Errormsg.Error

I am sure i have used 'queueInstr' inside a function body, my code snippet is 
following:

let do_df_instrumentation (file: Cil.file) =
   List.iter
      begin fun g ->
        match g with
        | GFun( func, loc) ->
          ignore (visitCilFunction (new myStmtVisitor) func);
        | _ -> ()
      end
    file.globals


class myStmtVisitor = object(self)
   inherit nopCilVisitor

   method vstmt st = 
     let df_fun = Cil.emptyFunction "df_stmt_monitor" in
     let df_monitor_call = 
Call(None,Lval((Var(df_fun.svar)),NoOffset),[Cil.integer !function_id; 
Cil.integer st.sid], !currentLoc) in  (* create the df. monitor interface *)
     self#queueInstr [df_monitor_call]; (* put the monitor interface before the 
stmt *)
     DoChildren

end;;

     Could anyone give me some suggestions ?

Best!
Ting
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to