Primus.Jobs
A facility to register and run multiple instances of Primus.
This interface allows only the analysis (specialized) systems.
val enqueue :
?name:string ->
?desc:string ->
?envp:string array ->
?args:string array ->
?init:unit Machine.Make(Bap_knowledge.Knowledge).t ->
?fini:unit Machine.Make(Bap_knowledge.Knowledge).t ->
?start:unit Machine.Make(Bap_knowledge.Knowledge).t ->
system ->
unit
enqueue system
creates a new job and enqueues it for future run.
val run :
?on_failure:(Job.t -> Bap_knowledge.Knowledge.conflict -> result -> action) ->
?on_success:
(Job.t -> exit_status -> Bap_knowledge.Knowledge.state -> result -> action) ->
Bap.Std.project ->
Bap_knowledge.Knowledge.state ->
result
run project state
runs until there are no more jobs queued or until explicitly stopped.
The project
and state
values are used as the initial static program representation and knowledge base.
Every time a job is finised either on_success
or on_conflict
is called. These callbacks shall return either Stop
or Continue
. If either returns Stop
then run
also stops even if there are more jobs in the queue (the jobs are not cleared, so pending ()
might be non-zero).
Both of the callbacks return Continue
by default.
val knowledge : result -> Bap_knowledge.Knowledge.state
knowledge result
is the knowledge obtained from running the jobs.
val project : result -> Bap.Std.project
project result
is the final static representation of program.
val failures : result -> (Job.t * Bap_knowledge.Knowledge.conflict) list
failures result
is the list of failed jobs.
Each failed is a pair of the job and and the description of the conflict that prevented system from convering.
The failures are specified in the order in which they happened.