12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758(**************************************************************************)(* *)(* SPDX-License-Identifier LGPL-2.1 *)(* Copyright (C) *)(* CEA (Commissariat à l'énergie atomique et aux énergies alternatives) *)(* *)(**************************************************************************)openServer(* Current callstack *)moduleInfo=structletname="Eva.Update.CurrentCallstacks"letdependencies=[Self.state]endmoduleCurrentCallstacks=State_builder.List_ref(Callstack)(Info)(* Hooks *)letadd_computation_hookf=Self.ComputationState.add_hook_on_change(fun_->f());Self.ComputationState.add_hook_on_update(fun_->f())letadd_callstack_hookf=CurrentCallstacks.add_hook_on_change(fun_->f())letadd_hookf=add_computation_hookf;add_callstack_hookf(** Eva provides information (values, taint status) about AST markers that may
change when the computation state or the selected callstacks change. *)let()=add_hookServer.Kernel_ast.Information.update(* Signals *)letpackage=lettitle="Signals emitted when the analysis results have changed"inPackage.package~plugin:"eva"~name:"signals"~title()letsignalnamedescr=letdescr=Markdown.plain("Emitted when "^descr)inRequest.signal~package~name~descrletcomputation_signal=signal"computationState""the computation state of the analysis has changed"letcallstack_signal=signal"currentCallstacks""the selected callstacks have changed"letsignals=[computation_signal;callstack_signal]let()=add_computation_hook(fun()->Request.emitcomputation_signal);add_callstack_hook(fun()->Request.emitcallstack_signal)