1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
6 (* *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. *)
9 (* *)
10 (* All rights reserved. This file is distributed under the terms of *)
11 (* the GNU Lesser General Public License version 2.1, with the *)
12 (* special exception on linking described in the file LICENSE. *)
13 (* *)
14 (**************************************************************************)
15
16 (* The "trace" facility *)
17
18 open Format
19
20 type codeptr
21
22 type traced_function =
23 { path: Path.t; (* Name under which it is traced *)
24 closure: Obj.t; (* Its function closure (patched) *)
25 actual_code: codeptr; (* Its original code pointer *)
26 instrumented_fun: codeptr -> Obj.t -> Obj.t -> Obj.t }
27 (* Printing function *)
28
29 val traced_functions: traced_function list ref
30 val is_traced: Obj.t -> Path.t option
31 val get_code_pointer: Obj.t -> codeptr
32 val set_code_pointer: Obj.t -> codeptr -> unit
33 val instrument_closure:
34 Env.t -> Longident.t -> formatter -> Types.type_expr ->
35 codeptr -> Obj.t -> Obj.t -> Obj.t
36 val print_trace: Obj.t -> Obj.t -> Obj.t
37