Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[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?


  • Subject: [Frama-c-discuss] Printing all global variables of a set of C files?
  • From: dmentre at linux-france.org (David MENTRE)
  • Date: Mon, 30 Sep 2013 11:29:22 +0200

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