-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathdebug_event.mli
77 lines (67 loc) · 3.53 KB
/
debug_event.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
(* *)
(* Copyright 1996 Institut National de Recherche en Informatique et *)
(* en Automatique. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
(* Structure of compilation environments *)
type closure_entry =
| Free_variable of int
| Function of int
type closure_env =
| Not_in_closure
| In_closure of {
entries: closure_entry Ident.tbl; (* Offsets of the free variables and
recursive functions from the start of
the block *)
env_pos: int; (* Offset of the current function from
the start of the block *)
}
type compilation_env =
{ ce_stack: int Ident.tbl; (* Positions of variables in the stack *)
ce_closure: closure_env } (* Structure of the heap-allocated env *)
(* The ce_stack component gives locations of variables residing
in the stack. The locations are offsets w.r.t. the origin of the
stack frame.
The ce_closure component gives the positions of variables residing in the
heap-allocated environment. The env_pos component gives the position of
the current function from the start of the closure block, and the entries
component gives the positions of free variables and functions bound by the
same let rec as the current function, from the start of the closure block.
These are used by the ENVACC and OFFSETCLOSURE instructions to recover the
relevant value from the env register (which points to the current function).
*)
(* Debugging events *)
(* Warning: when you change these types, check runtime/backtrace_byt.c *)
type debug_event =
{ mutable ev_pos: int; (* Position in bytecode *)
ev_module: string; (* Name of defining module *)
ev_loc: Location.t; (* Location in source file *)
ev_kind: debug_event_kind; (* Before/after event *)
ev_defname: string; (* Enclosing definition *)
ev_info: debug_event_info; (* Extra information *)
ev_typenv: Env.summary; (* Typing environment *)
ev_typsubst: Subst.t; (* Substitution over types *)
ev_compenv: compilation_env; (* Compilation environment *)
ev_stacksize: int; (* Size of stack frame *)
ev_repr: debug_event_repr } (* Position of the representative *)
and debug_event_kind =
Event_before
| Event_after of Types.type_expr
| Event_pseudo
and debug_event_info =
Event_function
| Event_return of int
| Event_other
and debug_event_repr =
Event_none
| Event_parent of int ref
| Event_child of int ref