Frama-C Bug Tracking System - Frama-C
View Issue Details
0001431Frama-CGraphical User Interfacepublic2013-05-27 09:422018-01-12 14:28
dhekir 
maroneze 
normalfeaturealways
confirmedopen 
Frama-C Fluorine-20130401 
 
0001431: How to use the "Callers ..." context menu item
Pardon the ignorance, but I couldn't find this on the manual... I have a program where, after parsing, some warnings of this form are emitted: "Calling undeclared function __builtin_swap32. Old style K&R code?" I know there is a missing source file somewhere in my project, but I'd like to know who is calling these functions (since they are never directly called in my code). So I right-click on the function prototype on the GUI, and the last button in the context menu is "Callers ...". If I click on it, the "Launching analysis" window is displayed, with no indication of which analysis to choose. I suppose the analysis I'd like is "Syntactic callgraph". So I choose it, without customizing any options, click Execute, but nothing changes. The "Callers ..." button is always visible when right-clicking the function declaration. I noticed that if I choose the "Users" analysis, when right-clicking afterwards there is no more "Callers ..." button on the context menu, but I fail to see how any of the new options (e.g. Dependencies) could help me identify the function callers. Is there a simpler way, other than by manually parsing the DOT file (the produced graph is too large for me to visually inspect it), to obtain information about function callers?
No tags attached.
Issue History
2013-05-27 09:42dhekirNew Issue
2013-05-30 14:47yakobowskiNote Added: 0003925
2013-05-30 14:47yakobowskiAssigned To => yakobowski
2013-05-30 14:47yakobowskiSeverityminor => feature
2013-05-30 14:47yakobowskiStatusnew => confirmed
2018-01-12 14:28signolesAssigned Toyakobowski => maroneze
2018-01-12 14:28signolesStatusconfirmed => assigned
2018-01-12 14:28signolesStatusassigned => confirmed

Notes
(0003925)
yakobowski   
2013-05-30 14:47   
Unfortunately, the functionality you are looking for is currently missing from the GUI. The "Callers..." menu refers to semantic callers, as found by the Value Analysis (including calls through pointers). Basic syntactic callers are not available for the moment. If this functionality is really useful to you, this very simple plugin would do the trick: ------------------- let f = "__builtin_swap32" open Cil_types class find = object inherit Visitor.frama_c_inplace as self method vinst i = (match i with | Call (_, { enode = Lval (Var vi, _)}, _, _) when vi.vname = f -> Kernel.result ~current:true "function %s called by %a@." f Kernel_function.pretty (Extlib.the self#current_kf); | _ -> () ); Cil.SkipChildren end let () = Db.Main.extend (fun () -> let ast = Ast.get () in Visitor.visitFramacFile (new find) ast ) ------------- You can change the name of the function you are interested in at the beginning of the file. Start the analysis with frama-c -load-script visit.ml