Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy results of a plugin to another project?

Tags:

ocaml

frama-c

In Frama-C, I would like to copy the results of a plugin like Value from one project to another. How exactly do I do this? I'm guessing I have to use Project.copy with the proper State_selection, but what would that be for Value? More generally, how do I determine what the State_selection would be for a given plugin?

like image 997
gsp Avatar asked Dec 05 '25 09:12

gsp


1 Answers

Unfortunately, there is no unified mechanism across plug-ins for that. For the EVA1 plug-in, you would probably do something like

let selection = State_selection.with_codependencies Db.Value.self in
Project.copy ~selection ~src dest

in order to capture EVA's state as well as the intermediate states on which it depends.

That said, I'd advise against trying to copy such a substantial part of Frama-C's internal state. It's very error-prone and implies working with arcane API. If you can afford it, two other solutions seem easier:

  • work in the original project, possibly creating a new project with a new AST as a result, through the File.create_copy_from_visitor.
  • copy the entire project with Project.copy and work on the new project.

1: Evolved Value Analysis, the new name of Value

like image 145
Virgile Avatar answered Dec 07 '25 15:12

Virgile