Linker.Make
Make(Machine)
parametrize the Linker
with the Machine
.
Note that the Linker, as well as all other Primus Machine components, is stateless, i.e., the functor itself doesn't contain any non-syntactic values and thus it is purely functional. All the state is stored in the Machine
state. Thus it is absolutely safe, and correct, to create multiple instances of components, as they needed. The functor instatiation is totaly side-effect free.
type 'a m = 'a Machine.t
val link :
?addr:Bap.Std.addr ->
?name:string ->
?tid:Bap.Std.tid ->
code ->
unit m
link ~addr ~name ~tid code
links the given code
fragment into the Machine. The code can be invoked by one of the provided identifier. If no idetifiers were provided, then apparently code will not be ever invoked. If an identifier was already bound to some other code fragment, then the old binding will be substituted by the new one.
unlink name
removes code linked with the provided name
.
Also, removes all aliases of the given name
.
exec name
executes a code fragment associated with the given name. Terminates the computation with the Linker.Unbound_name name
condition, if the name
is not associated with any code fragment.
val resolve_addr : name -> Bap.Std.addr option m
resolve_addr name
returns the address associated with the given name
.
resolve_symbol name
returns the symbolic name associated with the given name
.
val resolve_tid : name -> Bap.Std.tid option m
resolve_tid name
returns the term identifier associated with the given name
.