Module Primus.Linker

Machine Linker.

The Linker dynamically extends program with the new code.

The code is represented as a functor that performs a computation using a provided machine.

type name = [
  1. | `tid of Bap.Std.tid
  2. | `addr of Bap.Std.addr
  3. | `symbol of string
]

A code identifier.

A program code can be identified by a name, address or by a term identifier.

val bin_shape_name : Core_kernel.Bin_prot.Shape.t
val bin_size_name : name Core_kernel.Bin_prot.Size.sizer
val bin_write_name : name Core_kernel.Bin_prot.Write.writer
val bin_writer_name : name Core_kernel.Bin_prot.Type_class.writer
val bin_read_name : name Core_kernel.Bin_prot.Read.reader
val __bin_read_name__ : (int -> name) Core_kernel.Bin_prot.Read.reader
val bin_reader_name : name Core_kernel.Bin_prot.Type_class.reader
val bin_name : name Core_kernel.Bin_prot.Type_class.t
val compare_name : name -> name -> int
val sexp_of_name : name -> Ppx_sexp_conv_lib.Sexp.t
val name_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> name
val __name_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> name
module Trace : sig ... end

Call tracing.

type exn +=
  1. | Unbound_name of name

The Linker error

val exec : name observation

occurs before a piece of code is executed

val unresolved : name observation

occurs when an unresolved name is called, just before the unresolved trap is signaled. Could be used to install the trap handler.

  • since 1.5
val unresolved_handler : string

unresolved_handler is called instead of an unbound name.

  • since 1.5
module Name : Regular.Std.Regular.S with type t = name
module type Code = functor (Machine : Machine.S) -> sig ... end

Code representation.

type code = (module Code)

code representation

module Make (Machine : Machine.S) : sig ... end

Make(Machine) parametrize the Linker with the Machine.