3

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?

gsp
  • 67
  • 1
  • 5

1 Answers1

3

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

Virgile
  • 9,724
  • 18
  • 42