How do I copy plugin results to another project?
In Frama-C, I would like to copy the plugin results as Value from one project to another. How exactly do I do it? I'm guessing I need to use Project.copy with the appropriate State_selection field, but what would that mean for Value? More generally, how do you determine what will be State_selection for a given plugin?
source to share
Unfortunately there is no single mechanism for this for plugins. For EVA plugin 1, you would probably do something like
let selection = State_selection.with_codependencies Db.Value.self in
Project.copy ~selection ~src dest
to capture the state of the EVA, as well as the intermediate states that it depends on.
However, I would advise against trying to copy such a significant part of the internal state of Frama-C. It is very error prone and involves working with a secret API. If you can afford it, the other two solutions seem simpler:
- works in the original project, possibly creating a new project with a new AST as a result via
File.create_copy_from_visitor
. - copy the entire project with help
Project.copy
and work on a new project.
1 : E volved V alue A nalysis, new sub name Value>
source to share