--- layout: fc_discuss_archives title: Message 141 from Frama-C-discuss on September 2013 ---
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] Printing all global variables of a set of C files?



Hello,

Does anybody know how to print all the global variables of a set of C files?

I would like to print basic information:
  * Variable name;

  * Definition location (file / line number);

  * Variable type;

  * (Optionally) Initial value at definition point.

I am pretty sure one could write a plug-in to do that but I don't know
how to write plug-ins.

Does anybody know a way to use Frama-C Fluorine or one of its plug-in
to get all or part of above information (maybe debug option of a
plug-in)? I don't mind doing a few greps or other command line
filtering if needed.

I tried to use frama-c-gui for that purpose but there are some pitfalls:
  * This is not very automated, one needs to click on each .c file to
see all the variables;

  * There is no distinction between locally (to a file) defined
variables and "extern" ones. One need to refer to the C source file to
get this info from the GUI;

  * Strangely enough, some variables where missing from the normalized
program window or the list of global objects of the C file, even if
this variable is defined in the C source code;

  * Only 21 global objects are displayed in the normalized program window.

Best regards,
david