Use Frama-c to analyze a project with CMake build infrastructure

589 views Asked by At

I need to use frama-c value analysis plug-in to analyze some projects. These projects use CMake build infrastructure as their build system.

I have used frama-c to analyze each file separately. This way, the information about the entry point will be lost. More precisely, frama-c requires an entry point for the files that do not include a "main" function and therefore it is challenging to cover all functions and choose the best entry point within a single file from the project.

My question is that is there a way that we can run frama-c on the entire project as a whole unit (not file by file)?

1

There are 1 answers

3
byako On BEST ANSWER

Frama-C accepts multiple files on its command-line. This will work if the configuration of the preprocessor (option -cpp-extra-args, used in particular for includes) is the same accross all files.

If you need different preprocessor settings for different files, you should preprocess each file alone (only cpp, no Frama-C), and save each result as a .i file. Then, you can supply all those preprocessed files to Frama-C simultaneously. Usually, the first operation can be done by tweaking the build process.